public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText) { pluginScreenSpace.Text = "鲶鱼精邮差"; PluginUI = new PostNamazuUi(); PluginUI.InitializeComponent(pluginScreenSpace); Dock = DockStyle.Fill; // Expand the UserControl to fill the tab's client space _lblStatus = pluginStatusText; // Hand the status label's reference to our local var _ffxivPlugin = GetFfxivPlugin(); //目前解析插件有bug,在特定情况下无法正常触发ProcessChanged事件。因此只能通过后台线程实时监控 //_ffxivPlugin.DataSubscription.ProcessChanged += ProcessChanged; _processSwitcher = new BackgroundWorker { WorkerSupportsCancellation = true }; _processSwitcher.DoWork += ProcessSwitcher; _processSwitcher.RunWorkerAsync(); if (PluginUI.AutoStart) { ServerStart(); } TriggIntegration(); PluginUI.ButtonStart.Click += ServerStart; PluginUI.ButtonStop.Click += ServerStop; _lblStatus.Text = "鲶鱼精邮差已启动"; }