2 // System.Web.UI.WebControls.WebParts.Part.cs
\r
5 // Gaurav Vaish (gaurav[DOT]vaish[AT]gmail[DOT]com)
\r
7 // (C) 2004 Gaurav Vaish (http://www.mastergaurav.org)
\r
11 // Permission is hereby granted, free of charge, to any person obtaining
\r
12 // a copy of this software and associated documentation files (the
\r
13 // "Software"), to deal in the Software without restriction, including
\r
14 // without limitation the rights to use, copy, modify, merge, publish,
\r
15 // distribute, sublicense, and/or sell copies of the Software, and to
\r
16 // permit persons to whom the Software is furnished to do so, subject to
\r
17 // the following conditions:
\r
19 // The above copyright notice and this permission notice shall be
\r
20 // included in all copies or substantial portions of the Software.
\r
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
\r
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
\r
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
\r
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
34 using System.ComponentModel;
\r
36 using System.Web.UI.WebControls;
\r
38 namespace System.Web.UI.WebControls.WebParts
\r
40 public abstract class Part : Panel, INamingContainer,
\r
41 ICompositeControlDesignerAccessor
\r
46 public virtual PartChromeState ChromeState
\r
49 object o = ViewState["ChromeState"];
\r
51 return (PartChromeState)o;
\r
52 return PartChromeState.Normal;
\r
55 if(!Enum.IsDefined(typeof(PartChromeState), value))
\r
56 throw new ArgumentException("value");
\r
57 ViewState["ChromeState"] = value;
\r
61 public virtual PartChromeType ChromeType
\r
64 object o = ViewState["ChromeType"];
\r
66 return (PartChromeType)o;
\r
67 return PartChromeType.Default;
\r
70 if(!Enum.IsDefined(typeof(PartChromeType), value))
\r
71 throw new ArgumentException("value");
\r
72 ViewState["ChromeType"] = value;
\r
76 public override ControlCollection Controls
\r
79 EnsureChildControls();
\r
85 public virtual string Description
\r
88 object o = ViewState["Description"];
\r
91 return String.Empty;
\r
94 ViewState["Description"] = value;
\r
99 public virtual string Title
\r
102 object o = ViewState["Title"];
\r
105 return String.Empty;
\r
108 ViewState["Title"] = value;
\r
112 public override void DataBind()
\r
114 OnDataBinding(EventArgs.Empty);
\r
115 EnsureChildControls();
\r
116 DataBindChildren();
\r
119 void ICompositeControlDesignerAccessor.RecreateChildControls()
\r
121 ChildControlsCreated = false;
\r
122 EnsureChildControls();
\r