private void AddPage(MozItem item, PropertyPage page) { var pageProp = new PageProp(); pageProp.Page = page; pageProp.MozItem = item; mozPane1.Items.Add(item); pages.Add(item.Name, pageProp); }
public void Init() { foreach (PageProp pageProp in pages.Values) { PropertyPage page = pageProp.Page; pagePanel.Controls.Add(page); page.Dock = DockStyle.Fill; page.Visible = false; } if (pages.Count != 0) { ActivatePage(mozPane1.Items[0]); } }
private bool ActivatePage(MozItem item) { if (!pages.ContainsKey(item.Name)) { return false; } PageProp pageProp = pages[item.Name]; PropertyPage page = pageProp.Page; if (activePage != null) { activePage.Visible = false; } activePage = page; if (activePage != null) { mozPane1.SelectByName(item.Name); activePage.Visible = true; if (!page.IsInit) { page.OnInit(); page.IsInit = true; } activePage.OnSetActive(); } return true; }
private bool ActivatePage(MozItem item) { if (!pages.ContainsKey(item.Name)) { return(false); } PageProp pageProp = pages[item.Name]; PropertyPage page = pageProp.Page; if (activePage != null) { activePage.Visible = false; } activePage = page; if (activePage != null) { mozPane1.SelectByName(item.Name); activePage.Visible = true; if (!page.IsInit) { page.OnInit(); page.IsInit = true; } activePage.OnSetActive(); } return(true); }
public void AddPage(string text, int imageIndex, PropertyPage page) { AddPage(GetMozItem(text, imageIndex), page); }
public void AddPage(string text, PropertyPage page) { AddPage(GetMozItem(text), page); }