Ejemplo n.º 1
0
 private void EventFormClosed(object sender, FormClosedEventArgs e)
 {
     foreach (TreeNode node in TreeViewOptions.Nodes)
     {
         OptionPageWinForms page = node.Tag as OptionPageWinForms;
         page.Dispose();
     }
 }
Ejemplo n.º 2
0
 private void EventFormClosed(object sender, EventArgs e)
 {
     foreach (TabPage page in iTabControl.TabPages)
     {
         OptionPageWinForms optionPage = page.Tag as OptionPageWinForms;
         optionPage.Dispose();
     }
 }
Ejemplo n.º 3
0
 private void MenuItemResetClick(object sender, EventArgs e)
 {
     if (iTabControl.SelectedIndex != -1)
     {
         OptionPageWinForms optionPage = iTabControl.TabPages[iTabControl.SelectedIndex].Tag as OptionPageWinForms;
         foreach (Option o in optionPage.OptionPage.Options)
         {
             o.ResetToDefault();
         }
     }
 }
Ejemplo n.º 4
0
 private void ButtonResetClick(object sender, EventArgs e)
 {
     if (TreeViewOptions.SelectedNode != null)
     {
         OptionPageWinForms winformPage = TreeViewOptions.SelectedNode.Tag as OptionPageWinForms;
         IOptionPage        page        = winformPage.OptionPage;
         foreach (Option o in page.Options)
         {
             o.ResetToDefault();
         }
     }
 }
Ejemplo n.º 5
0
        public void SetTheme(ITheme aTheme)
        {
            aTheme.ApplyForm(this);
            aTheme.ApplyMainMenu(iMainMenu);
            aTheme.ApplyMainMenuItem(iMenuItemDone);
            aTheme.ApplyMainMenuItem(iMenuItemReset);

            aTheme.ApplyTabControl(iTabControl);
            foreach (TabPage page in iTabControl.TabPages)
            {
                aTheme.ApplyTabPage(page);
                OptionPageWinForms optionPage = page.Tag as OptionPageWinForms;
                optionPage.SetTheme(aTheme);
            }
        }
Ejemplo n.º 6
0
        private void TreeViewOptions_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (e.Node != null)
            {
                OptionPageWinForms page    = e.Node.Tag as OptionPageWinForms;
                Control            control = page.Control;
                control.Size = PanelOptionsPage.Size;
                control.Dock = DockStyle.Fill;

                PanelOptionsPage.SuspendLayout();
                PanelOptionsPage.Controls.Clear();
                PanelOptionsPage.Controls.Add(control);
                PanelOptionsPage.ResumeLayout(true);
            }
            else
            {
                if (TreeViewOptions.Nodes.Count > 0)
                {
                    TreeViewOptions.SelectedNode = TreeViewOptions.Nodes[0];
                }
            }
        }
Ejemplo n.º 7
0
        public FormUserOptions(IList <IOptionPage> aOptionPages)
        {
            InitializeComponent();
            iButtonOk.Select();

            Size panelSize = PanelOptionsPage.Size;

            foreach (IOptionPage optionPage in aOptionPages)
            {
                OptionPageWinForms page = new OptionPageWinForms(panelSize.Width, optionPage, HelpBox);

                TreeNode node = new TreeNode();
                node.Name = optionPage.Name;
                node.Text = optionPage.Name;
                node.Tag  = page;
                TreeViewOptions.Nodes.Add(node);
            }

            if (aOptionPages.Count > 0)
            {
                TreeViewOptions.SelectedNode = TreeViewOptions.Nodes[0];
            }
        }
Ejemplo n.º 8
0
        public FormUserOptions(IList <IOptionPage> aOptionPages)
        {
            InitializeComponent();

            foreach (IOptionPage optionPage in aOptionPages)
            {
                // create the controls for the options page
                OptionPageWinForms page = new OptionPageWinForms(iTabControl.Width, optionPage);

                // add the tab page
                TabPage tabPage = new TabPage();
                tabPage.Name = optionPage.Name;
                tabPage.Text = optionPage.Name;
                tabPage.Tag  = page;
                tabPage.Controls.Add(page.Control);
                iTabControl.TabPages.Add(tabPage);
            }

            if (aOptionPages.Count > 0)
            {
                iTabControl.SelectedIndex = 0;
            }
        }