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
- EntityDataSourceView.cs
- ReferencedCollectionType.cs
- SemanticResolver.cs
- Evidence.cs
- ClientSettingsStore.cs
- RegexMatch.cs
- BindingGroup.cs
- TTSEngineTypes.cs
- DefaultClaimSet.cs
- GridItemPatternIdentifiers.cs
- DataViewSettingCollection.cs
- Set.cs
- ScalarType.cs
- SignedXmlDebugLog.cs
- ParseNumbers.cs
- TreeViewEvent.cs
- BeginStoryboard.cs
- TableCellCollection.cs
- OleDbConnectionInternal.cs
- CertificateManager.cs
- XmlConvert.cs
- CredentialCache.cs
- DoubleLink.cs
- WebServiceHandlerFactory.cs
- MemberBinding.cs
- HtmlUtf8RawTextWriter.cs
- SecurityTokenResolver.cs
- HtmlTableCell.cs
- HttpFileCollection.cs
- TabControl.cs
- GlyphManager.cs
- DocumentGridPage.cs
- ListBox.cs
- StructuralType.cs
- RadioButtonPopupAdapter.cs
- MediaContext.cs
- SchemaCollectionPreprocessor.cs
- StringValidator.cs
- ImageFormatConverter.cs
- ZipQueryOperator.cs
- X509RecipientCertificateServiceElement.cs
- SecurityElementBase.cs
- HtmlInputText.cs
- Trace.cs
- DbConvert.cs
- MsmqHostedTransportConfiguration.cs
- Dictionary.cs
- KeyGestureValueSerializer.cs
- IriParsingElement.cs
- AutomationTextAttribute.cs
- PropertyEntry.cs
- WebRequestModuleElement.cs
- TypeReference.cs
- SQLDecimalStorage.cs
- AssemblyEvidenceFactory.cs
- TagNameToTypeMapper.cs
- NotifyIcon.cs
- ExecutionEngineException.cs
- PerfService.cs
- ControlIdConverter.cs
- LostFocusEventManager.cs
- AutomationAttributeInfo.cs
- LinqDataSourceInsertEventArgs.cs
- WsatConfiguration.cs
- EntityTypeBase.cs
- SafeCloseHandleCritical.cs
- XamlSerializerUtil.cs
- LazyTextWriterCreator.cs
- UniqueConstraint.cs
- ZipIOLocalFileHeader.cs
- ConvertEvent.cs
- WindowsFormsEditorServiceHelper.cs
- ExcCanonicalXml.cs
- ProviderConnectionPoint.cs
- MessageCredentialType.cs
- DbgUtil.cs
- ObjectDataProvider.cs
- RTLAwareMessageBox.cs
- HtmlTableRowCollection.cs
- InspectionWorker.cs
- PrintControllerWithStatusDialog.cs
- TableDetailsCollection.cs
- UpnEndpointIdentity.cs
- Model3DCollection.cs
- TreeWalkHelper.cs
- DebugViewWriter.cs
- DateTimeFormat.cs
- BitmapImage.cs
- Reference.cs
- VScrollProperties.cs
- QilValidationVisitor.cs
- WinEventHandler.cs
- IsolatedStoragePermission.cs
- StrongTypingException.cs
- OdbcTransaction.cs
- ReflectionHelper.cs
- StatusBarPanelClickEvent.cs
- DeviceContext.cs
- FixedSOMTableRow.cs
- ArrayWithOffset.cs