Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / XmlUtils / System / Xml / Xsl / Runtime / EarlyBoundInfo.cs / 5 / EarlyBoundInfo.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- using System.Diagnostics; using System.Reflection; namespace System.Xml.Xsl.Runtime { ////// This class contains information about early bound function objects. /// internal sealed class EarlyBoundInfo { private string namespaceUri; // Namespace Uri mapped to these early bound functions private ConstructorInfo constrInfo; // Constructor for the early bound function object public EarlyBoundInfo(string namespaceUri, Type ebType) { Debug.Assert(namespaceUri != null && ebType != null); // Get the default constructor this.namespaceUri = namespaceUri; this.constrInfo = ebType.GetConstructor(Type.EmptyTypes); Debug.Assert(this.constrInfo != null, "The early bound object type " + ebType.FullName + " must have a public default constructor"); } ////// Get the Namespace Uri mapped to these early bound functions. /// public string NamespaceUri { get { return this.namespaceUri; } } ////// Return the Clr Type of the early bound object. /// public Type EarlyBoundType { get { return this.constrInfo.DeclaringType; } } ////// Create an instance of the early bound object. /// public object CreateObject() { return this.constrInfo.Invoke(new object[] {}); } ////// Override Equals method so that EarlyBoundInfo to implement value comparison. /// public override bool Equals(object obj) { EarlyBoundInfo info = obj as EarlyBoundInfo; if (info == null) return false; return this.namespaceUri == info.namespaceUri && this.constrInfo == info.constrInfo; } ////// Override GetHashCode since Equals is overriden. /// public override int GetHashCode() { return this.namespaceUri.GetHashCode(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- using System.Diagnostics; using System.Reflection; namespace System.Xml.Xsl.Runtime { ////// This class contains information about early bound function objects. /// internal sealed class EarlyBoundInfo { private string namespaceUri; // Namespace Uri mapped to these early bound functions private ConstructorInfo constrInfo; // Constructor for the early bound function object public EarlyBoundInfo(string namespaceUri, Type ebType) { Debug.Assert(namespaceUri != null && ebType != null); // Get the default constructor this.namespaceUri = namespaceUri; this.constrInfo = ebType.GetConstructor(Type.EmptyTypes); Debug.Assert(this.constrInfo != null, "The early bound object type " + ebType.FullName + " must have a public default constructor"); } ////// Get the Namespace Uri mapped to these early bound functions. /// public string NamespaceUri { get { return this.namespaceUri; } } ////// Return the Clr Type of the early bound object. /// public Type EarlyBoundType { get { return this.constrInfo.DeclaringType; } } ////// Create an instance of the early bound object. /// public object CreateObject() { return this.constrInfo.Invoke(new object[] {}); } ////// Override Equals method so that EarlyBoundInfo to implement value comparison. /// public override bool Equals(object obj) { EarlyBoundInfo info = obj as EarlyBoundInfo; if (info == null) return false; return this.namespaceUri == info.namespaceUri && this.constrInfo == info.constrInfo; } ////// Override GetHashCode since Equals is overriden. /// public override int GetHashCode() { return this.namespaceUri.GetHashCode(); } } } // 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
- XPathDocumentIterator.cs
- DataGridCell.cs
- BrushMappingModeValidation.cs
- TypeElementCollection.cs
- ReadOnlyCollectionBase.cs
- XmlCharType.cs
- FaultDesigner.cs
- TextStore.cs
- AdapterUtil.cs
- ComplexTypeEmitter.cs
- LambdaCompiler.Binary.cs
- NgenServicingAttributes.cs
- AssemblyUtil.cs
- UpDownBase.cs
- AuthenticationConfig.cs
- TemplatePropertyEntry.cs
- Utils.cs
- MonthChangedEventArgs.cs
- Baml2006SchemaContext.cs
- UpdateCompiler.cs
- DataConnectionHelper.cs
- StrongName.cs
- TextEditorMouse.cs
- StylusEventArgs.cs
- AnimationClock.cs
- EmptyControlCollection.cs
- SqlFormatter.cs
- FileDialogPermission.cs
- GridViewSelectEventArgs.cs
- ValueTypeIndexerReference.cs
- TabPage.cs
- Array.cs
- AddInToken.cs
- KeyValueSerializer.cs
- EncodingTable.cs
- PropertyGeneratedEventArgs.cs
- WindowsHyperlink.cs
- SSmlParser.cs
- XmlSchemaProviderAttribute.cs
- SystemMulticastIPAddressInformation.cs
- RangeValidator.cs
- RenderDataDrawingContext.cs
- KeyNotFoundException.cs
- SqlNodeTypeOperators.cs
- WebPartVerb.cs
- MeasureItemEvent.cs
- HttpModuleCollection.cs
- EarlyBoundInfo.cs
- ProviderCommandInfoUtils.cs
- HierarchicalDataSourceControl.cs
- IPAddress.cs
- TextDecoration.cs
- ProfileProvider.cs
- ExpressionUtilities.cs
- WebPartsPersonalization.cs
- GridSplitter.cs
- SizeLimitedCache.cs
- FontWeights.cs
- DateTimeConstantAttribute.cs
- XmlBinaryReaderSession.cs
- FileUpload.cs
- AutomationPropertyInfo.cs
- CodeMemberField.cs
- ITextView.cs
- TextCollapsingProperties.cs
- CodeGotoStatement.cs
- ParsedAttributeCollection.cs
- SafeTokenHandle.cs
- UIElementIsland.cs
- BaseAppDomainProtocolHandler.cs
- FloaterParaClient.cs
- BuilderPropertyEntry.cs
- BitmapEffect.cs
- SHA512CryptoServiceProvider.cs
- TypeListConverter.cs
- Byte.cs
- LogReserveAndAppendState.cs
- DataService.cs
- ApplicationHost.cs
- HostedHttpContext.cs
- PageEventArgs.cs
- FrameworkTemplate.cs
- ResolveCriteria11.cs
- SecurityKeyIdentifierClause.cs
- DataProviderNameConverter.cs
- HttpCacheParams.cs
- MenuItemCollection.cs
- HGlobalSafeHandle.cs
- UriScheme.cs
- PropertyEntry.cs
- EntryWrittenEventArgs.cs
- DocumentViewerHelper.cs
- TypeBuilderInstantiation.cs
- DataGridViewColumnHeaderCell.cs
- DbConnectionPoolIdentity.cs
- SecurityUtils.cs
- ValidatorUtils.cs
- PropertyMappingExceptionEventArgs.cs
- XmlSchemaAll.cs
- UnaryNode.cs