예제 #1
0
        protected override void LoadViewState(object savedState)
        {
            if (savedState == null)
            {
                base.LoadViewState(null);
                return;
            }

            Triplet saved = (Triplet)savedState;

            base.LoadViewState(saved.First);

            if (saved.Second != null)
            {
                if (inputAttributesState == null)
                {
                    inputAttributesState = new StateBag(true);
                    inputAttributesState.TrackViewState();
                }
                inputAttributesState.LoadViewState(saved.Second);
            }

            if (saved.Third != null)
            {
                if (labelAttributesState == null)
                {
                    labelAttributesState = new StateBag(true);
                    labelAttributesState.TrackViewState();
                }
                labelAttributesState.LoadViewState(saved.Third);
            }
        }
예제 #2
0
        /// <internalonly/>
        /// <devdoc>
        ///    <para>Loads previously saved state.
        ///       Overridden to handle ViewState, Style, and Attributes.</para>
        /// </devdoc>
        protected override void LoadViewState(object savedState)
        {
            if (savedState != null)
            {
                Pair myState = (Pair)savedState;
                base.LoadViewState(myState.First);

                if (ControlStyleCreated || (ViewState[System.Web.UI.WebControls.Style.SetBitsKey] != null))
                {
                    // the style shares the StateBag of its owner WebControl
                    // call LoadViewState to let style participate in state management
                    ControlStyle.LoadViewState(null);
                }
                else
                {
                    _webControlFlags.Set(deferStyleLoadViewState);
                }

                if (myState.Second != null)
                {
                    if (attrState == null)
                    {
                        attrState = new StateBag(true);
                        attrState.TrackViewState();
                    }
                    attrState.LoadViewState(myState.Second);
                }
            }

            // Load values cached out of view state
            object enabled = ViewState["Enabled"];

            if (enabled != null)
            {
                if (!(bool)enabled)
                {
                    flags.Set(isWebControlDisabled);
                }
                else
                {
                    flags.Clear(isWebControlDisabled);
                }
                _webControlFlags.Set(disabledDirty);
            }

            if (((IDictionary)ViewState).Contains("AccessKey"))
            {
                _webControlFlags.Set(accessKeySet);
            }

            if (((IDictionary)ViewState).Contains("TabIndex"))
            {
                _webControlFlags.Set(tabIndexSet);
            }

            if (((IDictionary)ViewState).Contains("ToolTip"))
            {
                _webControlFlags.Set(toolTipSet);
            }
        }
예제 #3
0
 /// <devdoc>
 ///     Loads the view state for the control.
 /// </devdoc>
 protected override void LoadViewState(object savedState)
 {
     if (savedState != null)
     {
         Triplet stateTriplet = (Triplet)savedState;
         base.LoadViewState(stateTriplet.First);
         if (stateTriplet.Second != null)
         {
             if (_inputAttributesState == null)
             {
                 _inputAttributesState = new StateBag();
                 _inputAttributesState.TrackViewState();
             }
             _inputAttributesState.LoadViewState(stateTriplet.Second);
         }
         if (stateTriplet.Third != null)
         {
             if (_labelAttributesState == null)
             {
                 _labelAttributesState = new StateBag();
                 _labelAttributesState.TrackViewState();
             }
             _labelAttributesState.LoadViewState(BinaryCompatibility.Current.TargetsAtLeastFramework48 ? stateTriplet.Third : stateTriplet.Second);
         }
     }
 }
 /// <devdoc>
 ///     Loads the view state for the control.
 /// </devdoc>
 protected override void LoadViewState(object savedState)
 {
     if (savedState != null)
     {
         Triplet stateTriplet = (Triplet)savedState;
         base.LoadViewState(stateTriplet.First);
         if (stateTriplet.Second != null)
         {
             if (_inputAttributesState == null)
             {
                 _inputAttributesState = new StateBag();
                 _inputAttributesState.TrackViewState();
             }
             _inputAttributesState.LoadViewState(stateTriplet.Second);
         }
         if (stateTriplet.Third != null)
         {
             if (_labelAttributesState == null)
             {
                 _labelAttributesState = new StateBag();
                 _labelAttributesState.TrackViewState();
             }
             _labelAttributesState.LoadViewState(stateTriplet.Second);
         }
     }
 }
예제 #5
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);
        }
