Appendix B. Object Model for Common Classes


This appendix lists the public and protected members of the core classes related to control authoring.

 publicclassControl:IComponent,IParserAccessor{ publicControl(); //Referencetoparentcontrolsinthecontroltree publicvirtualPagePage{get;set;} publicvirtualControlParent{get;} publicControlBindingContainer{get;} publicvirtualControlNamingContainer{get;} //Identificationwithinthecontroltree publicvirtualstringClientID{get;} publicvirtualstringID{get;set;} publicvirtualstringUniqueID{get;} //Referencestochildcontrolsinthecontroltree protectedboolChildControlsCreated{get;set;} publicvirtualControlCollectionControls{get;} protectedvirtualvoidCreateChildControls(); protectedvirtualControlCollectionCreateControlCollection(); protectedvirtualvoidEnsureChildControls(); publicvirtualboolHasControls(); publicvirtualControlFindControl(stringid); protectedvirtualvoidAddParsedSubObject(objectobj); //Statemanagement publicvirtualboolEnableViewState{get;set;} protectedboolHasChildViewState{get;} protectedboolIsTrackingViewState{get;} protectedvirtualStateBagViewState{get;} protectedvoidClearChildViewState(); protectedvirtualvoidLoadViewState(objectsavedState); protectedvirtualobjectSaveViewState(); protectedvirtualvoidTrackViewState(); //Visibilityandrendering publicvirtualboolVisible{get;set;} protectedvirtualvoidRender(HtmlTextWriterwriter); protectedvirtualvoidRenderChildren(HtmlTextWriterwriter); publicvoidRenderControl(HtmlTextWriterwriter); //Data-bindingsupport publicvirtualvoidDataBind(); //IComponentrelated publicISiteSite{get;set;} publicvirtualvoidDispose(); //UtilityAPI protectedvirtualHttpContextContext{get;} protectedstringMapPathSecure(stringvirtualPath); publicvirtualstringTemplateSourceDirectory{get;} publicstringResolveUrl(stringrelativeUrl); //Events publiceventEventHandlerDataBinding; publiceventEventHandlerDisposed; publiceventEventHandlerInit; publiceventEventHandlerLoad; publiceventEventHandlerPreRender; publiceventEventHandlerUnload; protectedvirtualvoidOnDataBinding(EventArgse); protectedvirtualvoidOnInit(EventArgse); protectedvirtualvoidOnLoad(EventArgse); protectedvirtualvoidOnPreRender(EventArgse); protectedvirtualvoidOnUnload(EventArgse); protectedEventHandlerListEvents{get;} protectedvirtualboolOnBubbleEvent(objectsource,EventArgsargs); protectedvoidRaiseBubbleEvent(objectsource,EventArgsargs); } 

System.Web.UI.Control

 publicclassWebControl:Control,IAttributeAccessor{ protectedWebControl(); publicWebControl(HtmlTextWriterTagtag); protectedWebControl(stringtag); //Stylepropertiesandmethods publicvirtualColorForeColor{get;set;} publicvirtualColorBackColor{get;set;} publicvirtualFontInfoFont{get;} publicvirtualBorderStyleBorderStyle{get;set;} publicvirtualColorBorderColor{get;set;} publicvirtualUnitBorderWidth{get;set;} publicvirtualUnitWidth{get;set;} publicvirtualUnitHeight{get;set;} publicvirtualstringCssClass{get;set;} publicboolControlStyleCreated{get;} publicStyleControlStyle{get;} publicCssStyleCollectionStyle{get;} protectedvirtualStyleCreateControlStyle(); publicvoidApplyStyle(Styles); publicvoidMergeStyle(Styles); //Non-stylerelatedproperties publicAttributeCollectionAttributes{get;} publicvirtualstringAccessKey{get;set;} publicvirtualboolEnabled{get;set;} publicvirtualshortTabIndex{get;set;} publicvirtualstringToolTip{get;set;} publicvoidCopyBaseAttributes(WebControlcontrolSrc); //Rendering protectedvirtualHtmlTextWriterTagTagKey{get;} protectedvirtualstringTagName{get;} protectedvirtualvoidRenderContents(HtmlTextWriterwriter); publicvirtualvoidRenderBeginTag(HtmlTextWriterwriter); publicvirtualvoidRenderEndTag(HtmlTextWriterwriter); protectedvirtualvoidAddAttributesToRender(HtmlTextWriterwriter); } 

System.Web.UI.WebControls.WebControl

 publicclassStyle:Component,IStateManager{ publicStyle(); publicStyle(StateBagbag); //Basicstyleproperties publicColorForeColor{get;set;} publicColorBackColor{get;set;} publicFontInfoFont{get;} publicBorderStyleBorderStyle{get;set;} publicColorBorderColor{get;set;} publicUnitBorderWidth{get;set;} publicUnitWidth{get;set;} publicUnitHeight{get;set;} publicstringCssClass{get;set;} //Styleoperations publicvirtualvoidCopyFrom(Styles); publicvirtualvoidMergeWith(Styles); publicvirtualvoidReset(); //Statemanagement protectedboolIsTrackingViewState{get;} //Renderingrelated publicvoidAddAttributesToRender(HtmlTextWriterwriter); publicvirtualvoidAddAttributesToRender(HtmlTextWriterwriter, WebControlowner); } 

System.Web.UI.WebControls.Style

 publicsealedclassFontInfo{ //Basicproperties publicstringName{get;set;} publicstring[]Names{get;set;} publicFontUnitSize{get;set;} publicboolBold{get;set;} publicboolItalic{get;set;} publicboolUnderline{get;set;} publicboolStrikeout{get;set;} publicboolOverline{get;set;} //Styleoperationsrelated publicvoidCopyFrom(FontInfof); publicvoidMergeWith(FontInfof); } 

System.Web.UI.WebControls.FontInfo

 publicinterfaceIStateManager{ publicboolIsTrackingViewState{get;} publicvoidLoadViewState(objectstate); publicobjectSaveViewState(); publicvoidTrackViewState(); } 

System.Web.UI.IStateManager

 publicinterfaceIPostBackDataHandler{ publicboolLoadPostData(stringpostDataKey, NameValueCollectionpostCollection); publicvoidRaisePostDataChangedEvent(); } 

System.Web.UI.IPostBackDataHandler

 publicinterfaceIPostBackEventHandler{ publicvoidRaisePostBackEvent(stringeventArgument); } 

System.Web.UI.IPostBackEventHandler

 publicabstractclassTemplateControl:Control,INamingContainer{ protectedTemplateControl(); publicControlLoadControl(stringvirtualPath); publicITemplateLoadTemplate(stringvirtualPath); publicControlParseControl(stringcontent); } publicclassPage:TemplateControl,IHttpHandler{ publicPage(); //Postbackrelated publicboolIsPostBack{get;} publicboolSmartNavigation{get;set;} protectedvirtualNameValueCollectionDeterminePostBackMode(); protectedvirtualvoidRaisePostBackEvent(IPostBackEventHandlersourceControl, stringeventArgument); publicvoidRegisterRequiresPostBack(Controlcontrol); publicvirtualvoidVerifyRenderingInServerForm(Controlcontrol); //Renderingrelated publicstringClientTarget{get;set;} protectedstringContentType{set;} protectedvirtualHtmlTextWriterCreateHtmlTextWriter(TextWritertw); //Client-scriptrelated publicstringGetPostBackClientEvent(Controlcontrol, stringargument); publicstringGetPostBackClientHyperlink(Controlcontrol, stringargument); publicstringGetPostBackEventReference(Controlcontrol); publicstringGetPostBackEventReference(Controlcontrol, stringargument); publicboolIsClientScriptBlockRegistered(stringkey); publicboolIsStartupScriptRegistered(stringkey); publicvoidRegisterArrayDeclaration(stringarrayName, stringarrayValue); publicvirtualvoidRegisterClientScriptBlock(stringkey, stringscript); publicvirtualvoidRegisterHiddenField(stringhiddenFieldName, stringhiddenFieldInitialValue); //Statemanagement protectedboolEnableViewStateMac{get;set;} protectedvirtualobjectLoadPageStateFromPersistenceMedium(); protectedvirtualvoidSavePageStateToPersistenceMedium(objectviewState); publicvoidRegisterOnSubmitStatement(stringkey,stringscript); publicvirtualvoidRegisterRequiresRaiseEvent(IPostBackEventHandlercontrol); publicvirtualvoidRegisterStartupScript(stringkey, stringscript); //Globalization protectedintCodePage{set;} protectedstringCulture{set;} protectedstringUICulture{set;} protectedintLCID{set;} //Validation publicboolIsValid{get;} publicValidatorCollectionValidators{get;} publicvirtualvoidValidate(); //IHttpHandlerimplementation publicboolIsReusable{get;} publicvoidProcessRequest(HttpContextcontext); //Page-intrinsicobjects publicHttpApplicationStateApplication{get;} publicCacheCache{get;} publicHttpRequestRequest{get;} publicHttpResponseResponse{get;} protectedstringResponseEncoding{set;} publicHttpServerUtilityServer{get;} publicvirtualHttpSessionStateSession{get;} //Tracing publicTraceContextTrace{get;} protectedboolTraceEnabled{set;} protectedTraceModeTraceModeValue{set;} //Miscellaneous publicstringMapPath(stringvirtualPath); protectedintTransactionMode{set;} publicIPrincipalUser{get;} publicstringErrorPage{get;set;} } 

System.Web.UI.Page

 publicclassHtmlControlDesigner:ComponentDesigner{ publicHtmlControlDesigner(); publicIHtmlControlDesignerBehaviorBehavior{get;set;} publicDataBindingCollectionDataBindings{get;} protectedvirtualvoidOnBindingsCollectionChanged(stringpropName); } publicclassControlDesigner:HtmlControlDesigner{ publicControlDesigner(); //Design-timeHTMLrelated publicvirtualboolDesignTimeHtmlRequiresLoadComplete{get;} publicvirtualstringGetDesignTimeHtml(); protectedvirtualstringGetEmptyDesignTimeHtml(); protectedvirtualstringGetErrorDesignTimeHtml(Exceptione); protectedstringCreatePlaceHolderDesignTimeHtml(); protectedstringCreatePlaceHolderDesignTimeHtml(stringinstruction); publicvirtualvoidUpdateDesignTimeHtml(); //Persistencerelated publicvirtualstringGetPersistInnerHtml(); publicvirtualvoidOnComponentChanged(objectsender, ComponentChangedEventArgsce); publicvirtualboolAllowResize{get;} protectedobjectDesignTimeElementView{get;} } 

System.Web.UI.Design.ControlDesigner

Using C# Documentation Comments

C# supports documentation comments for classes and class members. The comments use an XML syntax that allows you to generate reference documentation for your classes. The C# Programmer's Reference in MSDN contains a detailed listing of the documentation tags. The following code fragment provides an example of this feature.

  ///<summary> ///Adata-boundtemplatedcontrolthatgeneratesacolumnar, /// scrollablerepresentationofthedatainadatasource. ///</summary>  publicclassListView:WebControl{  ///<summary> ///Getsorsetsthevaluecontainingthelist ///ofvaluestobe rendered. ///</summary>  publicobjectDataSource{get;set;}  ///<summary> ///Createsthecontroltreeusedtogeneratethevisual ///representationofdatainthecontrol'sdatasource. ///</summary> ///<paramname="useDataSource"> ///Whetherthehierarchyshouldbecreated /// fromthedatasource ///orifitshouldberecreatedusingviewstate. ///</param>  protectedvirtualvoidCreateControlHierarchy (booluseDataSource) {...} } 

You can use the /doc option of the C# compiler to generate an XML file that consists of all the documentation comments you have added for any types in your assembly. For example, the command used to build an assembly and its associated documentation is

 csc/t:library/out:MyControls.dll /r:System.dll/r:System.Web.dll/r:System.Drawing.dll /r:System.Design.dll  /doc:MyControls.xml  *.cs 

The XML documentation can be used to generate help content in HTML format using an .xsl file that transforms the XML documentation comments syntax into HTML markup. An example .xsl file is included in this book's sample files to demonstrate this.



Developing Microsoft ASP. NET Server Controls and Components
Developing Microsoft ASP.NET Server Controls and Components (Pro-Developer)
ISBN: 0735615829
EAN: 2147483647
Year: 2005
Pages: 183

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net