示例#1
0
        public virtual void LoadViewState(object state)
        {
            object[] states = state as object[];

            if (states != null)
            {
                foreach (Pair pair in states)
                {
                    switch ((string)pair.First)
                    {
                    case "base":
                        ((IStateManager)this.ViewState).LoadViewState(pair.Second);
                        break;

                    case "vsMembers":
                        ViewStateProcessor.LoadViewState(this, pair.Second);
                        break;
                    }
                }
            }
            else
            {
                ((IStateManager)this.ViewState).LoadViewState(state);
            }
        }
示例#2
0
        protected override void LoadViewState(object state)
        {
            object[] states = state as object[];

            if (states != null)
            {
                foreach (Pair pair in states)
                {
                    switch ((string)pair.First)
                    {
                    case "base":
                        base.LoadViewState(pair.Second);
                        break;

                    case "vsMembers":
                        ViewStateProcessor.LoadViewState(this, pair.Second);
                        break;
                    }
                }
            }
            else
            {
                base.LoadViewState(state);
            }
        }
示例#3
0
        public virtual object SaveViewState()
        {
            List <Pair> state     = new List <Pair>();
            object      baseState = ((IStateManager)this.ViewState).SaveViewState();

            if (baseState != null)
            {
                state.Add(new Pair("base", baseState));
            }

            object vsMembers = ViewStateProcessor.SaveViewState(this);

            if (vsMembers != null)
            {
                state.Add(new Pair("vsMembers", vsMembers));
            }

            return(state.Count == 0 ? null : state.ToArray());
        }
示例#4
0
        protected override object SaveViewState()
        {
            List <Pair> state     = new List <Pair>();
            object      baseState = base.SaveViewState();

            if (baseState != null)
            {
                state.Add(new Pair("base", baseState));
            }

            object vsMembers = ViewStateProcessor.SaveViewState(this);

            if (vsMembers != null)
            {
                state.Add(new Pair("vsMembers", vsMembers));
            }

            return(state.Count == 0 ? null : state.ToArray());
        }