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); } }
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); } }
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()); }
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()); }