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
- SqlWebEventProvider.cs
- ListBindingHelper.cs
- UInt64Converter.cs
- DynamicValueConverter.cs
- EmbeddedMailObject.cs
- Overlapped.cs
- CaseStatement.cs
- OracleCommandBuilder.cs
- InstallerTypeAttribute.cs
- SqlFacetAttribute.cs
- XPathDocument.cs
- DependencyObjectType.cs
- SecurityHeaderElementInferenceEngine.cs
- CustomPopupPlacement.cs
- StickyNoteHelper.cs
- AvtEvent.cs
- Monitor.cs
- TabControlEvent.cs
- ThousandthOfEmRealPoints.cs
- QueueProcessor.cs
- MatrixConverter.cs
- HttpModuleAction.cs
- EventDescriptor.cs
- ServiceActivationException.cs
- InstanceNotFoundException.cs
- SeparatorAutomationPeer.cs
- TextContainerChangedEventArgs.cs
- RelationshipWrapper.cs
- xml.cs
- XPathExpr.cs
- SecureUICommand.cs
- SafeLocalMemHandle.cs
- RequestUriProcessor.cs
- AdPostCacheSubstitution.cs
- CustomError.cs
- LexicalChunk.cs
- OutputCacheSettings.cs
- FilteredXmlReader.cs
- UnsafeNativeMethods.cs
- TextEditorTyping.cs
- SchemaElementDecl.cs
- PageAsyncTask.cs
- ShellProvider.cs
- InfoCardXmlSerializer.cs
- BookmarkOptionsHelper.cs
- PageCodeDomTreeGenerator.cs
- EdmMember.cs
- CultureMapper.cs
- CompilationRelaxations.cs
- SqlAggregateChecker.cs
- CustomErrorCollection.cs
- VersionValidator.cs
- ToolBarButtonDesigner.cs
- WebPartManagerInternals.cs
- StateBag.cs
- AuthorizationContext.cs
- StateMachineDesignerPaint.cs
- MsmqHostedTransportConfiguration.cs
- ObjectMaterializedEventArgs.cs
- ModulesEntry.cs
- DbLambda.cs
- SqlUserDefinedTypeAttribute.cs
- ListItemCollection.cs
- ProvideValueServiceProvider.cs
- Model3D.cs
- WebControlsSection.cs
- IPGlobalProperties.cs
- PrimaryKeyTypeConverter.cs
- Decimal.cs
- ManagedWndProcTracker.cs
- HiddenFieldPageStatePersister.cs
- SpellerStatusTable.cs
- RoleManagerEventArgs.cs
- UpDownBase.cs
- StreamingContext.cs
- SignatureToken.cs
- XamlDesignerSerializationManager.cs
- DesignerLoader.cs
- NonParentingControl.cs
- ProvideValueServiceProvider.cs
- XamlFxTrace.cs
- XPathNavigatorException.cs
- IOThreadScheduler.cs
- RegistryKey.cs
- SqlComparer.cs
- MessageHeaderDescription.cs
- ALinqExpressionVisitor.cs
- MethodCallTranslator.cs
- StringUtil.cs
- ContainerAction.cs
- TabControlToolboxItem.cs
- SessionEndedEventArgs.cs
- EntityViewGenerationConstants.cs
- MenuAdapter.cs
- ViewStateException.cs
- UnhandledExceptionEventArgs.cs
- ReflectionPermission.cs
- CaseExpr.cs
- AvTraceDetails.cs
- FamilyCollection.cs