private void EditConfigs()
        {
            IConfigurationEditorDialog editorView = view.ConfigurationEditorDialog;

            new ConfigurationEditor(model, editorView);
            editorView.ShowDialog();

            string selectedConfig = view.ConfigList.SelectedItem;

            string[] configs = model.ConfigNames;

            view.ConfigList.SelectionList = configs;

            if (configs.Length > 0)
            {
                view.ConfigList.SelectedIndex = 0;
                foreach (string config in configs)
                {
                    if (config == selectedConfig)
                    {
                        view.ConfigList.SelectedItem = config;
                    }
                }
            }

            view.ActiveConfigName.Text = model.ActiveConfigName;
        }
Esempio n. 2
0
        public void Initialize()
        {
            ProjectDocument doc = new ProjectDocument();
            doc.LoadXml(NUnitProjectXml.NormalProject);
            model = new ProjectModel(doc);

            view = Substitute.For<IConfigurationEditorDialog>();

            editor = new ConfigurationEditor(model, view);
        }
        public void Initialize()
        {
            ProjectDocument doc = new ProjectDocument();

            doc.LoadXml(NUnitProjectXml.NormalProject);
            model = new ProjectModel(doc);

            view = Substitute.For <IConfigurationEditorDialog>();

            editor = new ConfigurationEditor(model, view);
        }
        public ConfigurationEditor(IPropertyModel model, IConfigurationEditorDialog view)
        {
            this.model = model;
            this.view = view;

            UpdateConfigList();

            view.AddCommand.Execute += AddConfig;
            view.RemoveCommand.Execute += RemoveConfig;
            view.RenameCommand.Execute += RenameConfig;
            view.ActiveCommand.Execute += MakeActive;

            view.ConfigList.SelectionChanged += SelectedConfigChanged;
        }
        public ConfigurationEditor(IProjectModel model, IConfigurationEditorDialog view)
        {
            this.model = model;
            this.view  = view;

            UpdateConfigList();

            view.AddCommand.Execute    += AddConfig;
            view.RemoveCommand.Execute += RemoveConfig;
            view.RenameCommand.Execute += RenameConfig;
            view.ActiveCommand.Execute += MakeActive;

            view.ConfigList.SelectionChanged += SelectedConfigChanged;
        }