Esempio n. 1
0
        private void AddPages()
        {
            pnlButtons.Controls.Clear();

            int nextLeft = 0;

            for (int i = 0; i < m_PrefPages.Count; i++)
            {
                IPreferencePanel page = m_PrefPages[i] as IPreferencePanel;
                if (page != null)
                {
                    // Button
                    PreferencePanelButtton ppb = new PreferencePanelButtton(page);
                    ppb.Click += new EventHandler(preferencePanelButton_Click);

                    ppb.Left  = nextLeft;
                    nextLeft += ppb.Width;

                    pnlButtons.Controls.Add(ppb);
                    m_PrefsButtons.Add(ppb);

                    // Page
                    page.Location = new Point(14, this.pnlButtons.Bottom + 14);
                    page.Visible  = false;
                    this.Controls.Add((UserControl)page);
                }
            }
        }
Esempio n. 2
0
        private void DisplayTab(PreferenceTab tab)
        {
            int index = -1;
            IPreferencePanel panel = null;

            for (int i = 0; i < pages.Count; i++)
            {
                panel = pages[i] as IPreferencePanel;
                if (panel == null || !panel.Tabs.Contains(tab))
                {
                    continue;
                }

                index = i;
                break;
            }

            if (index < 0 || panel == null)
            {
                return;
            }

            DisplayPage(index);
            panel.OpenTab(tab);
        }
Esempio n. 3
0
 public PreferencePanelButtton(IPreferencePanel _PreferencePanel)
 {
     InitializeComponent();
     m_PreferencePanel = _PreferencePanel;
 }
Esempio n. 4
0
 public PreferencePanelButtton(IPreferencePanel preferencePanel)
 {
     InitializeComponent();
     this.preferencePanel = preferencePanel;
 }