コード例 #1
0
        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;

            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);
            }
        }
コード例 #3
0
ファイル: EPanel.cs プロジェクト: Egoily/CSharp-EAlbum
 /// <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);
 }
コード例 #4
0
ファイル: EPanel.cs プロジェクト: Egoily/CSharp-EAlbum
 /// <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
ファイル: BaseEPanel.cs プロジェクト: Egoily/CSharp-EAlbum
        /// <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);
            }
        }
コード例 #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 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);
            }
        }