void pluginManager_OnExceptionOccured(object sender, PluginManagerEventArgs args) { OnGuiLogNotificationOccured(Resource.pluginManager, new GuiLogEventArgs(args.Exception.Message, null, NotificationLevel.Error)); //this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, // new GuiLogNotificationDelegate(OnGuiLogNotificationOccuredTS), Resource.pluginManager, new object[] { new GuiLogEventArgs(args.Exception.Message, null, NotificationLevel.Error) }); }
void pluginManager_OnDebugMessageOccured(object sender, PluginManagerEventArgs args) { OnGuiLogNotificationOccured(Resource.pluginManager, new GuiLogEventArgs(args.Exception.Message, null, NotificationLevel.Debug)); //this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, // new GuiLogNotificationDelegate(OnGuiLogNotificationOccuredTS), Resource.pluginManager, new object[] { new GuiLogEventArgs(args.Exception.Message, null, NotificationLevel.Debug) }); }
void OnPluginChanged(object sender, PluginManagerEventArgs <IPlugin> e) { if (e.ChangeType == PluginChangeType.Created) { lastLoadedPlugin = e.PluginInstance; // 这里初始化插件,提供服务 e.PluginInstance.Run(DateTime.Now.ToString(), new Action(() => { Debug.Print(AppDomain.CurrentDomain.FriendlyName); MessageBox.Show(DateTime.Now.ToString()); })); } }