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
- ThousandthOfEmRealDoubles.cs
- XmlSchemaCompilationSettings.cs
- oledbconnectionstring.cs
- SafeCoTaskMem.cs
- ContentValidator.cs
- XComponentModel.cs
- ClientBuildManager.cs
- StateDesignerConnector.cs
- BitmapCodecInfoInternal.cs
- WebGetAttribute.cs
- XamlToRtfWriter.cs
- SqlReferenceCollection.cs
- cache.cs
- GroupItemAutomationPeer.cs
- HwndSource.cs
- OdbcErrorCollection.cs
- ListDataBindEventArgs.cs
- InternalBufferOverflowException.cs
- FixedPageStructure.cs
- LiteralControl.cs
- XmlSerializationReader.cs
- DataRowCollection.cs
- Tool.cs
- PaintValueEventArgs.cs
- PeerApplication.cs
- HttpRuntime.cs
- XmlDataSourceNodeDescriptor.cs
- ProviderConnectionPointCollection.cs
- SHA1Cng.cs
- DirectoryObjectSecurity.cs
- PointLight.cs
- ObjectQuery.cs
- Membership.cs
- DirtyTextRange.cs
- NamedPermissionSet.cs
- ExpandableObjectConverter.cs
- TemplateControlCodeDomTreeGenerator.cs
- Set.cs
- MachineKeyConverter.cs
- ApplicationException.cs
- Adorner.cs
- RemotingConfigParser.cs
- ExecutionContext.cs
- SecurityTokenTypes.cs
- AddInContractAttribute.cs
- MimeObjectFactory.cs
- LeafCellTreeNode.cs
- SoapIncludeAttribute.cs
- RegularExpressionValidator.cs
- ResourceSet.cs
- EntityWrapperFactory.cs
- CustomPopupPlacement.cs
- MultipleViewPattern.cs
- CompilerCollection.cs
- ToolStripItemDataObject.cs
- InternalReceiveMessage.cs
- SqlClientPermission.cs
- DataBoundControl.cs
- SharedUtils.cs
- MembershipSection.cs
- TableLayoutRowStyleCollection.cs
- DesignerActionGlyph.cs
- HierarchicalDataSourceConverter.cs
- SplitterPanel.cs
- MeshGeometry3D.cs
- WebControlsSection.cs
- DataGridViewButtonColumn.cs
- sqlser.cs
- DetailsViewRowCollection.cs
- DispatcherEventArgs.cs
- LinkArea.cs
- Utility.cs
- Configuration.cs
- WindowsAuthenticationEventArgs.cs
- SectionInformation.cs
- BypassElementCollection.cs
- ResourceDescriptionAttribute.cs
- XmlDataSource.cs
- ScriptManager.cs
- TransformDescriptor.cs
- PeerNameResolver.cs
- CompilerWrapper.cs
- DocumentsTrace.cs
- CodeArgumentReferenceExpression.cs
- _LazyAsyncResult.cs
- PageStatePersister.cs
- TransformedBitmap.cs
- DataGridViewTextBoxEditingControl.cs
- ApplicationSecurityManager.cs
- MetadataCacheItem.cs
- ProfileEventArgs.cs
- LiteralSubsegment.cs
- UnorderedHashRepartitionStream.cs
- OSEnvironmentHelper.cs
- VScrollProperties.cs
- SmiEventSink.cs
- DesignerForm.cs
- CodeTypeConstructor.cs
- GridItemPatternIdentifiers.cs
- ObjectItemCollectionAssemblyCacheEntry.cs