第 0 阶段:教材项目 2 任务 1 在网页中原样运行

- runtime:仿真 WinForms 子集(Form、Button、Label、TextBox、ComboBox、
  GroupBox、Timer、MessageBox、界面线程消息循环、跨线程检查)、
  教材设备类库(DeviceCtrlHelper、LED 控件)、运行器(常驻编译服务 + 运行模式)
- server:Bun + Hono,WebSocket 会话,每次运行一个进程,消息转发
- web:Vue + Naive UI,WinForms 风格窗体渲染、MessageBox、实训台 LED 屏
- 端到端测试与 100 个程序并发的压力测试
- 教材逐任务摘要(docs/教材摘要)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-22 10:15:14 +08:00
commit 98be8331bc
71 files changed
+7919

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
using System.Threading;
using Sim.Host;
namespace System.Windows.Forms;
public delegate void MethodInvoker();
/// <summary>界面线程的同步上下文:Send 同步执行,Post 排队执行(教材项目 8 用它从后台线程更新界面)</summary>
public sealed class WindowsFormsSynchronizationContext : SynchronizationContext
{
public override void Send(SendOrPostCallback d, object? state) => SimHost.Ui.Send(() => d(state));
public override void Post(SendOrPostCallback d, object? state) => SimHost.Ui.Post(() => d(state));
public override SynchronizationContext CreateCopy() => new WindowsFormsSynchronizationContext();
}