⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 toolbarbuttonstyle.cs

📁 Freetextbox是优秀的在线编辑器
💻 CS
字号:
namespace FreeTextBoxControls
{
    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Drawing;
    using System.Web.UI;

    public class ToolbarButtonStyle : IStateManager
    {
        public ToolbarButtonStyle()
        {
            this.ViewState["UseBackgroundImage"] = true;
            this.ViewState["BackColor"] = Color.Transparent;
            this.ViewState["BorderColorLight"] = Color.Transparent;
            this.ViewState["BorderColorDark"] = Color.Transparent;
            this.ViewState["OverBackColor"] = Color.Transparent;
            this.ViewState["OverBorderColorLight"] = ColorTranslator.FromHtml("#000080");
            this.ViewState["OverBorderColorDark"] = ColorTranslator.FromHtml("#000080");
            this.ViewState["DownBackColor"] = Color.Transparent;
            this.ViewState["DownBorderColorLight"] = ColorTranslator.FromHtml("#000080");
            this.ViewState["DownBorderColorDark"] = ColorTranslator.FromHtml("#000080");
        }

        public ToolbarButtonStyle(Color backColor, Color borderColorLight, Color borderColorDark, Color overBackColor, Color overBorderColorLight, Color overBorderColorDark, Color downBackColor, Color downBorderColorLight, Color downBorderColorDark)
        {
            this.ViewState["BackColor"] = backColor;
            this.ViewState["BorderColorLight"] = borderColorLight;
            this.ViewState["BorderColorDark"] = borderColorDark;
            this.ViewState["OverBackColor"] = overBackColor;
            this.ViewState["OverBorderColorLight"] = overBorderColorLight;
            this.ViewState["OverBorderColorDark"] = overBorderColorDark;
            this.ViewState["DownBackColor"] = downBackColor;
            this.ViewState["DownBorderColorLight"] = downBorderColorLight;
            this.ViewState["DownBorderColorDark"] = downBorderColorDark;
        }

        internal void SetDirty()
        {
            if (this.viewState != null)
            {
                ICollection collection1 = this.viewState.Keys;
                foreach (string text1 in collection1)
                {
                    this.viewState.SetItemDirty(text1, true);
                }
            }
        }

        void IStateManager.LoadViewState(object savedState)
        {
            if (savedState != null)
            {
                ((IStateManager) this.viewState).LoadViewState(savedState);
            }
        }

        object IStateManager.SaveViewState()
        {
            if (this.viewState != null)
            {
                return ((IStateManager) this.viewState).SaveViewState();
            }
            return null;
        }

        void IStateManager.TrackViewState()
        {
            this.isTrackingViewState = true;
            if (this.viewState != null)
            {
                ((IStateManager) this.viewState).TrackViewState();
            }
        }


        [NotifyParentProperty(true)]
        public Color BackColor
        {
            get
            {
                object obj1 = this.ViewState["BackColor"];
                return ((obj1 == null) ? Color.Transparent : ((Color) obj1));
            }
            set
            {
                this.ViewState["BackColor"] = value;
            }
        }

        [NotifyParentProperty(true)]
        public Color BackColorGradient
        {
            get
            {
                object obj1 = this.ViewState["BackColorGradient"];
                return ((obj1 == null) ? Color.Transparent : ((Color) obj1));
            }
            set
            {
                this.ViewState["BackColorGradient"] = value;
            }
        }

        [NotifyParentProperty(true)]
        public Color BorderColorDark
        {
            get
            {
                object obj1 = this.ViewState["BorderColorDark"];
                return ((obj1 == null) ? Color.Transparent : ((Color) obj1));
            }
            set
            {
                this.ViewState["BorderColorDark"] = value;
            }
        }

        [NotifyParentProperty(true)]
        public Color BorderColorLight
        {
            get
            {
                object obj1 = this.ViewState["BorderColorLight"];
                return ((obj1 == null) ? Color.Transparent : ((Color) obj1));
            }
            set
            {
                this.ViewState["BorderColorLight"] = value;
            }
        }

