Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / RootBuilder.cs / 1305376 / RootBuilder.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* * Implements the root builder * * Copyright (c) 1998 Microsoft Corporation */ namespace System.Web.UI { using System.Runtime.InteropServices; using System; using System.Collections; using System.IO; using System.Reflection; using System.Web; using System.Web.Util; ////// /// public class RootBuilder : TemplateBuilder { private MainTagNameToTypeMapper _typeMapper; // Contains a mapping of all objects to their associated builders private IDictionary _builtObjects; public RootBuilder() { } ///[To be supplied.] ////// public RootBuilder(TemplateParser parser) { } public IDictionary BuiltObjects { get { // Store any objects created by this control builder // so we can properly persist items if (_builtObjects == null) { _builtObjects = new Hashtable(ReferenceKeyComparer.Default); } return _builtObjects; } } ///[To be supplied.] ////// The method gets called when the CodeDom tree is fully built. The way it is used is by first overriding /// ProcessGeneratedCode to keep track of the CodeCompileUnit, and to then have the ability to modify /// the CodeCompileUnit in this method /// protected internal virtual void OnCodeGenerationComplete() { } internal void SetTypeMapper(MainTagNameToTypeMapper typeMapper) { _typeMapper = typeMapper; } ////// public override Type GetChildControlType(string tagName, IDictionary attribs) { // Is there a type to handle this control Type type = _typeMapper.GetControlType(tagName, attribs, true /*fAllowHtmlTags*/); return type; } internal override void PrepareNoCompilePageSupport() { base.PrepareNoCompilePageSupport(); // This is needed to break any connection with the TemplateParser, allowing it // to be fully collected when the parsing is complete _typeMapper = null; } private class ReferenceKeyComparer : IComparer, IEqualityComparer { internal static readonly ReferenceKeyComparer Default = new ReferenceKeyComparer(); bool IEqualityComparer.Equals(object x, object y) { return Object.ReferenceEquals(x, y); } int IEqualityComparer.GetHashCode(object obj) { return obj.GetHashCode(); } int IComparer.Compare(object x, object y) { if (Object.ReferenceEquals(x, y)) { return 0; } if (x == null) { return -1; } if (y == null) { return 1; } return 1; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //[To be supplied.] ///// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* * Implements the root builder * * Copyright (c) 1998 Microsoft Corporation */ namespace System.Web.UI { using System.Runtime.InteropServices; using System; using System.Collections; using System.IO; using System.Reflection; using System.Web; using System.Web.Util; ////// /// public class RootBuilder : TemplateBuilder { private MainTagNameToTypeMapper _typeMapper; // Contains a mapping of all objects to their associated builders private IDictionary _builtObjects; public RootBuilder() { } ///[To be supplied.] ////// public RootBuilder(TemplateParser parser) { } public IDictionary BuiltObjects { get { // Store any objects created by this control builder // so we can properly persist items if (_builtObjects == null) { _builtObjects = new Hashtable(ReferenceKeyComparer.Default); } return _builtObjects; } } ///[To be supplied.] ////// The method gets called when the CodeDom tree is fully built. The way it is used is by first overriding /// ProcessGeneratedCode to keep track of the CodeCompileUnit, and to then have the ability to modify /// the CodeCompileUnit in this method /// protected internal virtual void OnCodeGenerationComplete() { } internal void SetTypeMapper(MainTagNameToTypeMapper typeMapper) { _typeMapper = typeMapper; } ////// public override Type GetChildControlType(string tagName, IDictionary attribs) { // Is there a type to handle this control Type type = _typeMapper.GetControlType(tagName, attribs, true /*fAllowHtmlTags*/); return type; } internal override void PrepareNoCompilePageSupport() { base.PrepareNoCompilePageSupport(); // This is needed to break any connection with the TemplateParser, allowing it // to be fully collected when the parsing is complete _typeMapper = null; } private class ReferenceKeyComparer : IComparer, IEqualityComparer { internal static readonly ReferenceKeyComparer Default = new ReferenceKeyComparer(); bool IEqualityComparer.Equals(object x, object y) { return Object.ReferenceEquals(x, y); } int IEqualityComparer.GetHashCode(object obj) { return obj.GetHashCode(); } int IComparer.Compare(object x, object y) { if (Object.ReferenceEquals(x, y)) { return 0; } if (x == null) { return -1; } if (y == null) { return 1; } return 1; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.[To be supplied.] ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- formatter.cs
- NTAccount.cs
- NameService.cs
- WebPartEventArgs.cs
- CommandSet.cs
- EditorZone.cs
- SoundPlayer.cs
- SqlWebEventProvider.cs
- HttpSysSettings.cs
- Popup.cs
- RadioButtonList.cs
- DrawToolTipEventArgs.cs
- PerformanceCounterCategory.cs
- ExternalException.cs
- CultureMapper.cs
- HMACRIPEMD160.cs
- ScrollChrome.cs
- RowType.cs
- RtfControls.cs
- ZipIOExtraFieldElement.cs
- ArcSegment.cs
- BoolExpr.cs
- DetailsViewDeletedEventArgs.cs
- TableRowCollection.cs
- DESCryptoServiceProvider.cs
- ParameterBuilder.cs
- ConfigXmlSignificantWhitespace.cs
- ModifiableIteratorCollection.cs
- DBNull.cs
- CssStyleCollection.cs
- SessionEndedEventArgs.cs
- UpdateCommand.cs
- X509Extension.cs
- MemberInfoSerializationHolder.cs
- BitmapFrame.cs
- TextTreeDeleteContentUndoUnit.cs
- ComponentEvent.cs
- NumericUpDownAccelerationCollection.cs
- BmpBitmapDecoder.cs
- FormsAuthenticationCredentials.cs
- PocoEntityKeyStrategy.cs
- Image.cs
- XmlNamespaceMapping.cs
- XmlUtil.cs
- FontCacheLogic.cs
- MsmqIntegrationElement.cs
- objectquery_tresulttype.cs
- CompoundFileReference.cs
- QueryAccessibilityHelpEvent.cs
- SqlVisitor.cs
- SecurityElement.cs
- OleDbStruct.cs
- DbConnectionPoolOptions.cs
- MatrixCamera.cs
- XmlWrappingWriter.cs
- Maps.cs
- PreviewPageInfo.cs
- MenuDesigner.cs
- SymLanguageVendor.cs
- GradientBrush.cs
- EntityCommandDefinition.cs
- OverrideMode.cs
- TemplatePartAttribute.cs
- PathFigureCollection.cs
- IndexingContentUnit.cs
- PreProcessor.cs
- WmfPlaceableFileHeader.cs
- FrameworkObject.cs
- DefaultSection.cs
- AsymmetricAlgorithm.cs
- StrokeCollection.cs
- DrawingContextDrawingContextWalker.cs
- ProjectionAnalyzer.cs
- XmlLanguage.cs
- ManualResetEvent.cs
- XmlDataImplementation.cs
- WindowsIPAddress.cs
- TextEditor.cs
- FilterQueryOptionExpression.cs
- HtmlAnchor.cs
- mediaclock.cs
- DateTime.cs
- SelectionWordBreaker.cs
- ComboBox.cs
- UnknownExceptionActionHelper.cs
- SocketAddress.cs
- BindableTemplateBuilder.cs
- HashAlgorithm.cs
- EditableRegion.cs
- SoapSchemaExporter.cs
- CachedCompositeFamily.cs
- CompilationUnit.cs
- ToolBarTray.cs
- SelectingProviderEventArgs.cs
- SQLInt64.cs
- MdImport.cs
- SerializationInfoEnumerator.cs
- RawTextInputReport.cs
- DbMetaDataCollectionNames.cs
- PnrpPeerResolver.cs