Ejemplo n.º 1
0
        public static IEnumerable <T> GetInstalledPlugins <T>(PluginType pluginType)
            where T : IPlugin
        {
            IEnumerable <PluginInfo> installedPluginInfos = PluginsManagement.GetInstalledPluginInfos(pluginType);

            T[] tArray = new T[installedPluginInfos.Count()];
            int num    = 0;

            foreach (PluginInfo installedPluginInfo in installedPluginInfos)
            {
                int num1 = num;
                num          = num1 + 1;
                tArray[num1] = Instance.Get <T>(installedPluginInfo.ClassFullName);
            }
            return(tArray);
        }
Ejemplo n.º 2
0
        public static IEnumerable <Plugin <T> > GetPlugins <T>()
            where T : IPlugin
        {
            IEnumerable <PluginInfo> installedPluginInfos = PluginsManagement.GetInstalledPluginInfos(PluginsManagement.GetPluginTypeByType(typeof(T)));
            int num = installedPluginInfos.Count();

            Plugin <T>[] pluginArray = new Plugin <T> [num];
            for (int i = 0; i < num; i++)
            {
                Plugin <T> plugin = new Plugin <T>()
                {
                    Biz        = Instance.Get <T>(installedPluginInfos.ElementAt <PluginInfo>(i).ClassFullName),
                    PluginInfo = installedPluginInfos.ElementAt <PluginInfo>(i)
                };
                pluginArray[i] = plugin;
            }
            return(pluginArray);
        }