Exemplo n.º 1
0
        protected override object SaveViewState()
        {
            if (track_enabled_state)
            {
                ViewState ["Enabled"] = enabled;
            }

            object view_state;
            object attr_view_state = null;

            if (style != null)
            {
                style.SaveBitState();
            }
            view_state = base.SaveViewState();

            if (attribute_state != null)
            {
                attr_view_state = attribute_state.SaveViewState();
            }

            if (view_state == null && attr_view_state == null)
            {
                return(null);
            }

            return(new Pair(view_state, attr_view_state));
        }
Exemplo n.º 2
0
        /// <internalonly/>
        /// <devdoc>
        ///    <para>A protected method. Saves any
        ///       state that was modified after the TrackViewState method was invoked.</para>
        /// </devdoc>
        protected override object SaveViewState()
        {
            Pair myState = null;

            // Save values cached out of view state
            if (_webControlFlags[disabledDirty])
            {
                ViewState["Enabled"] = !flags[isWebControlDisabled];
            }

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

            object baseState = base.SaveViewState();
            object aState    = null;

            if (attrState != null)
            {
                aState = attrState.SaveViewState();
            }

            if (baseState != null || aState != null)
            {
                myState = new Pair(baseState, aState);
            }
            return(myState);
        }
Exemplo n.º 3
0
        protected virtual object SaveViewState()
        {
            object[] state = new object [5];
            state [0] = viewState.SaveViewState();
            if (controlStyle != null)
            {
                state [1] = ((IStateManager)controlStyle).SaveViewState();
            }
            if (footerStyle != null)
            {
                state [2] = ((IStateManager)footerStyle).SaveViewState();
            }
            if (headerStyle != null)
            {
                state [3] = ((IStateManager)headerStyle).SaveViewState();
            }
            if (itemStyle != null)
            {
                state [4] = ((IStateManager)itemStyle).SaveViewState();
            }

            if (state [0] == null && state [1] == null && state [2] == null &&
                state [3] == null && state [4] == null)
            {
                return(null);
            }

            return(state);
        }
Exemplo n.º 4
0
 /// <devdoc>
 /// <para>Saves any server control view-state changes that have
 /// occurred since the time the page was posted back to the server.</para>
 /// </devdoc>
 protected virtual object SaveViewState()
 {
     if (_viewState != null)
     {
         return(_viewState.SaveViewState());
     }
     return(null);
 }
Exemplo n.º 5
0
        public void IStateManager_Deny_Unrestricted()
        {
            IStateManager sm = new StateBag();

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

            sm.LoadViewState(state);
            sm.TrackViewState();
        }
Exemplo n.º 6
0
        protected internal virtual object SaveViewState()
        {
            SaveBitState();

            if (_isSharedViewState)
            {
                return(null);
            }

            return(viewstate.SaveViewState());
        }
Exemplo n.º 7
0
        protected virtual object SaveViewState()
        {
            object[] states = new object[2];
            states[0] = ViewState.SaveViewState();
            states[1] = (nodes == null ? null : ((IStateManager)nodes).SaveViewState());

            for (int i = 0; i < states.Length; i++)
            {
                if (states [i] != null)
                {
                    return(states);
                }
            }
            return(null);
        }
Exemplo n.º 8
0
        object IStateManager.SaveViewState()
        {
            object[] states = new object[2];
            states[0] = ViewState.SaveViewState();
            states[1] = (items == null ? null : ((IStateManager)items).SaveViewState());

            for (int i = 0; i < states.Length; i++)
            {
                if (states [i] != null)
                {
                    return(states);
                }
            }
            return(null);
        }
        /// <devdoc>
        ///     Saves the view state for the control.
        /// </devdoc>
        protected override object SaveViewState()
        {
            object baseState  = base.SaveViewState();
            object inputState = null;
            object labelState = null;
            object myState    = null;

            if (_inputAttributesState != null)
            {
                inputState = _inputAttributesState.SaveViewState();
            }
            if (_labelAttributesState != null)
            {
                labelState = _labelAttributesState.SaveViewState();
            }
            if (baseState != null || inputState != null || labelState != null)
            {
                myState = new Triplet(baseState, inputState, labelState);
            }
            return(myState);
        }
Exemplo n.º 10
0
        protected virtual object SaveViewState()
        {
            object[] res = new object[4];

            res[0] = viewstate.SaveViewState();

            if (footer_style != null)
            {
                res[1] = footer_style.SaveViewState();
            }
            if (header_style != null)
            {
                res[2] = header_style.SaveViewState();
            }
            if (item_style != null)
            {
                res[3] = item_style.SaveViewState();
            }

            return(res);
        }
Exemplo n.º 11
0
        protected override object SaveViewState()
        {
            object baseView      = base.SaveViewState();
            object inputAttrView = null;
            object labelAttrView = null;

            if (inputAttributesState != null)
            {
                inputAttrView = inputAttributesState.SaveViewState();
            }

            if (labelAttributesState != null)
            {
                labelAttrView = labelAttributesState.SaveViewState();
            }

            if (baseView == null && inputAttrView == null && labelAttrView == null)
            {
                return(null);
            }

            return(new Triplet(baseView, inputAttrView, labelAttrView));
        }
Exemplo n.º 12
0
 protected virtual object SaveViewState()
 {
     return(viewState.SaveViewState());
 }
Exemplo n.º 13
0
 object IStateManager.SaveViewState()
 {
     return(ViewState.SaveViewState());
 }
Exemplo n.º 14
0
 /// <devdoc>
 /// Saves view state.
 /// </devdoc>
 private object SaveViewState()
 {
     return((_viewState != null) ? _viewState.SaveViewState() : null);
 }
Exemplo n.º 15
0
 /// <devdoc>
 /// Saves view state.
 /// </devdoc>
 protected virtual object SaveViewState()
 {
     return((_viewState != null) ? _viewState.SaveViewState() : null);
 }