private void XpanderPanelPanelStyleChanged(object sender, PanelStyleChangeEventArgs e)
 {
    PanelStyle panelStyle = e.PanelStyle;
    if(panelStyle != this.m_ePanelStyle)
    {
       this.PanelStyle = panelStyle;
    }
 }
Пример #2
0
        /// <summary>
        /// Raises the PanelStyle changed event
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">A PanelStyleChangeEventArgs that contains the event data.</param>
        protected virtual void OnPanelStyleChanged(object sender, PanelStyleChangeEventArgs e)
        {
            PanelStyle panelStyle = e.PanelStyle;

            if (panelStyle != PanelStyle.Aqua)
            {
                this.Padding = new System.Windows.Forms.Padding(0);
            }
            else
            {
                this.Padding = new System.Windows.Forms.Padding(3);
            }
            foreach (XPanderPanel xpanderPanel in this.XPanderPanels)
            {
                PropertyDescriptorCollection propertyDescriptorCollection = TypeDescriptor.GetProperties(xpanderPanel);
                if (propertyDescriptorCollection.Count > 0)
                {
                    PropertyDescriptor propertyDescriptorPanelStyle = propertyDescriptorCollection["PanelStyle"];
                    if (propertyDescriptorPanelStyle != null)
                    {
                        propertyDescriptorPanelStyle.SetValue(xpanderPanel, panelStyle);
                    }
                    PropertyDescriptor propertyDescriptorLeft = propertyDescriptorCollection["Left"];
                    if (propertyDescriptorLeft != null)
                    {
                        propertyDescriptorLeft.SetValue(xpanderPanel, this.Padding.Left);
                    }
                    PropertyDescriptor propertyDescriptorWidth = propertyDescriptorCollection["Width"];
                    if (propertyDescriptorWidth != null)
                    {
                        propertyDescriptorWidth.SetValue(
                            xpanderPanel,
                            this.ClientRectangle.Width
                            - this.Padding.Left
                            - this.Padding.Right);
                    }
                }
            }
            if (this.PanelStyleChanged != null)
            {
                this.PanelStyleChanged(sender, e);
            }
        }
Пример #3
0
        /// <summary>
        /// Raises the PanelStyle changed event
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">A PanelStyleChangeEventArgs that contains the event data.</param>
        protected virtual void OnPanelStyleChanged(object sender, PanelStyleChangeEventArgs e)
        {
            var panelStyle = e.PanelStyle;

            Padding = new Padding(0);

            foreach (XPanderPanel xpanderPanel in XPanderPanels)
            {
                var propertyDescriptorCollection = TypeDescriptor.GetProperties(xpanderPanel);
                if (propertyDescriptorCollection.Count > 0)
                {
                    var propertyDescriptorPanelStyle = propertyDescriptorCollection["PanelStyle"];
                    if (propertyDescriptorPanelStyle != null)
                    {
                        propertyDescriptorPanelStyle.SetValue(xpanderPanel, panelStyle);
                    }
                    var propertyDescriptorLeft = propertyDescriptorCollection["Left"];
                    if (propertyDescriptorLeft != null)
                    {
                        propertyDescriptorLeft.SetValue(xpanderPanel, Padding.Left);
                    }
                    var propertyDescriptorWidth = propertyDescriptorCollection["Width"];
                    if (propertyDescriptorWidth != null)
                    {
                        propertyDescriptorWidth.SetValue(
                            xpanderPanel,
                            ClientRectangle.Width
                            - Padding.Left
                            - Padding.Right);
                    }
                }
            }
            if (PanelStyleChanged != null)
            {
                PanelStyleChanged(sender, e);
            }
        }
Пример #4
0
 /// <summary>
 /// Raises the PanelStyleChanged event
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">A EventArgs that contains the event data.</param>
 protected override void OnPanelStyleChanged(object sender, PanelStyleChangeEventArgs e)
 {
     OnLayout(new LayoutEventArgs(this, null));
     base.OnPanelStyleChanged(sender, e);
 }
Пример #5
0
 /// <summary>
 /// Raises the PanelStyleChanged event
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">A EventArgs that contains the event data.</param>
 protected override void OnPanelStyleChanged(object sender, PanelStyleChangeEventArgs e)
 {
     OnLayout(new LayoutEventArgs(this, null));
      base.OnPanelStyleChanged(sender, e);
 }
Пример #6
0
 private void XpanderPanelPanelStyleChanged(object sender, PanelStyleChangeEventArgs e)
 {
    PanelStyle panelStyle = e.PanelStyle;
    if(panelStyle != this.m_ePanelStyle)
    {
       this.PanelStyle = panelStyle;
    }
 }
Пример #7
0
      /// <summary>
      /// Raises the PanelStyle changed event
      /// </summary>
      /// <param name="sender">The source of the event.</param>
      /// <param name="e">A PanelStyleChangeEventArgs that contains the event data.</param>
      protected virtual void OnPanelStyleChanged(object sender, PanelStyleChangeEventArgs e)
      {
         PanelStyle panelStyle = e.PanelStyle;
         this.Padding = new System.Windows.Forms.Padding(0);

         foreach(XPanderPanel xpanderPanel in this.XPanderPanels)
         {
            PropertyDescriptorCollection propertyDescriptorCollection = TypeDescriptor.GetProperties(xpanderPanel);
            if(propertyDescriptorCollection.Count > 0)
            {
               PropertyDescriptor propertyDescriptorPanelStyle = propertyDescriptorCollection["PanelStyle"];
               if(propertyDescriptorPanelStyle != null)
               {
                  propertyDescriptorPanelStyle.SetValue(xpanderPanel, panelStyle);
               }
               PropertyDescriptor propertyDescriptorLeft = propertyDescriptorCollection["Left"];
               if(propertyDescriptorLeft != null)
               {
                  propertyDescriptorLeft.SetValue(xpanderPanel, this.Padding.Left);
               }
               PropertyDescriptor propertyDescriptorWidth = propertyDescriptorCollection["Width"];
               if(propertyDescriptorWidth != null)
               {
                  propertyDescriptorWidth.SetValue(
                      xpanderPanel,
                      this.ClientRectangle.Width
                            - this.Padding.Left
                            - this.Padding.Right);
               }

            }
         }
         if(this.PanelStyleChanged != null)
         {
            this.PanelStyleChanged(sender, e);
         }
      }
Пример #8
0
 /// <summary>
 /// Raises the PanelStyle changed event.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">A PanelStyleChangeEventArgs that contains the event data.</param>
 protected virtual void OnPanelStyleChanged(object sender, PanelStyleChangeEventArgs e)
 {
     PanelStyle panelStyle = e.PanelStyle;
     switch (panelStyle)
     {
         case PanelStyle.Default:
             m_panelColors = new PanelColors(this);
             break;
         case PanelStyle.Office2007:
             m_panelColors = new PanelColorsOffice2007Blue(this);
             break;
     }
     Invalidate(true);
     if (this.PanelStyleChanged != null)
     {
         this.PanelStyleChanged(sender, e);
     }
 }