Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / XmlUtils / System / Xml / Xsl / Runtime / EarlyBoundInfo.cs / 1 / 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
- StringKeyFrameCollection.cs
- TypedTableBase.cs
- ProfileManager.cs
- ModifierKeysValueSerializer.cs
- RedistVersionInfo.cs
- ConfigurationValidatorBase.cs
- TripleDESCryptoServiceProvider.cs
- MergePropertyDescriptor.cs
- TablePattern.cs
- FixedTextContainer.cs
- ExpressionBindingCollection.cs
- HTMLTextWriter.cs
- XNodeNavigator.cs
- ControlValuePropertyAttribute.cs
- X509ScopedServiceCertificateElement.cs
- AssemblyResourceLoader.cs
- WebProxyScriptElement.cs
- SqlConnectionManager.cs
- PenThreadWorker.cs
- _SpnDictionary.cs
- CompilerParameters.cs
- CodeCommentStatementCollection.cs
- TouchFrameEventArgs.cs
- ScriptServiceAttribute.cs
- ExpressionBindingCollection.cs
- IProvider.cs
- TemplateApplicationHelper.cs
- XslAst.cs
- KerberosSecurityTokenParameters.cs
- Executor.cs
- DataServiceBehavior.cs
- XmlBaseReader.cs
- HtmlMeta.cs
- Bezier.cs
- _NetworkingPerfCounters.cs
- SamlAssertion.cs
- AttributeSetAction.cs
- IncrementalReadDecoders.cs
- InkCanvasInnerCanvas.cs
- JsonFormatReaderGenerator.cs
- ColumnTypeConverter.cs
- MethodImplAttribute.cs
- SortFieldComparer.cs
- ModuleBuilderData.cs
- DesignerFrame.cs
- DebugInfoExpression.cs
- ComponentResourceKey.cs
- httpstaticobjectscollection.cs
- storepermission.cs
- ComponentCollection.cs
- OdbcTransaction.cs
- WebZone.cs
- DecimalConverter.cs
- sqlinternaltransaction.cs
- Terminate.cs
- coordinatorfactory.cs
- ShaperBuffers.cs
- GeometryGroup.cs
- WebEventTraceProvider.cs
- StreamAsIStream.cs
- Utils.cs
- QuaternionKeyFrameCollection.cs
- GPRECTF.cs
- ObjectDataSourceStatusEventArgs.cs
- CharacterHit.cs
- CalendarDesigner.cs
- EntityDataSourceWrapper.cs
- DesignerRegionMouseEventArgs.cs
- EmbeddedObject.cs
- ChildrenQuery.cs
- SpotLight.cs
- SafeSecurityHandles.cs
- CatalogPartChrome.cs
- TextTreeNode.cs
- XmlTextWriter.cs
- HttpsChannelListener.cs
- GroupQuery.cs
- XPathArrayIterator.cs
- PropertyTab.cs
- CodeBinaryOperatorExpression.cs
- TextProperties.cs
- MemberInfoSerializationHolder.cs
- TextBoxRenderer.cs
- RedBlackList.cs
- XmlSerializer.cs
- SqlBulkCopy.cs
- MetadataPropertyvalue.cs
- ObjectDataSourceEventArgs.cs
- OpCodes.cs
- DependencyPropertyAttribute.cs
- Rectangle.cs
- CodeEventReferenceExpression.cs
- InstanceCollisionException.cs
- AccessDataSource.cs
- DiagnosticsConfiguration.cs
- ReadWriteObjectLock.cs
- _SpnDictionary.cs
- BuildProviderUtils.cs
- KeyGestureConverter.cs
- XmlHelper.cs