private void DisplayElement(IElementPropertyInfo element) { Debug.Assert(element != null, "element != null"); // Set the label. lblName.Text = element.Name; // Property page control. ClearCurrentPage(); ElementPropertyPage page = element.PropertyPage; if (page != null) { bool pageAdded = AddPage(page); page.Size = panDetails.Size; page.Visible = true; m_currentPage = page; // Now that everything is set fire the event if needed. if (pageAdded) { OnPageAdded(EventArgs.Empty); } } }
private void ClearCurrentPage() { if (m_currentPage != null) { m_currentPage.Visible = false; m_currentPage = null; } }
private static void SavePropertyPage(ElementPropertyPage page) { try { page.OnSave(); } catch (System.Exception ex) { if (page.IsValid) { throw new ApplicationException("A property page of type '" + page.GetType().FullName + "' threw an exception in OnSave() when IsValid returned true.", ex); } else { throw; } } }
private bool AddPage(ElementPropertyPage page) { if (page == null) { return(false); } // Check whether it is already there. if (panDetails.Controls.Contains(page)) { return(false); } page.PropertyPageParent = this; page.Location = new Point(0, 0); page.Visible = false; panDetails.Controls.Add(page); m_propertyPages.Add(page); return(true); }
public virtual void ViewElement(string view) { m_currentView = view; m_propertyPage = null; }