Exemplo n.º 1
0
        protected virtual void OnGettingPlugins(GettingPluginsPluginManagerEventArgs e)
        {
            EventHandler <GettingPluginsPluginManagerEventArgs> handler = GettingPlugins;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemplo n.º 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);
        }