예제 #6
0
        /// <devdoc>
        /// Tells the MethodParameter to start tracking property changes.
        /// </devdoc>
        private void TrackViewState()
        {
            _tracking = true;

            if (_viewState != null)
            {
                _viewState.TrackViewState();
            }
        }
        /// <devdoc>
        /// Tells the Parameter to start tracking property changes.
        /// </devdoc>
        protected virtual void TrackViewState()
        {
            _tracking = true;

            if (_viewState != null)
            {
                _viewState.TrackViewState();
            }
        }
예제 #8
0
        public void IStateManager_Deny_Unrestricted()
        {
            IStateManager sm = new StateBag();

            Assert.IsFalse(sm.IsTrackingViewState, "IsTrackingViewState");
            object state = sm.SaveViewState();

            sm.LoadViewState(state);
            sm.TrackViewState();
        }
예제 #9
0
 protected override void TrackViewState()
 {
     base.TrackViewState();
     if (inputAttributesState != null)
     {
         inputAttributesState.TrackViewState();
     }
     if (labelAttributesState != null)
     {
         labelAttributesState.TrackViewState();
     }
 }
예제 #10
0
        protected void TrackViewState()
        {
            if (marked)
            {
                return;
            }
            marked = true;
            ViewState.TrackViewState();

            if (nodes != null)
            {
                ((IStateManager)nodes).TrackViewState();
            }
        }
예제 #11
0
        void IStateManager.TrackViewState()
        {
            if (marked)
            {
                return;
            }
            marked = true;
            ViewState.TrackViewState();

            if (items != null)
            {
                ((IStateManager)items).TrackViewState();
            }
        }
예제 #12
0
        protected override void TrackViewState()
        {
            if (style != null)
            {
                style.TrackViewState();
            }

            if (attribute_state != null)
            {
                attribute_state.TrackViewState();
                attribute_state.SetDirty(true);
            }

            base.TrackViewState();
        }
예제 #13
0
        /// <internalonly/>
        /// <devdoc>
        ///    <para>Marks the beginning for tracking state changes on the control.
        ///       Any changes made after "mark" will be tracked and
        ///       saved as part of the control viewstate.</para>
        /// </devdoc>
        protected override void TrackViewState()
        {
            base.TrackViewState();

            if (ControlStyleCreated)
            {
                // the style shares the StateBag of its owner WebControl
                // call TrackState to let style participate in state management
                ControlStyle.TrackViewState();
            }

            if (attrState != null)
            {
                attrState.TrackViewState();
            }
        }
예제 #14
0
        protected virtual void TrackViewState()
        {
            tracking_viewstate = true;

            viewstate.TrackViewState();
            if (footer_style != null)
            {
                footer_style.TrackViewState();
            }
            if (header_style != null)
            {
                header_style.TrackViewState();
            }
            if (item_style != null)
            {
                item_style.TrackViewState();
            }
        }
예제 #15
0
 protected virtual void TrackViewState()
 {
     if (controlStyle != null)
     {
         ((IStateManager)controlStyle).TrackViewState();
     }
     if (footerStyle != null)
     {
         ((IStateManager)footerStyle).TrackViewState();
     }
     if (headerStyle != null)
     {
         ((IStateManager)headerStyle).TrackViewState();
     }
     if (itemStyle != null)
     {
         ((IStateManager)itemStyle).TrackViewState();
     }
     viewState.TrackViewState();
     tracking = true;
 }
예제 #16
0
 protected virtual void TrackViewState()
 {
     viewState.TrackViewState();
 }
예제 #17
0
파일: Style.cs 프로젝트: raj581/Marvin
 protected internal virtual void TrackViewState()
 {
     tracking = true;
     viewstate.TrackViewState();
 }
예제 #18
0
 void IStateManager.TrackViewState()
 {
     ViewState.TrackViewState();
 }
예제 #19
0
파일: WebControl.cs 프로젝트: runefs/Marvin
		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);
		}
예제 #20
0
 void IStateManager.TrackViewState()
 {
     _bag.TrackViewState();
 }
예제 #21
0
파일: CheckBox.cs 프로젝트: nobled/mono
		protected override void LoadViewState (object savedState)
		{
			if (savedState == null) {
				base.LoadViewState (null);
				return;
			}

			Triplet saved = (Triplet) savedState;
			base.LoadViewState (saved.First);

			if (saved.Second != null) {
				if (inputAttributesState == null) {
					inputAttributesState = new StateBag(true);
					inputAttributesState.TrackViewState ();
				}
				inputAttributesState.LoadViewState (saved.Second);
			}

			if (saved.Third != null) {
				if (labelAttributesState == null) {
					labelAttributesState = new StateBag(true);
					labelAttributesState.TrackViewState ();
				}
				labelAttributesState.LoadViewState (saved.Third);
			}
		}