Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- Sequence.cs
- XhtmlBasicTextViewAdapter.cs
- Paragraph.cs
- InputScope.cs
- SetUserPreferenceRequest.cs
- metadatamappinghashervisitor.cs
- FamilyTypeface.cs
- FixedSchema.cs
- Range.cs
- ProjectionPlanCompiler.cs
- XmlSchemaComplexContentRestriction.cs
- XmlWriterSettings.cs
- HtmlSelect.cs
- AdjustableArrowCap.cs
- DataGridState.cs
- ProgressBar.cs
- LicenseManager.cs
- HttpStaticObjectsCollectionBase.cs
- ProgressBarRenderer.cs
- DescendantBaseQuery.cs
- TextDpi.cs
- FaultConverter.cs
- HeaderedItemsControl.cs
- BasicExpandProvider.cs
- TypeLoadException.cs
- MessageQueuePermissionEntry.cs
- WebPartUserCapability.cs
- figurelengthconverter.cs
- MimeTypeMapper.cs
- AttributeUsageAttribute.cs
- ObjectParameterCollection.cs
- datacache.cs
- AuthenticationConfig.cs
- DataGridCellsPresenter.cs
- ContextActivityUtils.cs
- StdRegProviderWrapper.cs
- SmtpFailedRecipientsException.cs
- RadioButtonFlatAdapter.cs
- TokenBasedSetEnumerator.cs
- ToolStripRenderer.cs
- AuthenticationModuleElementCollection.cs
- NotFiniteNumberException.cs
- DesignerResources.cs
- DesignTimeTemplateParser.cs
- DbConnectionInternal.cs
- PropertyTab.cs
- GenericIdentity.cs
- DictionaryTraceRecord.cs
- SQlBooleanStorage.cs
- PathSegment.cs
- AstNode.cs
- objectresult_tresulttype.cs
- TypeUtils.cs
- AnnotationAdorner.cs
- safesecurityhelperavalon.cs
- XamlStyleSerializer.cs
- ListBoxAutomationPeer.cs
- Size3DConverter.cs
- SecurityUniqueId.cs
- DbConnectionPoolGroup.cs
- EncodingTable.cs
- KeyMatchBuilder.cs
- MultiPageTextView.cs
- Restrictions.cs
- SessionParameter.cs
- AssemblyResolver.cs
- TreeIterator.cs
- LambdaCompiler.Statements.cs
- SqlInternalConnectionSmi.cs
- updateconfighost.cs
- DiagnosticSection.cs
- LinqDataSourceContextData.cs
- CodeNamespaceCollection.cs
- TextCollapsingProperties.cs
- EventArgs.cs
- ToolStripItemTextRenderEventArgs.cs
- IPAddressCollection.cs
- StyleSelector.cs
- Form.cs
- GridItemProviderWrapper.cs
- RTTrackingProfile.cs
- ResXResourceReader.cs
- streamingZipPartStream.cs
- CharacterMetrics.cs
- ProbeDuplexAsyncResult.cs
- String.cs
- CodeGotoStatement.cs
- AnimationLayer.cs
- XPathNodeIterator.cs
- HandleValueEditor.cs
- SplitterCancelEvent.cs
- MimeFormatExtensions.cs
- IsolatedStorageException.cs
- CachedPathData.cs
- TextTreeTextElementNode.cs
- ScrollChrome.cs
- ContractDescription.cs
- DivideByZeroException.cs
- FormViewUpdatedEventArgs.cs
- CreateUserWizardStep.cs