Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / Runtime / EarlyBoundInfo.cs / 1305376 / 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
- EncryptedKeyIdentifierClause.cs
- VerifyHashRequest.cs
- TreeViewImageKeyConverter.cs
- ValidationSettings.cs
- PreviewKeyDownEventArgs.cs
- VisualCollection.cs
- WebConfigurationHost.cs
- PasswordBoxAutomationPeer.cs
- PenCursorManager.cs
- EntityDataSourceSelectedEventArgs.cs
- DropSource.cs
- DrawingGroup.cs
- MenuRenderer.cs
- XmlnsCache.cs
- ExpressionCopier.cs
- CompilationLock.cs
- PointHitTestParameters.cs
- DaylightTime.cs
- HwndStylusInputProvider.cs
- WebPartMinimizeVerb.cs
- TcpConnectionPoolSettingsElement.cs
- util.cs
- complextypematerializer.cs
- SettingsPropertyCollection.cs
- TransactionScopeDesigner.cs
- RtfToken.cs
- COM2ExtendedBrowsingHandler.cs
- X509UI.cs
- WebPartHelpVerb.cs
- DataTableCollection.cs
- SelectionEditor.cs
- ApplicationActivator.cs
- TransformGroup.cs
- SelectionWordBreaker.cs
- VisualTransition.cs
- GeneralTransform.cs
- MouseWheelEventArgs.cs
- DataSourceCache.cs
- CodeParameterDeclarationExpressionCollection.cs
- BooleanAnimationUsingKeyFrames.cs
- LoadRetryHandler.cs
- PeerName.cs
- DesignerLoader.cs
- OpenFileDialog.cs
- TextElementEditingBehaviorAttribute.cs
- Parameter.cs
- BamlLocalizableResource.cs
- JpegBitmapDecoder.cs
- DaylightTime.cs
- ToolboxComponentsCreatingEventArgs.cs
- DataControlCommands.cs
- RegexMatchCollection.cs
- Menu.cs
- CodeBlockBuilder.cs
- WsrmTraceRecord.cs
- CodeCommentStatementCollection.cs
- XmlDataProvider.cs
- EntityDataSource.cs
- XmlSchemaProviderAttribute.cs
- storepermissionattribute.cs
- MemoryStream.cs
- MenuItemStyle.cs
- CellParagraph.cs
- ZipIOExtraFieldPaddingElement.cs
- ProcessInfo.cs
- TextEditorMouse.cs
- SiteMapDataSourceView.cs
- smtppermission.cs
- MenuScrollingVisibilityConverter.cs
- EntityContainer.cs
- ToolStripItemImageRenderEventArgs.cs
- BaseCollection.cs
- CompositeFontParser.cs
- PathFigure.cs
- SemaphoreFullException.cs
- RegexParser.cs
- SecurityElement.cs
- EdmItemCollection.cs
- ToolStripItemGlyph.cs
- OleDbCommandBuilder.cs
- FormsAuthenticationTicket.cs
- XmlToDatasetMap.cs
- ShaderRenderModeValidation.cs
- CodeSnippetExpression.cs
- ImageMap.cs
- ProcessModule.cs
- PropertyEmitterBase.cs
- AccessViolationException.cs
- HwndKeyboardInputProvider.cs
- MasterPageBuildProvider.cs
- CommentAction.cs
- StylusPointDescription.cs
- Token.cs
- MouseBinding.cs
- ChannelBinding.cs
- WebPartManager.cs
- Assembly.cs
- XmlUrlResolver.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- PaintValueEventArgs.cs