Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / CompositeControl.cs / 1305376 / CompositeControl.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System.ComponentModel; using System.Web.Util; ////// Base class for composite controls -- controls that contain other controls and reuse their functionality /// via class composition. See Chapter 12 in "Developing Microsoft ASP.NET Server Controls and Components." /// The following classes have copied code from this class (look for "Copied from CompositeControl" comment): /// - ChangePassword /// - Login /// - LoginView /// - SiteMapPath /// [ Designer("System.Web.UI.Design.WebControls.CompositeControlDesigner, " + AssemblyRef.SystemDesign) ] public abstract class CompositeControl : WebControl, INamingContainer, ICompositeControlDesignerAccessor { ////// Ensure that the child controls have been created before returning the controls collection /// public override ControlCollection Controls { get { EnsureChildControls(); return base.Controls; } } public override bool SupportsDisabledAttribute { get { return RenderingCompatibility < VersionUtil.Framework40; } } ////// Perform our own databinding, then perform our child controls' databinding. /// Does not call Base.DataBind(), since we need to call EnsureChildControls() between /// OnDataBinding() and DataBindChildren(). /// public override void DataBind() { OnDataBinding(EventArgs.Empty); EnsureChildControls(); DataBindChildren(); } protected virtual void RecreateChildControls() { ChildControlsCreated = false; EnsureChildControls(); } // Needed so the CompositeControl renders correctly in the designer, even when it does not have // an associated ControlDesigner (i.e. it is a child control of another CompositeControl). protected internal override void Render(HtmlTextWriter writer) { if (DesignMode) { EnsureChildControls(); } base.Render(writer); } #region ICompositeControlDesignerAccessor implementation void ICompositeControlDesignerAccessor.RecreateChildControls() { RecreateChildControls(); } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System.ComponentModel; using System.Web.Util; ////// Base class for composite controls -- controls that contain other controls and reuse their functionality /// via class composition. See Chapter 12 in "Developing Microsoft ASP.NET Server Controls and Components." /// The following classes have copied code from this class (look for "Copied from CompositeControl" comment): /// - ChangePassword /// - Login /// - LoginView /// - SiteMapPath /// [ Designer("System.Web.UI.Design.WebControls.CompositeControlDesigner, " + AssemblyRef.SystemDesign) ] public abstract class CompositeControl : WebControl, INamingContainer, ICompositeControlDesignerAccessor { ////// Ensure that the child controls have been created before returning the controls collection /// public override ControlCollection Controls { get { EnsureChildControls(); return base.Controls; } } public override bool SupportsDisabledAttribute { get { return RenderingCompatibility < VersionUtil.Framework40; } } ////// Perform our own databinding, then perform our child controls' databinding. /// Does not call Base.DataBind(), since we need to call EnsureChildControls() between /// OnDataBinding() and DataBindChildren(). /// public override void DataBind() { OnDataBinding(EventArgs.Empty); EnsureChildControls(); DataBindChildren(); } protected virtual void RecreateChildControls() { ChildControlsCreated = false; EnsureChildControls(); } // Needed so the CompositeControl renders correctly in the designer, even when it does not have // an associated ControlDesigner (i.e. it is a child control of another CompositeControl). protected internal override void Render(HtmlTextWriter writer) { if (DesignMode) { EnsureChildControls(); } base.Render(writer); } #region ICompositeControlDesignerAccessor implementation void ICompositeControlDesignerAccessor.RecreateChildControls() { RecreateChildControls(); } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- InkCanvasSelection.cs
- StandardCommands.cs
- IntegerFacetDescriptionElement.cs
- UICuesEvent.cs
- RC2.cs
- DbMetaDataFactory.cs
- Panel.cs
- SelectionChangedEventArgs.cs
- OlePropertyStructs.cs
- CompositeDataBoundControl.cs
- ColorTransformHelper.cs
- CharKeyFrameCollection.cs
- sqlstateclientmanager.cs
- TrackingServices.cs
- EndpointNameMessageFilter.cs
- SimpleMailWebEventProvider.cs
- FontEmbeddingManager.cs
- CodeTypeConstructor.cs
- DataTableCollection.cs
- StateChangeEvent.cs
- SQlBooleanStorage.cs
- ModelPerspective.cs
- SafeBitVector32.cs
- WebPartExportVerb.cs
- SiteMapDesignerDataSourceView.cs
- SignerInfo.cs
- WmpBitmapDecoder.cs
- HtmlHistory.cs
- safesecurityhelperavalon.cs
- ListViewCommandEventArgs.cs
- storepermission.cs
- DataView.cs
- EnumUnknown.cs
- ColumnClickEvent.cs
- ExtendedProtectionPolicy.cs
- TabItemWrapperAutomationPeer.cs
- SimpleTypeResolver.cs
- TraceHandler.cs
- WebServiceResponse.cs
- GenericTextProperties.cs
- _NestedMultipleAsyncResult.cs
- CalendarDayButton.cs
- SpellerStatusTable.cs
- ExecutionContext.cs
- DataSourceProvider.cs
- CroppedBitmap.cs
- ResourceIDHelper.cs
- SiteMapPath.cs
- XLinq.cs
- TabletDeviceInfo.cs
- SchemaInfo.cs
- ScalarConstant.cs
- Module.cs
- ContextMenu.cs
- CustomAttribute.cs
- SQLDecimalStorage.cs
- EdmConstants.cs
- GlyphingCache.cs
- ISO2022Encoding.cs
- ImageSourceConverter.cs
- ProcessingInstructionAction.cs
- __Error.cs
- Query.cs
- MyContact.cs
- PerfCounterSection.cs
- BridgeDataRecord.cs
- ValuePattern.cs
- Enum.cs
- ManagementOperationWatcher.cs
- SctClaimSerializer.cs
- SecurityContext.cs
- PropertyGridView.cs
- InternalTypeHelper.cs
- ItemCheckedEvent.cs
- PrintSystemException.cs
- DynamicPropertyHolder.cs
- ChannelEndpointElement.cs
- SystemIcmpV4Statistics.cs
- ChameleonKey.cs
- SetIterators.cs
- InputScopeManager.cs
- ChannelHandler.cs
- InternalTransaction.cs
- MeasureItemEvent.cs
- Add.cs
- CFStream.cs
- TransportSecurityHelpers.cs
- FixedSOMImage.cs
- TracePayload.cs
- QueryOutputWriterV1.cs
- CqlBlock.cs
- BufferedReadStream.cs
- COM2ColorConverter.cs
- Activator.cs
- DeclaredTypeValidator.cs
- WindowsIPAddress.cs
- wgx_exports.cs
- ToolStripSplitButton.cs
- AdCreatedEventArgs.cs
- ChannelFactoryBase.cs