Exemplo n.º 1
0
        private void _treeview_NodeSelected(object sender, TreeViewEventArgs e)
        {
            Control controlToActivate = null;

            if (e.Node.Text == "Rubberduck")
            {
                TitleLabel.Text        = RubberduckUI.SettingsCaption_GeneralSettings;
                InstructionsLabel.Text = RubberduckUI.SettingsInstructions_GeneralSettings;
                ActivateControl(_generalSettingsView);
                return;
            }

            if (e.Node.Text == "To-Do Explorer")
            {
                TitleLabel.Text        = RubberduckUI.SettingsCaption_ToDoSettings;
                InstructionsLabel.Text = RubberduckUI.SettingsInstructions_ToDoSettings;
                controlToActivate      = _todoView;
            }

            if (e.Node.Parent.Text == "Code Inspections")
            {
                TitleLabel.Text        = RubberduckUI.SettingsCaption_CodeInspections;
                InstructionsLabel.Text = RubberduckUI.SettingsInstructions_CodeInspections;
                var inspectionType = (CodeInspectionType)Enum.Parse(typeof(CodeInspectionType), e.Node.Text);
                controlToActivate = new CodeInspectionSettingsControl(GetInspectionSettings(inspectionType));
            }

            if (e.Node.Parent.Text == CodeInspectionType.LanguageOpportunities.ToString())
            {
                TitleLabel.Text        = RubberduckUI.SettingsCaption_CodeInspections;
                InstructionsLabel.Text = RubberduckUI.SettingsInstructions_CodeInspections;
                controlToActivate      = new CodeInspectionSettingsControl(_config.UserSettings.CodeInspectionSettings.CodeInspections.ToList());
            }

            ActivateControl(controlToActivate);
        }
Exemplo n.º 2
0
        private void _treeview_NodeSelected(object sender, TreeViewEventArgs e)
        {
            Control controlToActivate = null;

            if (e.Node == null)
            {
                // a "parent" node is selected. todo: create a page for "parent" nodes.
                return;
            }

            if (e.Node.Text == "Rubberduck")
            {
                TitleLabel.Text        = RubberduckUI.SettingsCaption_GeneralSettings;
                InstructionsLabel.Text = RubberduckUI.SettingsInstructions_GeneralSettings;
                ActivateControl(_generalSettingsView);
                return;
            }

            if (e.Node.Text == RubberduckUI.TodoSettings_Caption)
            {
                TitleLabel.Text        = RubberduckUI.SettingsCaption_ToDoSettings;
                InstructionsLabel.Text = RubberduckUI.SettingsInstructions_ToDoSettings;
                controlToActivate      = _todoView;
            }

            if (e.Node.Parent.Text == RubberduckUI.CodeInspections)
            {
                TitleLabel.Text        = RubberduckUI.SettingsCaption_CodeInspections;
                InstructionsLabel.Text = RubberduckUI.SettingsInstructions_CodeInspections;
                var inspectionType      = (CodeInspectionType)Enum.Parse(typeof(CodeInspectionType), e.Node.Name);
                var settingGridViewSort = new GridViewSort <CodeInspectionSetting>(RubberduckUI.Name, true);
                controlToActivate = new CodeInspectionSettingsControl(GetInspectionSettings(inspectionType), settingGridViewSort);
            }

            ActivateControl(controlToActivate);
        }
Exemplo n.º 3
0
        private void _treeview_NodeSelected(object sender, TreeViewEventArgs e)
        {
            Control controlToActivate = null;
            if (e.Node == null)
            {
                // a "parent" node is selected. todo: create a page for "parent" nodes.
                return;
            }

            if (e.Node.Text == "Rubberduck")
            {
                TitleLabel.Text = RubberduckUI.SettingsCaption_GeneralSettings;
                InstructionsLabel.Text = RubberduckUI.SettingsInstructions_GeneralSettings;
                ActivateControl(_generalSettingsView);
                return;
            }

            if (e.Node.Text == RubberduckUI.TodoSettings_Caption)
            {
                TitleLabel.Text = RubberduckUI.SettingsCaption_ToDoSettings;
                InstructionsLabel.Text = RubberduckUI.SettingsInstructions_ToDoSettings;
                controlToActivate = _todoView;
            }

            if (e.Node.Parent.Text == RubberduckUI.CodeInspections)
            {
                TitleLabel.Text = RubberduckUI.SettingsCaption_CodeInspections;
                InstructionsLabel.Text = RubberduckUI.SettingsInstructions_CodeInspections;
                var inspectionType = (CodeInspectionType)Enum.Parse(typeof(CodeInspectionType), e.Node.Name);
                var settingGridViewSort = new GridViewSort<CodeInspectionSetting>(RubberduckUI.Name, true);
                controlToActivate = new CodeInspectionSettingsControl(GetInspectionSettings(inspectionType), settingGridViewSort);
            }

            ActivateControl(controlToActivate);
        }