Exemple #1
0
        protected override void LoadViewState(object savedState)
        {
            if (savedState == null || !(savedState is Pair))
            {
                base.LoadViewState(null);
                return;
            }

            Pair pair = (Pair)savedState;

            base.LoadViewState(pair.First);
            if (ViewState [System.Web.UI.WebControls.Style.BitStateKey] != null)
            {
                ControlStyle.LoadBitState();
            }

            if (pair.Second != null)
            {
                if (attribute_state == null)
                {
                    attribute_state = new StateBag();
                    if (IsTrackingViewState)
                    {
                        attribute_state.TrackViewState();
                    }
                }

                attribute_state.LoadViewState(pair.Second);
                attributes = new AttributeCollection(attribute_state);
            }

            enabled = ViewState.GetBool("Enabled", enabled);
        }