Exemplo n.º 1
0
 protected virtual void OnPluginUnloaded(PluginUnloadedEventArgs e)
 {
     if (this.EventsEnabled)
     {
         var evnt = this.PluginUnloaded;
         if (evnt != null)
         {
             evnt(this, e);
         }
     }
 }
Exemplo n.º 2
0
        public void UnloadPlugin(IPlugin plugin)
        {
            if (!ListPlugins.Contains(plugin))
            {
                return;
            }
            EventsManager.UnregisterEvents(plugin);
            ListPlugins.Remove(plugin);
            PluginUnloadedEventArgs unloadedEventArgs = new PluginUnloadedEventArgs(plugin);

            EventsManager.CallEvent(unloadedEventArgs);
        }
Exemplo n.º 3
0
        private void Unload(PluginInfo info, PluginParameters results, bool execCancelled, object execCancelledReason)
        {
            if (info != null)
            {
                try
                {
                    AppDomain.Unload(info.Domain);
                }
                catch (AppDomainUnloadedException) { }

                this._currentInfoList.Remove(info);

                PluginUnloadedEventArgs pluginUnloadedArgs = new PluginUnloadedEventArgs(info, results, execCancelled, execCancelledReason);
                this.OnPluginUnloaded(pluginUnloadedArgs);
            }
        }
Exemplo n.º 4
0
        private void Loader_PluginUnloaded(object sender, PluginUnloadedEventArgs e)
        {
            var providers = e.Plugin.Context.ApplicationContext.OptionManager.Providers;

            var found = providers.FirstOrDefault(provider =>
            {
                var proxy = provider as ConfigurationProxy;

                return(proxy != null && proxy.IsValueCreated &&
                       string.Equals(proxy.Value.FilePath, OptionUtility.GetConfigurationFilePath(e.Plugin)));
            });

            if (found != null)
            {
                providers.Remove(found);
            }
        }
Exemplo n.º 5
0
        private void Unload(PluginInfo info, PluginParameters results, bool execCancelled, object execCancelledReason)
        {
            if (info != null)
            {
                try
                {
                    AppDomain.Unload(info.Domain);
                }
                catch (AppDomainUnloadedException) { }

                this._currentInfoList.Remove(info);

                PluginUnloadedEventArgs pluginUnloadedArgs = new PluginUnloadedEventArgs(info, results, execCancelled, execCancelledReason);
                this.OnPluginUnloaded(pluginUnloadedArgs);
            }
        }
Exemplo n.º 6
0
 protected virtual void OnPluginUnloaded(PluginUnloadedEventArgs e)
 {
     if (this.EventsEnabled)
     {
         var evnt = this.PluginUnloaded;
         if (evnt != null)
             evnt(this, e);
     }
 }
Exemplo n.º 7
0
 private void PluginUnloaded(object sender, PluginUnloadedEventArgs e)
 {
     TaskHelper.Run(() => pluginViews.Remove(e.PluginView), taskScheduler);
 }