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
- BitStack.cs
- AssociativeAggregationOperator.cs
- InternalConfigEventArgs.cs
- AssemblyCollection.cs
- IdentityNotMappedException.cs
- BulletedListEventArgs.cs
- AbandonedMutexException.cs
- DataGridViewDataErrorEventArgs.cs
- ScrollBar.cs
- DoWorkEventArgs.cs
- Brushes.cs
- XmlElement.cs
- WindowsSolidBrush.cs
- Cloud.cs
- GeneralTransform3DCollection.cs
- PrintPageEvent.cs
- EnvironmentPermission.cs
- ProjectionPruner.cs
- SelectionChangedEventArgs.cs
- FrugalMap.cs
- CommandSet.cs
- NotifyCollectionChangedEventArgs.cs
- DesignerWebPartChrome.cs
- StrokeNodeEnumerator.cs
- NamespaceCollection.cs
- DataDocumentXPathNavigator.cs
- XmlDictionary.cs
- RoutedEventValueSerializer.cs
- VisualBrush.cs
- ThicknessAnimationUsingKeyFrames.cs
- TableLayoutCellPaintEventArgs.cs
- ColorKeyFrameCollection.cs
- ObjectQuery.cs
- FixedPosition.cs
- DBConnectionString.cs
- ApplicationFileParser.cs
- ComponentResourceManager.cs
- AnnotationComponentChooser.cs
- JulianCalendar.cs
- RootBuilder.cs
- ExceptionHelpers.cs
- XamlInt32CollectionSerializer.cs
- DragEvent.cs
- SpAudioStreamWrapper.cs
- BufferedReceiveElement.cs
- HtmlSelect.cs
- SessionEndedEventArgs.cs
- Debug.cs
- ModuleConfigurationInfo.cs
- MailSettingsSection.cs
- MetafileHeaderWmf.cs
- FixedStringLookup.cs
- XPathNodeIterator.cs
- SafeArrayTypeMismatchException.cs
- MimeFormatExtensions.cs
- Exceptions.cs
- KoreanLunisolarCalendar.cs
- securitycriticaldata.cs
- PropertyGridEditorPart.cs
- XmlQueryOutput.cs
- WebPartVerbCollection.cs
- CryptoApi.cs
- XamlSerializerUtil.cs
- DefaultHttpHandler.cs
- PictureBox.cs
- DocumentPaginator.cs
- Merger.cs
- NotifyCollectionChangedEventArgs.cs
- DesignColumn.cs
- control.ime.cs
- XmlHierarchicalEnumerable.cs
- EtwTrackingParticipant.cs
- DependencyProperty.cs
- PropertyGridEditorPart.cs
- ObjectDataSourceDisposingEventArgs.cs
- TrackingDataItemValue.cs
- MessageQueuePermission.cs
- HitTestParameters3D.cs
- ExecutionEngineException.cs
- WebControlAdapter.cs
- PeerApplicationLaunchInfo.cs
- QilPatternVisitor.cs
- FormatSettings.cs
- AppDomainAttributes.cs
- Regex.cs
- SplitterEvent.cs
- Table.cs
- Compilation.cs
- CollectionChangedEventManager.cs
- DoubleLinkListEnumerator.cs
- MeasureItemEvent.cs
- ArrangedElement.cs
- TypeBuilder.cs
- ConfigXmlText.cs
- MetadataArtifactLoaderResource.cs
- ParameterCollection.cs
- TypeDependencyAttribute.cs
- HierarchicalDataSourceDesigner.cs
- HGlobalSafeHandle.cs
- JsonQNameDataContract.cs