private ClientBuilderViewModel()
        {
            _plugins =
                new ObservableCollection <PluginViewModel>(
                    PluginManager.Current.LoadedPlugins.Select(x =>
            {
                var buildPlugin = x as BuildPlugin;
                if (buildPlugin != null)
                {
                    return((PluginViewModel) new BuilderPluginViewModel(buildPlugin));
                }

                var clientPlugin = x as ClientPlugin;
                if (clientPlugin != null)
                {
                    return(new ClientPluginViewModel(clientPlugin));
                }

                var factoryCommandPlugin = x as FactoryCommandPlugin;
                if (factoryCommandPlugin != null)
                {
                    return(new FactoryPluginViewModel(factoryCommandPlugin));
                }

                return(null);
            }).Where(x => x != null));

            foreach (var pluginViewModel in _plugins)
            {
                pluginViewModel.OpenSettings    += PluginViewModelOnOpenSettings;
                pluginViewModel.SelectedChanged += PluginViewModelOnSelectedChanged;
            }

            Plugins = CollectionViewSource.GetDefaultView(_plugins);
            Plugins.GroupDescriptions.Add(new PropertyGroupDescription("IsBuildPlugin"));
            Plugins.SortDescriptions.Add(new SortDescription("IsBuildPlugin", ListSortDirection.Ascending));
            Plugins.Filter = FilterPlugins;

            BuilderSettingsManager = new BuilderSettingsManager();
            BuilderSettingsManager.BuilderSettingsOverwriteRequest +=
                BuilderSettingsManagerOnBuilderSettingsOverwriteRequest;

            BuildConfigurationManager = new BuildConfigurationManager();
        }
Ejemplo n.º 2
0
 public ConfigurationManagerViewModel(BuildConfigurationManager buildConfigurationManager)
 {
     BuildConfigurationManager = buildConfigurationManager;
 }