示例#1
0
 private void LoadPluginModules()
 {
     foreach (Plugin plugin in _pluginManagementService.GetAllPlugins().Where(p => p.IsEnabled))
     {
         plugin.Kernel.Load(new[] { new PluginUIModule(plugin) });
     }
 }
示例#2
0
        /// <inheritdoc />
        protected override void OnActivate()
        {
            Items.Clear();

            // _pluginManagementService.GetFeaturesOfType<>() will only give us enabled features so lets get all of them this way
            IEnumerable <PluginFeatureInfo> features = _pluginManagementService.GetAllPlugins()
                                                       .SelectMany(p => p.Features.Where(f => typeof(DeviceProvider).IsAssignableFrom(f.FeatureType)))
                                                       .OrderBy(d => d.GetType().Name);

            Items.AddRange(features.Select(d => _settingsVmFactory.CreatePluginFeatureViewModel(d, true)));

            base.OnActivate();
        }
 public IEnumerable <PluginInfo> GetPlugins()
 {
     return(_pluginManagementService.GetAllPlugins().Select(p => p.Info));
 }