Exemple #1
0
        private void XpanderPanelPanelStyleChanged(object sender, PanelStyleChangeEventArgs e)
        {
            PanelStyle panelStyle = e.PanelStyle;

            if (panelStyle != this.m_ePanelStyle)
            {
                this.PanelStyle = panelStyle;
            }
        }
Exemple #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;

            this.Padding = new 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);
            }
        }
Exemple #3
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);
 }
Exemple #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);
 }
Exemple #5
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);
            }
        }
 private void XpanderPanelPanelStyleChanged(object sender, PanelStyleChangeEventArgs e)
 {
     PanelStyle panelStyle = e.PanelStyle;
     if (panelStyle != this.m_ePanelStyle)
     {
         this.PanelStyle = panelStyle;
     }
 }
        /// <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 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);
            }
        }