public static IEnumerable <T> GetInstalledPlugins <T>(PluginType pluginType) where T : IPlugin { IEnumerable <PluginInfo> installedPluginInfos = PluginsManagement.GetInstalledPluginInfos(pluginType); T[] array = new T[installedPluginInfos.Count <PluginInfo>()]; int num = 0; foreach (PluginInfo current in installedPluginInfos) { array[num++] = Instance.Get <T>(current.ClassFullName); } return(array); }
public static IEnumerable <Plugin <T> > GetPlugins <T>() where T : IPlugin { PluginType pluginTypeByType = PluginsManagement.GetPluginTypeByType(typeof(T)); IEnumerable <PluginInfo> installedPluginInfos = PluginsManagement.GetInstalledPluginInfos(pluginTypeByType); int num = installedPluginInfos.Count <PluginInfo>(); Plugin <T>[] array = new Plugin <T> [num]; for (int i = 0; i < num; i++) { array[i] = new Plugin <T> { Biz = Instance.Get <T>(installedPluginInfos.ElementAt(i).ClassFullName), PluginInfo = installedPluginInfos.ElementAt(i) }; } return(array); }