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
- CustomActivityDesigner.cs
- WebBrowserNavigatedEventHandler.cs
- BitmapEffectGeneralTransform.cs
- OleServicesContext.cs
- DataGridViewColumn.cs
- AsymmetricSignatureDeformatter.cs
- RadioButtonList.cs
- CallSiteOps.cs
- TypeReference.cs
- TextServicesProperty.cs
- SqlCacheDependency.cs
- DesignerFrame.cs
- AdRotator.cs
- SamlAuthorizationDecisionClaimResource.cs
- GlobalizationSection.cs
- HttpRawResponse.cs
- ObjectConverter.cs
- SqlConnectionStringBuilder.cs
- HMACSHA256.cs
- ObjectQuery_EntitySqlExtensions.cs
- WeakEventTable.cs
- OdbcUtils.cs
- LexicalChunk.cs
- WizardForm.cs
- StylusDownEventArgs.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- TransformCollection.cs
- OleDbParameter.cs
- TreeNodeCollection.cs
- EntityCommandExecutionException.cs
- WindowsScrollBarBits.cs
- HttpModuleActionCollection.cs
- MultiBindingExpression.cs
- SynchronizedPool.cs
- WebPartZoneCollection.cs
- TextBoxBaseDesigner.cs
- EventLevel.cs
- TextFormatterHost.cs
- ExitEventArgs.cs
- FormatterServices.cs
- GradientBrush.cs
- EventToken.cs
- NamedPipeHostedTransportConfiguration.cs
- Content.cs
- GeometryConverter.cs
- TypeName.cs
- PathData.cs
- Animatable.cs
- Odbc32.cs
- XmlMtomWriter.cs
- SoapHeader.cs
- NativeConfigurationLoader.cs
- FormViewPageEventArgs.cs
- PackageStore.cs
- DataGridCommandEventArgs.cs
- DesignerAutoFormatStyle.cs
- WebPartMenuStyle.cs
- InterleavedZipPartStream.cs
- DataGridPreparingCellForEditEventArgs.cs
- Pkcs9Attribute.cs
- StrongName.cs
- securitycriticaldataClass.cs
- BinaryQueryOperator.cs
- HighContrastHelper.cs
- LongMinMaxAggregationOperator.cs
- EpmAttributeNameBuilder.cs
- MimeParameters.cs
- CodeDomDesignerLoader.cs
- TextEndOfParagraph.cs
- NativeCppClassAttribute.cs
- ActionFrame.cs
- DataSysAttribute.cs
- DotNetATv1WindowsLogEntryDeserializer.cs
- XmlValidatingReader.cs
- PropertyDescriptorGridEntry.cs
- OLEDB_Enum.cs
- XmlAttributeHolder.cs
- TextTreeUndo.cs
- LogicalExpr.cs
- ObjectDesignerDataSourceView.cs
- XmlUnspecifiedAttribute.cs
- SchemaElement.cs
- FlowDocument.cs
- InfiniteTimeSpanConverter.cs
- MonthCalendar.cs
- DataObjectEventArgs.cs
- PropertyIDSet.cs
- GridViewRowCollection.cs
- AutoFocusStyle.xaml.cs
- ExportOptions.cs
- _ConnectionGroup.cs
- ItemAutomationPeer.cs
- TreeNode.cs
- Rotation3DAnimationBase.cs
- EditorPartCollection.cs
- MetadataArtifactLoaderFile.cs
- ValueUnavailableException.cs
- RequestNavigateEventArgs.cs
- ListViewInsertedEventArgs.cs
- FilteredXmlReader.cs