Beispiel #1
0
        protected virtual void OnGottenPlugins(GottenPluginsPluginManagerEventArgs e)
        {
            EventHandler <GottenPluginsPluginManagerEventArgs> handler = GottenPlugins;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Gets the related plugins.
        /// </summary>
        /// <returns></returns>
        public Collection <Plugin> GetPlugins()
        {
            Collection <Plugin> resultPlugins = new Collection <Plugin>();

            GettingPluginsPluginManagerEventArgs args = new GettingPluginsPluginManagerEventArgs();

            OnGettingPlugins(args);

            foreach (var item in args.Plugins)
            {
                resultPlugins.Add(item);
            }

            if (plugins == null)
            {
                plugins = new GeoCollection <Plugin>();
                GetPluginsCore().OrderBy(p => p.Index).ForEach(p =>
                {
                    if (!plugins.Contains(p.Id))
                    {
                        plugins.Add(p.Id, p);
                    }
                });
            }

            foreach (var item in plugins)
            {
                resultPlugins.Add(item);
            }

            GottenPluginsPluginManagerEventArgs gottenArgs = new GottenPluginsPluginManagerEventArgs(resultPlugins);

            OnGottenPlugins(gottenArgs);

            return(gottenArgs.Plugins);
        }