Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / XmlUtils / System / Xml / Xsl / Runtime / EarlyBoundInfo.cs / 5 / 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
- ISAPIRuntime.cs
- TrackingProfileSerializer.cs
- AssemblyContextControlItem.cs
- PeerFlooder.cs
- AttachedAnnotation.cs
- LogLogRecord.cs
- XPathNodeHelper.cs
- FieldBuilder.cs
- X509ChainPolicy.cs
- ToolStripDropDownButton.cs
- FileUtil.cs
- ProxyHwnd.cs
- ValidationSummary.cs
- DataBinder.cs
- AvTrace.cs
- CaseExpr.cs
- DesignerHierarchicalDataSourceView.cs
- IPHostEntry.cs
- TrustManagerPromptUI.cs
- DataKeyArray.cs
- FormClosingEvent.cs
- CategoryAttribute.cs
- BatchParser.cs
- SqlDataReaderSmi.cs
- HttpCacheParams.cs
- GeneratedCodeAttribute.cs
- SafeTimerHandle.cs
- ItemType.cs
- IconBitmapDecoder.cs
- GridViewUpdateEventArgs.cs
- DataGridViewImageCell.cs
- FusionWrap.cs
- CancelRequestedQuery.cs
- XmlTextReaderImpl.cs
- XmlSchemaSimpleTypeList.cs
- AxisAngleRotation3D.cs
- NotifyIcon.cs
- TextOutput.cs
- FileUtil.cs
- Helpers.cs
- ContentType.cs
- MediaContext.cs
- DiscoveryReferences.cs
- Clipboard.cs
- WorkflowInstanceExtensionCollection.cs
- Convert.cs
- AttributeCollection.cs
- InputElement.cs
- MultipleViewProviderWrapper.cs
- newinstructionaction.cs
- ImageSourceConverter.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- querybuilder.cs
- ContentPlaceHolder.cs
- ModelServiceImpl.cs
- ReachFixedDocumentSerializer.cs
- XmlSchemaExternal.cs
- PaperSize.cs
- SHA1.cs
- AppearanceEditorPart.cs
- DockAndAnchorLayout.cs
- followingsibling.cs
- RijndaelManagedTransform.cs
- TdsValueSetter.cs
- FragmentQueryKB.cs
- XPathAxisIterator.cs
- FontStretch.cs
- Transform.cs
- OleDbFactory.cs
- TypedTableGenerator.cs
- DecimalAnimationBase.cs
- StorageTypeMapping.cs
- OracleConnectionString.cs
- CuspData.cs
- WpfWebRequestHelper.cs
- Int32Storage.cs
- regiisutil.cs
- BrowserCapabilitiesFactory.cs
- DSASignatureDeformatter.cs
- jithelpers.cs
- AstNode.cs
- InputProcessorProfilesLoader.cs
- ThicknessKeyFrameCollection.cs
- XmlDownloadManager.cs
- CustomWebEventKey.cs
- JournalEntryListConverter.cs
- BackgroundWorker.cs
- CalendarData.cs
- Pointer.cs
- WorkflowTimerService.cs
- XmlSiteMapProvider.cs
- WorkflowDefinitionContext.cs
- WebSysDisplayNameAttribute.cs
- XhtmlConformanceSection.cs
- LambdaCompiler.Address.cs
- PathGeometry.cs
- WizardPanelChangingEventArgs.cs
- PersonalizableAttribute.cs
- IsolatedStoragePermission.cs
- TabPage.cs