예제 #1
0
        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);
                }
            }
        }
예제 #2
0
 private void ClearCurrentPage()
 {
     if (m_currentPage != null)
     {
         m_currentPage.Visible = false;
         m_currentPage         = null;
     }
 }
예제 #3
0
 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;
         }
     }
 }
예제 #4
0
        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);
        }
예제 #5
0
 public virtual void ViewElement(string view)
 {
     m_currentView  = view;
     m_propertyPage = null;
 }