Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / Runtime / EarlyBoundInfo.cs / 1305376 / 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
- RequestCachePolicyConverter.cs
- followingsibling.cs
- ProjectedSlot.cs
- DeferredBinaryDeserializerExtension.cs
- TextChangedEventArgs.cs
- ClientTargetSection.cs
- SafeNativeMethods.cs
- GridItemPatternIdentifiers.cs
- SettingsPropertyNotFoundException.cs
- ToolStripDropDownClosedEventArgs.cs
- MenuBase.cs
- DataServiceStreamProviderWrapper.cs
- SelectionRange.cs
- ObjectTag.cs
- XmlSerializationGeneratedCode.cs
- MSHTMLHostUtil.cs
- SubMenuStyleCollectionEditor.cs
- IISUnsafeMethods.cs
- X509ThumbprintKeyIdentifierClause.cs
- _HeaderInfo.cs
- ObjectAnimationUsingKeyFrames.cs
- SqlCacheDependencyDatabase.cs
- ServiceModelConfigurationElementCollection.cs
- WebConfigManager.cs
- Membership.cs
- TextSimpleMarkerProperties.cs
- BitSet.cs
- XmlSchemaComplexContentRestriction.cs
- EncryptedHeader.cs
- RowToFieldTransformer.cs
- BitmapEffectDrawingContextWalker.cs
- ThreadAttributes.cs
- PeerNodeAddress.cs
- HistoryEventArgs.cs
- ClientScriptManager.cs
- InteropAutomationProvider.cs
- Point.cs
- TypeNameConverter.cs
- GeneratedContractType.cs
- TransformedBitmap.cs
- PeerCollaborationPermission.cs
- CodeNamespaceImport.cs
- PhysicalAddress.cs
- CommandEventArgs.cs
- AsyncCodeActivityContext.cs
- Header.cs
- XPathParser.cs
- WindowsListView.cs
- PathFigure.cs
- BindingsCollection.cs
- EnumValAlphaComparer.cs
- WinEventQueueItem.cs
- Int16AnimationUsingKeyFrames.cs
- EnumValidator.cs
- AutomationProperties.cs
- DbException.cs
- CompModSwitches.cs
- MarkupCompilePass1.cs
- TemplateKey.cs
- FilterQueryOptionExpression.cs
- ISO2022Encoding.cs
- NoPersistProperty.cs
- QuaternionAnimationBase.cs
- MergePropertyDescriptor.cs
- VisualTreeUtils.cs
- _NegoState.cs
- KeyValueConfigurationElement.cs
- UiaCoreApi.cs
- GifBitmapDecoder.cs
- LineVisual.cs
- SurrogateEncoder.cs
- SignatureDescription.cs
- HashHelper.cs
- GetPageNumberCompletedEventArgs.cs
- ContentOperations.cs
- DbParameterCollectionHelper.cs
- _FtpDataStream.cs
- PropagatorResult.cs
- ColorAnimation.cs
- ImageInfo.cs
- Shape.cs
- TableItemPattern.cs
- CreateRefExpr.cs
- Composition.cs
- OleDbDataReader.cs
- InfoCardSymmetricAlgorithm.cs
- HtmlTitle.cs
- EventEntry.cs
- ValueTypeFixupInfo.cs
- PathFigure.cs
- CompilationUtil.cs
- SimpleBitVector32.cs
- Style.cs
- CreateCardRequest.cs
- DataComponentNameHandler.cs
- RichTextBoxConstants.cs
- HiddenField.cs
- PageCodeDomTreeGenerator.cs
- ReliabilityContractAttribute.cs
- DSGeneratorProblem.cs