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
- arc.cs
- SmtpAuthenticationManager.cs
- ItemMap.cs
- GroupBoxRenderer.cs
- SoapAttributeOverrides.cs
- ListChangedEventArgs.cs
- ContainerUtilities.cs
- InvalidOperationException.cs
- Pkcs7Signer.cs
- ActionItem.cs
- XmlAtomicValue.cs
- Latin1Encoding.cs
- NativeMethods.cs
- GenericAuthenticationEventArgs.cs
- DataConnectionHelper.cs
- SubpageParaClient.cs
- ClientApiGenerator.cs
- AudioDeviceOut.cs
- PlaceHolder.cs
- ScriptingSectionGroup.cs
- IgnorePropertiesAttribute.cs
- CornerRadiusConverter.cs
- XmlBoundElement.cs
- IconConverter.cs
- EventManager.cs
- StreamUpdate.cs
- TagPrefixCollection.cs
- Brush.cs
- SoapIncludeAttribute.cs
- MulticastNotSupportedException.cs
- BindingExpression.cs
- RightsManagementInformation.cs
- XNameConverter.cs
- TextContainerHelper.cs
- StartUpEventArgs.cs
- Brush.cs
- NameTable.cs
- _NestedSingleAsyncResult.cs
- FusionWrap.cs
- ConsoleTraceListener.cs
- SchemaImporterExtensionElement.cs
- ControlType.cs
- TypeInfo.cs
- ToolStripItemImageRenderEventArgs.cs
- Visual3DCollection.cs
- SessionStateContainer.cs
- WebPartTransformerCollection.cs
- ConfigPathUtility.cs
- DesignerWebPartChrome.cs
- RegexMatchCollection.cs
- NumberAction.cs
- EllipticalNodeOperations.cs
- NumberFunctions.cs
- DummyDataSource.cs
- IgnoreSection.cs
- Compiler.cs
- ElementsClipboardData.cs
- DrawingGroup.cs
- DataDocumentXPathNavigator.cs
- StylusSystemGestureEventArgs.cs
- WindowsGraphics2.cs
- NameValueCollection.cs
- RuntimeConfigurationRecord.cs
- ReturnEventArgs.cs
- counter.cs
- EntitySet.cs
- BitmapEffectDrawingContextState.cs
- BindingEntityInfo.cs
- ToolBarButton.cs
- ConstraintCollection.cs
- RC2.cs
- XmlCharacterData.cs
- HttpWriter.cs
- ErrorWebPart.cs
- SvcMapFileSerializer.cs
- WindowsScrollBarBits.cs
- UpDownBaseDesigner.cs
- MouseBinding.cs
- RotateTransform.cs
- ObjectDesignerDataSourceView.cs
- DetailsViewUpdateEventArgs.cs
- FixedHyperLink.cs
- EditCommandColumn.cs
- BitArray.cs
- CodeArgumentReferenceExpression.cs
- AttachedAnnotation.cs
- ManagedWndProcTracker.cs
- SqlDesignerDataSourceView.cs
- SQLSingle.cs
- xmlglyphRunInfo.cs
- Style.cs
- PenLineCapValidation.cs
- Types.cs
- UnitControl.cs
- webbrowsersite.cs
- EnumUnknown.cs
- _NestedSingleAsyncResult.cs
- Token.cs
- ApplicationCommands.cs
- PathTooLongException.cs