public MvcControl SetActiveTabByCaption(string caption) { MvcTabPage tabPage = FindTabByCaption(caption); if (tabPage != null) { SelectedTab = tabPage; return(tabPage.MvcControl); } return(null); }
private int FindIndexToInsert(MvcTabPage tabPage) { int i = 0; for (; i < TabPages.Count; i++) { if (((MvcTabPage)TabPages[i]).Order > tabPage.Order) { break; } } return(i); }
public void AddTab(MvcControl mvcControl) { Debug.Assert(m_isInitialized, "Still not initialized"); MvcTabPage tabPage = new MvcTabPage(this, mvcControl); tabPage.VisibleChanged += OnTabVisibleChanged; int index = FindIndexToInsert(tabPage); TabPages.Insert(index, tabPage); tabPage.Initialize(); m_tabPages.Add(tabPage); }
private void OnTabVisibleChanged(object sender, EventArgs e) { Debug.Assert(sender != null && sender is MvcTabPage); MvcTabPage tabPage = (MvcTabPage)sender; if (!tabPage.Visible) { TabPages.Remove(tabPage); } else //from non visible to visible: need to insert { int index = FindIndexToInsert(tabPage); TabPages.Insert(index, tabPage); } }
internal void Initialize(MvcTabPage parent) { m_mvcTabPage = parent; Initialize(); }