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

📄 toolbarlistitem.cs

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

    [TypeConverter(typeof(ExpandableObjectConverter))]
    public class ToolbarListItem : IStateManager, IParserAccessor
    {
        public ToolbarListItem() : this("")
        {
        }

        public ToolbarListItem(string text)
        {
            this.Text = text;
            this.Value = text;
        }

        public ToolbarListItem(string text, Color color)
        {
            this.Text = text;
            this.Value = text;
            this.BackColor = color;
        }

        public ToolbarListItem(string text, string value)
        {
            this.Text = text;
            this.Value = value;
        }

        public ToolbarListItem(string text, string value, Color color)
        {
            this.Text = text;
            this.Value = value;
            this.BackColor = color;
        }

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

        void IParserAccessor.AddParsedSubObject(object obj)
        {
            if (obj is LiteralControl)
            {
                this.Text = ((LiteralControl) obj).Text;
            }
        }

        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), Category("Behavior"), Description("The background color of the dropdownlistitem")]
        public Color BackColor
        {
            get
            {
                object obj1 = this.ViewState["BackColor"];
                return ((obj1 == null) ? Color.Transparent : ((Color) obj1));
            }
            set
            {
                this.ViewState["BackColor"] = value;
            }
        }

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

        [Category("Behavior"), NotifyParentProperty(true), DefaultValue(""), PersistenceMode(PersistenceMode.EncodedInnerDefaultProperty), Description("The display text for the item")]
        public string Text
        {
            get
            {
                object obj1 = this.ViewState["Text"];
                return ((obj1 == null) ? "" : ((string) obj1));
            }
            set
            {
                this.ViewState["Text"] = value;
            }
        }

        [Category("Behavior"), NotifyParentProperty(true), Description("The value used in the JavaScript function")]
        public string Value
        {
            get
            {
                object obj1 = this.ViewState["Value"];
                return ((obj1 == null) ? "" : ((string) obj1));
            }
            set
            {
                this.ViewState["Value"] = 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 + -