        [NotifyParentProperty(true)]
        public Color DownBackColor
        {
            get
            {
                object obj1 = this.ViewState["DownBackColor"];
                return ((obj1 == null) ? Color.Transparent : ((Color) obj1));
            }
            set
            {
                this.ViewState["DownBackColor"] = value;
            }
        }

        [NotifyParentProperty(true)]
        public Color DownBackColorGradient
        {
            get
            {
                object obj1 = this.ViewState["DownBackColorGradient"];
                return ((obj1 == null) ? Color.Transparent : ((Color) obj1));
            }
            set
            {
                this.ViewState["DownBackColorGradient"] = value;
            }
        }

        [NotifyParentProperty(true)]
        public Color DownBorderColorDark
        {
            get
            {
                object obj1 = this.ViewState["DownBorderColorDark"];
                return ((obj1 == null) ? Color.Transparent : ((Color) obj1));
            }
            set
            {
                this.ViewState["DownBorderColorDark"] = value;
            }
        }

        [NotifyParentProperty(true)]
        public Color DownBorderColorLight
        {
            get
            {
                object obj1 = this.ViewState["DownBorderColorLight"];
                return ((obj1 == null) ? Color.Transparent : ((Color) obj1));
            }
            set
            {
                this.ViewState["DownBorderColorLight"] = value;
            }
        }

        [NotifyParentProperty(true)]
        public Color OverBackColor
        {
            get
            {
                object obj1 = this.ViewState["OverBackColor"];
                return ((obj1 == null) ? Color.Transparent : ((Color) obj1));
            }
            set
            {
                this.ViewState["OverBackColor"] = value;
            }
        }

        [NotifyParentProperty(true)]
        public Color OverBackColorGradient
        {
            get
            {
                object obj1 = this.ViewState["OverBackColorGradient"];
                return ((obj1 == null) ? Color.Transparent : ((Color) obj1));
            }
            set
            {
                this.ViewState["OverBackColorGradient"] = value;
            }
        }

        [NotifyParentProperty(true)]
        public Color OverBorderColorDark
        {
            get
            {
                object obj1 = this.ViewState["OverBorderColorDark"];
                return ((obj1 == null) ? Color.Transparent : ((Color) obj1));
            }
            set
            {
                this.ViewState["OverBorderColorDark"] = value;
            }
        }

        [NotifyParentProperty(true)]
        public Color OverBorderColorLight
        {
            get
            {
                object obj1 = this.ViewState["OverBorderColorLight"];
                return ((obj1 == null) ? Color.Transparent : ((Color) obj1));
            }
            set
            {
                this.ViewState["OverBorderColorLight"] = value;
            }
        }

        bool IStateManager.IsTrackingViewState
        {
            get
            {
                return this.isTrackingViewState;
            }
        }

        [NotifyParentProperty(true)]
        public bool UseBackgroundImage
        {
            get
            {
                object obj1 = this.ViewState["UseBackgroundImage"];
                return ((obj1 != null) && ((bool) obj1));
            }
            set
            {
                this.ViewState["UseBackgroundImage"] = value;
            }
        }

        [NotifyParentProperty(true)]
        public bool UseDownBackgroundImage
        {
            get
            {
                object obj1 = this.ViewState["UseDownBackgroundImage"];
                return ((obj1 != null) && ((bool) obj1));
            }
            set
            {
                this.ViewState["UseDownBackgroundImage"] = value;
            }
        }

        [NotifyParentProperty(true)]
        public bool UseOverBackgroundImage
        {
            get
            {
                object obj1 = this.ViewState["UseOverBackgroundImage"];
                return ((obj1 != null) && ((bool) obj1));
            }
            set
            {
                this.ViewState["UseOverBackgroundImage"] = value;
            }
        }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Browsable(false)]
        protected StateBag ViewState
        {
            get
            {
                if (this.viewState == null)
                {
                    this.viewState = new StateBag(false);
                    if (this.isTrackingViewState)
                    {
                        ((IStateManager) this.viewState).TrackViewState();
                    }
                }
                return this.viewState;
            }
        }


        private bool isTrackingViewState;
        private StateBag viewState;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -