Пример #1
0
        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) });
        }
Пример #2
0
        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) });
        }
Пример #3
0
 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()); }));
     }
 }