[ToolboxItem(), DesignerSerializer(, ), ToolboxItemFilter(, ToolboxItemFilterType.Require), DefaultProperty(), DesignerCategory(), Designer(), PermissionSet(SecurityAction.LinkDemand, XML=), PermissionSet(SecurityAction.InheritanceDemand, XML=)]
Control : IComponent, IDisposable, IParserAccessor, IDataBindingsAccessor
{
string _cachedUniqueID;
ControlCollection _controls;
ControlState _controlState;
IDictionary _controlsViewState;
DataBindingCollection _dataBindings;
EventHandlerList _events;
string _id;
IDictionary _namedControls;
int _namedControlsID;
Control _namingContainer;
Page _page;
Control _parent;
RenderMethod _renderMethod;
ISite _site;
StateBag _viewState;
int automaticIDCount = ;
string automaticIDPrefix = ;
string[] automaticIDs = string[] {
, , , , , , , , , , , , , , , ,
, , , , , , , , , , , , , , , ,
, , , , , , , , , , , , , , , ,
, , , , , , , , , , , , , , , ,
, , , , , , , , , , , , , , , ,
, , , , , , , , , , , , , , , ,
, , , , , , , , , , , , , , , ,
, , , , , , , , , , , , , , ,
};
int controlsCreated = ;
int creatingControls = ;
int disableViewState = ;
object EventDataBinding = object();
object EventDisposed = object();
object EventInit = object();
object EventLoad = object();
object EventPreRender = object();
object EventUnload = object();
SimpleBitVector32 flags;
char ID_RENDER_SEPARATOR = ;
char ID_SEPARATOR = ;
int idNotCalculated = ;
int idNotRequired = ;
int invisible = ;
int isNamingContainer = ;
int marked = ;
int nonBindingContainer = ;
int visibleDirty = ;
[WebSysDescription(), WebCategory()]
EventHandler DataBinding
{
{
.Events.AddHandler(EventDataBinding, value);
}
{
.Events.RemoveHandler(EventDataBinding, value);
}
}
[WebSysDescription()]
EventHandler Disposed
{
{
.Events.AddHandler(EventDisposed, value);
}
{
.Events.RemoveHandler(EventDisposed, value);
}
}
[WebSysDescription()]
EventHandler Init
{
{
.Events.AddHandler(EventInit, value);
}
{
.Events.RemoveHandler(EventInit, value);
}
}
[WebSysDescription()]
EventHandler Load
{
{
.Events.AddHandler(EventLoad, value);
}
{
.Events.RemoveHandler(EventLoad, value);
}
}
[WebSysDescription()]
EventHandler PreRender
{
{
.Events.AddHandler(EventPreRender, value);
}
{
.Events.RemoveHandler(EventPreRender, value);
}
}
[WebSysDescription()]
EventHandler Unload
{
{
.Events.AddHandler(EventUnload, value);
}
{
.Events.RemoveHandler(EventUnload, value);
}
}
Control()
{
( INamingContainer)
{
.flags[] = ;
}
}
void AddedControl(Control control, int index)
{
(control._parent != )
{
control._parent.Controls.Remove(control);
}
control._parent = ;
control._page = ._page;
Control namingContainer = .flags[] ? : ._namingContainer;
(namingContainer != )
{
control._namingContainer = namingContainer;
((control._id == ) && !control.flags[])
{
control.GenerateAutomaticID();
}
((control._id != ) || (control._controls != ))
{
namingContainer.DirtyNameTable();
}
}
(._controlState >= ControlState.ChildrenInitialized)
{
control.InitRecursive(namingContainer);
(._controlState >= ControlState.ViewStateLoaded)
{
object savedState = ;
(._controlsViewState != )
{
savedState = ._controlsViewState[index];
._controlsViewState.Remove(index);
}
control.LoadViewStateRecursive(savedState);
(._controlState >= ControlState.Loaded)
{
control.LoadRecursive();
(._controlState >= ControlState.PreRendered)
{
control.PreRenderRecursiveInternal();
}
}
}
}
}
void AddParsedSubObject(object obj)
{
Control child = obj Control;
(child != )
{
.Controls.Add(child);
}
}
void BuildProfileTree(string parentId, bool calcViewState)
{
int num;
calcViewState = calcViewState && !.flags[];
(calcViewState)
{
num = LosFormatter.EstimateSize(.SaveViewState());
}
{
num = ;
}
.Page.Trace.AddNewControl(.UniqueID, parentId, .GetType().FullName, num);
(._controls != )
{
int count = ._controls.Count;
(int i = ; i < count; i++)
{
._controls[i].BuildProfileTree(.UniqueID, calcViewState);
}
}
}
void ClearCachedUniqueIDRecursive()
{
._cachedUniqueID = ;
(._controls != )
{
int count = ._controls.Count;
(int i = ; i < count; i++)
{
._controls[i].ClearCachedUniqueIDRecursive();
}
}
}
void ClearChildViewState()
{
._controlsViewState = ;
}
void ClearNamingContainer()
{
._namedControlsID = ;
.DirtyNameTable();
}
void CreateChildControls()
{
}
ControlCollection CreateControlCollection()
{
ControlCollection();
}
void DataBind()
{
.OnDataBinding(EventArgs.Empty);
(._controls != )
{
string errorMsg = ._controls.SetCollectionReadOnly();
int count = ._controls.Count;
(int i = ; i < count; i++)
{
._controls[i].DataBind();
}
._controls.SetCollectionReadOnly(errorMsg);
}
}
void DirtyNameTable()
{
._namedControls = ;
}
void Dispose()
{
IContainer service = ;
(._site != )
{
service = (IContainer) ._site.GetService((IContainer));
(service != )
{
service.Remove();
EventHandler handler = .Events[EventDisposed] EventHandler;
(handler != )
{
handler(, EventArgs.Empty);
}
}
}
}
void EnsureChildControls()
{
(!.ChildControlsCreated && !.flags[])
{
.flags[] = ;
{
.CreateChildControls();
}
{
.flags[] = ;
.ChildControlsCreated = ;
}
}
}
void EnsureNamedControlsTable()
{
._namedControls = HybridDictionary(._namedControlsID, );
.FillNamedControlsTable(, ._controls);
}
void FillNamedControlsTable(Control namingContainer, ControlCollection controls)
{
int count = controls.Count;
(int i = ; i < count; i++)
{
Control control = controls[i];
(control._id != )
{
{
namingContainer._namedControls.Add(control._id, control);
}
(Exception)
{
HttpException(HttpRuntime.FormatResourceString(, control._id, ));
}
}
(control.HasControls() && !control.flags[])
{
.FillNamedControlsTable(namingContainer, control.Controls);
}
}
}
Control FindControl(string id)
{
.FindControl(id, );
}
Control FindControl(string id, int pathOffset)
{
string str;
.EnsureChildControls();
(!.flags[])
{
Control namingContainer = .NamingContainer;
(namingContainer != )
{
namingContainer.FindControl(id, pathOffset);
}
;
}
((._namedControls == ) && .HasControls())
{
.EnsureNamedControlsTable();
}
(._namedControls == )
{
;
}
int index = id.IndexOf(, pathOffset);
(index == )
{
str = id.Substring(pathOffset);
(._namedControls[str] Control);
}
str = id.Substring(pathOffset, index - pathOffset);
Control control2 = ._namedControls[str] Control;
(control2 == )
{
;
}
control2.FindControl(id, index + );
}
void GenerateAutomaticID()
{
int index = ._namingContainer._namedControlsID++;
(index < )
{
._id = automaticIDs[index];
}
{
._id = + index.ToString(NumberFormatInfo.InvariantInfo);
}
._namingContainer.DirtyNameTable();
}
string GetUniqueIDPrefix()
{
string uniqueID = .UniqueID;
((uniqueID != ) && (uniqueID.Length > ))
{
char ch = ;
(uniqueID + ch.ToString());
}
;
}
bool HasControls()
{
((._controls != ) && (._controls.Count > ));
}
bool HasRenderingData()
{
(!.HasControls())
{
(._renderMethod != );
}
;
}
void InitRecursive(Control namingContainer)
{
(._controls != )
{
(.flags[])
{
namingContainer = ;
}
string errorMsg = ._controls.SetCollectionReadOnly();
int count = ._controls.Count;
(int i = ; i < count; i++)
{
Control control = ._controls[i];
control._namingContainer = namingContainer;
(((namingContainer != ) && (control._id == )) && !control.flags[])
{
control.GenerateAutomaticID();
}
control._page = ._page;
control.InitRecursive(namingContainer);
}
._controls.SetCollectionReadOnly(errorMsg);
}
(._controlState < ControlState.Initialized)
{
._controlState = ControlState.ChildrenInitialized;
.OnInit(EventArgs.Empty);
._controlState = ControlState.Initialized;
}
.TrackViewState();
}
bool IsDescendentOf(Control ancestor)
{
( == ancestor)
{
;
}
(._parent == )
{
;
}
._parent.IsDescendentOf(ancestor);
}
bool IsLiteralContent()
{
(((._controls != ) && (._controls.Count == )) && (._controls[] LiteralControl));
}
void LoadRecursive()
{
(._controlState < ControlState.Loaded)
{
.OnLoad(EventArgs.Empty);
}
(._controls != )
{
string errorMsg = ._controls.SetCollectionReadOnly();
int count = ._controls.Count;
(int i = ; i < count; i++)
{
._controls[i].LoadRecursive();
}
._controls.SetCollectionReadOnly(errorMsg);
}
(._controlState < ControlState.Loaded)
{
._controlState = ControlState.Loaded;
}
}
void LoadViewState(object savedState)
{
(savedState != )
{
.ViewState.LoadViewState(savedState);
object obj2 = .ViewState[];
(obj2 != )
{
.flags[] = !((bool) obj2);
.flags[] = ;
}
}
}
void LoadViewStateRecursive(object savedState)
{
((savedState != ) && !.flags[])
{
Triplet triplet = (Triplet) savedState;
((.Page != ) && .Page.IsPostBack)
{
{
.LoadViewState(triplet.First);
}
(InvalidCastException)
{
HttpException(HttpRuntime.FormatResourceString());
}
(IndexOutOfRangeException)
{
HttpException(HttpRuntime.FormatResourceString());
}
}
(triplet.Second != )
{
ArrayList second = (ArrayList) triplet.Second;
ArrayList third = (ArrayList) triplet.Third;
ControlCollection controls = .Controls;
int count = controls.Count;
int num2 = second.Count;
(int i = ; i < num2; i++)
{
int num4 = (int) second[i];
(num4 < count)
{
controls[num4].LoadViewStateRecursive(third[i]);
}
{
(._controlsViewState == )
{
._controlsViewState = Hashtable();
}
._controlsViewState[num4] = third[i];
}
}
}
._controlState = ControlState.ViewStateLoaded;
}
}
string MapPathSecure(string virtualPath)
{
string str = UrlPath.Combine(.TemplateSourceDirectory, virtualPath);
string path = .Context.Request.MapPath(str);
(!HttpRuntime.HasFilePermission(path))
{
HttpException(HttpRuntime.FormatResourceString(, virtualPath));
}
path;
}
bool OnBubbleEvent(object source, EventArgs args)
{
;
}
void OnDataBinding(EventArgs e)
{
(._events != )
{
EventHandler handler = ._events[EventDataBinding] EventHandler;
(handler != )
{
handler(, e);
}
}
}
void OnInit(EventArgs e)
{
(._events != )
{
EventHandler handler = ._events[EventInit] EventHandler;
(handler != )
{
handler(, e);
}
}
}
void OnLoad(EventArgs e)
{
(._events != )
{
EventHandler handler = ._events[EventLoad] EventHandler;
(handler != )
{
handler(, e);
}
}
}
void OnPreRender(EventArgs e)
{
(._events != )
{
EventHandler handler = ._events[EventPreRender] EventHandler;
(handler != )
{
handler(, e);
}
}
}
void OnUnload(EventArgs e)
{
(._events != )
{
EventHandler handler = ._events[EventUnload] EventHandler;
(handler != )
{
handler(, e);
}
}
}
void PreRenderRecursiveInternal()
{
(!.flags[])
{
.EnsureChildControls();
.OnPreRender(EventArgs.Empty);
(._controls != )
{
string errorMsg = ._controls.SetCollectionReadOnly();
int count = ._controls.Count;
(int i = ; i < count; i++)
{
._controls[i].PreRenderRecursiveInternal();
}
._controls.SetCollectionReadOnly(errorMsg);
}
}
._controlState = ControlState.PreRendered;
}
void PreventAutoID()
{
(!.flags[])
{
.flags[] = ;
}
}
void RaiseBubbleEvent(object source, EventArgs args)
{
(Control control = ._parent; control != ; control = control.Parent)
{
(control.OnBubbleEvent(source, args))
{
;
}
}
}
void RemovedControl(Control control)
{
((._namingContainer != ) && (control._id != ))
{
._namingContainer.DirtyNameTable();
}
control.UnloadRecursive();
control._parent = ;
control._page = ;
control._namingContainer = ;
control.ClearCachedUniqueIDRecursive();
}
void Render(HtmlTextWriter writer)
{
.RenderChildren(writer);
}
void RenderChildren(HtmlTextWriter writer)
{
(._renderMethod != )
{
._renderMethod(writer, );
}
(._controls != )
{
int count = ._controls.Count;
(int i = ; i < count; i++)
{
._controls[i].RenderControl(writer);
}
}
}
void RenderControl(HtmlTextWriter writer)
{
(!.flags[])
{
HttpContext context = (._page == ) ? : ._page._context;
((context != ) && context.TraceIsEnabled)
{
int bufferedLength = context.Response.GetBufferedLength();
.Render(writer);
int num2 = context.Response.GetBufferedLength();
context.Trace.AddControlSize(.UniqueID, num2 - bufferedLength);
}
{
.Render(writer);
}
}
}
string ResolveClientUrl(string relativeUrl)
{
(relativeUrl == )
{
ArgumentNullException();
}
string templateSourceDirectory = .TemplateSourceDirectory;
(templateSourceDirectory.Length == )
{
relativeUrl;
}
string baseDir = .Context.Request.BaseDir;
(!UrlPath.IsAppRelativePath(relativeUrl))
{
(string.Compare(baseDir, templateSourceDirectory, , CultureInfo.InvariantCulture) == )
{
relativeUrl;
}
((relativeUrl.Length == ) || !UrlPath.IsRelativeUrl(relativeUrl))
{
relativeUrl;
}
}
string to = UrlPath.Combine(templateSourceDirectory, relativeUrl);
UrlPath.MakeRelative(UrlPath.AppendSlashToPathIfNeeded(baseDir), to);
}
string ResolveUrl(string relativeUrl)
{
(relativeUrl == )
{
ArgumentNullException();
}
((relativeUrl.Length == ) || !UrlPath.IsRelativeUrl(relativeUrl))
{
relativeUrl;
}
string templateSourceDirectory = .TemplateSourceDirectory;
(templateSourceDirectory.Length == )
{
relativeUrl;
}
string virtualPath = UrlPath.Combine(templateSourceDirectory, relativeUrl);
.Context.Response.ApplyAppPathModifier(virtualPath);
}
object SaveViewState()
{
(.flags[])
{
.ViewState[] = !.flags[];
}
(._viewState != )
{
._viewState.SaveViewState();
}
;
}
object SaveViewStateRecursive()
{
(.flags[])
{
;
}
object x = .SaveViewState();
ArrayList y = ;
ArrayList z = ;
(._controls != )
{
int count = ._controls.Count;
(int i = ; i < count; i++)
{
object obj3 = ._controls[i].SaveViewStateRecursive();
(obj3 != )
{
(y == )
{
y = ArrayList();
z = ArrayList();
}
y.Add(i);
z.Add(obj3);
}
}
}
Triplet triplet = ;
((x == ) && (y == ))
{
triplet;
}
Triplet(x, y, z);
}
void SetNonBindingContainer()
{
.flags[] = ;
}
[EditorBrowsable(EditorBrowsableState.Advanced)]
void SetRenderMethodDelegate(RenderMethod renderMethod)
{
._renderMethod = renderMethod;
.Controls.SetCollectionReadOnly();
}
void IParserAccessor.AddParsedSubObject(object obj)
{
.AddParsedSubObject(obj);
}
void TrackViewState()
{
(._viewState != )
{
._viewState.TrackViewState();
}
.flags[] = ;
}
void UnloadRecursive(bool dispose)
{
(._controls != )
{
string errorMsg = ._controls.SetCollectionReadOnly();
int count = ._controls.Count;
(int i = ; i < count; i++)
{
._controls[i].UnloadRecursive(dispose);
}
._controls.SetCollectionReadOnly(errorMsg);
}
.OnUnload(EventArgs.Empty);
(dispose)
{
.Dispose();
}
(.IsReloadable)
{
._controlState = ControlState.Constructed;
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), EditorBrowsable(EditorBrowsableState.Never), Browsable()]
Control BindingContainer
{
{
Control namingContainer = .NamingContainer;
(namingContainer.flags[])
{
namingContainer = namingContainer.BindingContainer;
}
namingContainer;
}
}
bool ChildControlsCreated
{
{
.flags[];
}
{
(! && .flags[])
{
.Controls.Clear();
}
.flags[] = ;
}
}
[Browsable(), WebSysDescription(), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
string ClientID
{
{
string uniqueID = .UniqueID;
(.UniqueID == )
{
;
}
(uniqueID.IndexOf() >= )
{
uniqueID.Replace(, );
}
uniqueID;
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Browsable()]
HttpContext Context
{
{
(._page != )
{
._page.Context;
}
HttpContext.Current;
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Browsable(), WebSysDescription()]
ControlCollection Controls
{
{
(._controls == )
{
._controls = .CreateControlCollection();
}
._controls;
}
}
ControlState ControlState
{
{
._controlState;
}
}
[WebSysDescription(), DefaultValue(), WebCategory()]
bool EnableViewState
{
{
!.flags[];
}
{
.flags[] = !;
}
}
EventHandlerList Events
{
{
(._events == )
{
._events = EventHandlerList();
}
._events;
}
}
bool HasChildViewState
{
{
((._controlsViewState != ) && (._controlsViewState.Count > ));
}
}
[MergableProperty(), ParenthesizePropertyName(), WebSysDescription()]
string ID
{
{
(!.flags[])
{
;
}
._id;
}
{
(( != ) && (.Length == ))
{
= ;
}
string str = ._id;
._id = ;
.ClearCachedUniqueIDRecursive();
.flags[] = ;
((._namingContainer != ) && (str != ))
{
._namingContainer.DirtyNameTable();
}
}
}
bool IsReloadable
{
{
;
}
}
bool IsTrackingViewState
{
{
.flags[];
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), WebSysDescription(), Browsable()]
Control NamingContainer
{
{
((._namingContainer == ) && (._parent != ))
{
(._parent.flags[])
{
._namingContainer = ._parent;
}
{
._namingContainer = ._parent.NamingContainer;
}
}
._namingContainer;
}
}
[Browsable(), WebSysDescription(), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
Page Page
{
{
((._page == ) && (._parent != ))
{
._page = ._parent.Page;
}
._page;
}
{
._page = ;
}
}
[Browsable(), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), WebSysDescription()]
Control Parent
{
{
._parent;
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Browsable(), EditorBrowsable(EditorBrowsableState.Advanced), WebSysDescription()]
ISite Site
{
{
._site;
}
{
._site = ;
}
}
DataBindingCollection IDataBindingsAccessor.DataBindings
{
{
(._dataBindings == )
{
._dataBindings = DataBindingCollection();
}
._dataBindings;
}
}
bool IDataBindingsAccessor.HasDataBindings
{
{
((._dataBindings != ) && (._dataBindings.Count != ));
}
}
[Browsable(), WebSysDescription(), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
string TemplateSourceDirectory
{
{
(._parent == )
{
string.Empty;
}
._parent.TemplateSourceDirectory;
}
}
[WebSysDescription(), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Browsable()]
string UniqueID
{
{
(._cachedUniqueID == )
{
(._namingContainer == )
{
._id;
}
(._id == )
{
.GenerateAutomaticID();
}
(._page == ._namingContainer)
{
._cachedUniqueID = ._id;
}
{
(._namingContainer.GetUniqueIDPrefix().Length == )
{
._id;
}
._cachedUniqueID = ._namingContainer.GetUniqueIDPrefix() + ._id;
}
}
._cachedUniqueID;
}
}
string UniqueIDWithDollars
{
{
string uniqueID = .UniqueID;
(uniqueID == )
{
;
}
(uniqueID.IndexOf() >= )
{
uniqueID.Replace(, );
}
uniqueID;
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), WebSysDescription(), Browsable()]
StateBag ViewState
{
{
(._viewState == )
{
._viewState = StateBag(.ViewStateIgnoresCase);
(.IsTrackingViewState)
{
._viewState.TrackViewState();
}
}
._viewState;
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Browsable()]
bool ViewStateIgnoresCase
{
{
;
}
}
[WebSysDescription(), DefaultValue(), Bindable(), WebCategory()]
bool Visible
{
{
(.flags[])
{
;
}
(._parent != )
{
._parent.Visible;
}
;
}
{
bool flag = !.flags[];
(flag != )
{
.flags[] = !;
(.flags[])
{
.flags[] = ;
}
}
}
}
}
|