コード例 #1
0
 internal virtual void LoadRecursive()
 {
     if (this._controlState < System.Web.UI.ControlState.Loaded)
     {
         if (this.AdapterInternal != null)
         {
             this.AdapterInternal.OnLoad(EventArgs.Empty);
         }
         else
         {
             this.OnLoad(EventArgs.Empty);
         }
     }
     if (this._controls != null)
     {
         string errorMsg = this._controls.SetCollectionReadOnly("Parent_collections_readonly");
         int count = this._controls.Count;
         for (int i = 0; i < count; i++)
         {
             this._controls[i].LoadRecursive();
         }
         this._controls.SetCollectionReadOnly(errorMsg);
     }
     if (this._controlState < System.Web.UI.ControlState.Loaded)
     {
         this._controlState = System.Web.UI.ControlState.Loaded;
     }
 }
コード例 #2
0
 internal virtual void InitRecursive(Control namingContainer)
 {
     this.ResolveAdapter();
     if (this._controls != null)
     {
         if (this.flags[0x80])
         {
             namingContainer = this;
         }
         string errorMsg = this._controls.SetCollectionReadOnly("Parent_collections_readonly");
         int count = this._controls.Count;
         for (int i = 0; i < count; i++)
         {
             Control control = this._controls[i];
             control.UpdateNamingContainer(namingContainer);
             if (((control._id == null) && (namingContainer != null)) && !control.flags[0x40])
             {
                 control.GenerateAutomaticID();
             }
             control._page = this.Page;
             control.InitRecursive(namingContainer);
         }
         this._controls.SetCollectionReadOnly(errorMsg);
     }
     if (this._controlState < System.Web.UI.ControlState.Initialized)
     {
         this._controlState = System.Web.UI.ControlState.ChildrenInitialized;
         if (((this.Page != null) && !this.DesignMode) && (this.Page.ContainsTheme && this.EnableTheming))
         {
             this.ApplySkin(this.Page);
         }
         if (this.AdapterInternal != null)
         {
             this.AdapterInternal.OnInit(EventArgs.Empty);
         }
         else
         {
             this.OnInit(EventArgs.Empty);
         }
         this._controlState = System.Web.UI.ControlState.Initialized;
     }
     this.TrackViewState();
 }
コード例 #3
0
 internal virtual void PreRenderRecursiveInternal()
 {
     if (!this.Visible)
     {
         this.flags.Set(0x10);
     }
     else
     {
         this.flags.Clear(0x10);
         this.EnsureChildControls();
         if (this.AdapterInternal != null)
         {
             this.AdapterInternal.OnPreRender(EventArgs.Empty);
         }
         else
         {
             this.OnPreRender(EventArgs.Empty);
         }
         if (this._controls != null)
         {
             string errorMsg = this._controls.SetCollectionReadOnly("Parent_collections_readonly");
             int count = this._controls.Count;
             for (int i = 0; i < count; i++)
             {
                 this._controls[i].PreRenderRecursiveInternal();
             }
             this._controls.SetCollectionReadOnly(errorMsg);
         }
     }
     this._controlState = System.Web.UI.ControlState.PreRendered;
 }
コード例 #4
0
 internal virtual void UnloadRecursive(bool dispose)
 {
     System.Web.UI.Page page = this.Page;
     if ((page != null) && page.RequiresControlState(this))
     {
         page.UnregisterRequiresControlState(this);
         this.RareFieldsEnsured.RequiredControlState = true;
     }
     if (this.flags[0x200000])
     {
         this._id = null;
         this.flags.Clear(0x200000);
     }
     if (this._controls != null)
     {
         string errorMsg = this._controls.SetCollectionReadOnly("Parent_collections_readonly");
         int count = this._controls.Count;
         for (int i = 0; i < count; i++)
         {
             this._controls[i].UnloadRecursive(dispose);
         }
         this._controls.SetCollectionReadOnly(errorMsg);
     }
     if (this.AdapterInternal != null)
     {
         this.AdapterInternal.OnUnload(EventArgs.Empty);
     }
     else
     {
         this.OnUnload(EventArgs.Empty);
     }
     if (dispose)
     {
         this.Dispose();
     }
     if (this.IsReloadable)
     {
         this._controlState = System.Web.UI.ControlState.Constructed;
     }
 }
コード例 #5
0
 internal void LoadViewStateRecursive(object savedState)
 {
     if ((savedState != null) && !this.flags[4])
     {
         if ((this.Page != null) && this.Page.IsPostBack)
         {
             object first = null;
             object state = null;
             ArrayList childState = null;
             Pair pair = savedState as Pair;
             if (pair != null)
             {
                 first = pair.First;
                 childState = (ArrayList) pair.Second;
             }
             else
             {
                 Triplet triplet = (Triplet) savedState;
                 first = triplet.First;
                 state = triplet.Second;
                 childState = (ArrayList) triplet.Third;
             }
             try
             {
                 if ((state != null) && (this.AdapterInternal != null))
                 {
                     this.AdapterInternal.LoadAdapterViewState(state);
                 }
                 if (first != null)
                 {
                     this.LoadViewState(first);
                 }
                 if (childState != null)
                 {
                     if (this.LoadViewStateByID)
                     {
                         this.LoadChildViewStateByID(childState);
                     }
                     else
                     {
                         this.LoadChildViewStateByIndex(childState);
                     }
                 }
             }
             catch (InvalidCastException)
             {
                 throw new HttpException(System.Web.SR.GetString("Controls_Cant_Change_Between_Posts"));
             }
             catch (IndexOutOfRangeException)
             {
                 throw new HttpException(System.Web.SR.GetString("Controls_Cant_Change_Between_Posts"));
             }
         }
         this._controlState = System.Web.UI.ControlState.ViewStateLoaded;
     }
 }