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
- SerializationTrace.cs
- InputLangChangeRequestEvent.cs
- HttpCacheVaryByContentEncodings.cs
- CollectionBuilder.cs
- RelationHandler.cs
- ExpressionNormalizer.cs
- XmlSchemaGroup.cs
- TraceData.cs
- RenderDataDrawingContext.cs
- BasicViewGenerator.cs
- CaretElement.cs
- BrowserTree.cs
- ContentOperations.cs
- ImageClickEventArgs.cs
- SqlProviderServices.cs
- Point3DAnimationBase.cs
- BmpBitmapEncoder.cs
- Pen.cs
- WindowsStartMenu.cs
- CfgArc.cs
- Trace.cs
- RayMeshGeometry3DHitTestResult.cs
- Context.cs
- TemplateContainer.cs
- XmlLangPropertyAttribute.cs
- PropertyChangeTracker.cs
- DataBindingHandlerAttribute.cs
- DbParameterCollection.cs
- RadioButtonList.cs
- RpcCryptoContext.cs
- GetCryptoTransformRequest.cs
- InstancePersistenceCommand.cs
- SynchronizedPool.cs
- Decoder.cs
- XsltLibrary.cs
- GridViewDeletedEventArgs.cs
- UIElementAutomationPeer.cs
- PipelineModuleStepContainer.cs
- VectorAnimationUsingKeyFrames.cs
- TextElement.cs
- PositiveTimeSpanValidatorAttribute.cs
- RoleProviderPrincipal.cs
- IItemProperties.cs
- XmlValueConverter.cs
- StorageAssociationTypeMapping.cs
- EncryptedXml.cs
- CompositeActivityMarkupSerializer.cs
- wgx_exports.cs
- StringDictionaryEditor.cs
- StatusBarPanelClickEvent.cs
- FlowDocument.cs
- rsa.cs
- MultiViewDesigner.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- PathFigureCollection.cs
- RightsManagementInformation.cs
- QueryPageSettingsEventArgs.cs
- XNameTypeConverter.cs
- XmlSerializationReader.cs
- ClientSettingsProvider.cs
- ZipIOCentralDirectoryBlock.cs
- IDQuery.cs
- DynamicPropertyHolder.cs
- TextServicesCompartment.cs
- SrgsElementFactoryCompiler.cs
- XmlHierarchicalDataSourceView.cs
- WmlLiteralTextAdapter.cs
- SafeHandles.cs
- UniqueIdentifierService.cs
- DataGridViewCellConverter.cs
- PrinterResolution.cs
- RtfNavigator.cs
- DataGridViewSortCompareEventArgs.cs
- Translator.cs
- Policy.cs
- KeyboardDevice.cs
- XamlContextStack.cs
- ResourceDefaultValueAttribute.cs
- TerminateSequence.cs
- WebPartConnectionsEventArgs.cs
- Profiler.cs
- SslStream.cs
- PresentationSource.cs
- ApplicationSecurityInfo.cs
- StorageTypeMapping.cs
- SynchronizationLockException.cs
- TableLayoutSettingsTypeConverter.cs
- XPathSingletonIterator.cs
- OleDbParameterCollection.cs
- SqlCommand.cs
- ErrorLog.cs
- VirtualDirectoryMappingCollection.cs
- AttributeUsageAttribute.cs
- OdbcException.cs
- SecurityRequiresReviewAttribute.cs
- DataTableExtensions.cs
- GeneralTransform3DGroup.cs
- TrackingServices.cs
- ViewGenResults.cs
- BatchServiceHost.cs