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
- XmlCountingReader.cs
- SimpleColumnProvider.cs
- StrokeNodeOperations.cs
- SystemNetworkInterface.cs
- PriorityItem.cs
- SourceSwitch.cs
- CompositeDataBoundControl.cs
- Environment.cs
- FormatterConverter.cs
- NestedContainer.cs
- ContourSegment.cs
- ChtmlPhoneCallAdapter.cs
- ExpressionList.cs
- FromRequest.cs
- DataServiceStreamResponse.cs
- AdCreatedEventArgs.cs
- CharKeyFrameCollection.cs
- Matrix3D.cs
- QueryContinueDragEventArgs.cs
- MethodBody.cs
- XmlSchemaElement.cs
- HttpContext.cs
- BaseTemplateBuildProvider.cs
- WebPartVerbsEventArgs.cs
- ApplicationSecurityManager.cs
- AssemblySettingAttributes.cs
- SystemBrushes.cs
- WebPartUserCapability.cs
- SchemaImporterExtensionElementCollection.cs
- TemplateField.cs
- Translator.cs
- SchemaTableOptionalColumn.cs
- NestPullup.cs
- SqlParameterizer.cs
- PersonalizationAdministration.cs
- GridToolTip.cs
- MenuCommand.cs
- PhonemeConverter.cs
- WebControlAdapter.cs
- TextSelectionHighlightLayer.cs
- DetailsView.cs
- Authorization.cs
- ContractTypeNameElement.cs
- CompositeCollectionView.cs
- Italic.cs
- SignedXml.cs
- ToolStripRenderer.cs
- BypassElement.cs
- OverrideMode.cs
- DataControlCommands.cs
- BaseParagraph.cs
- ComponentChangedEvent.cs
- TagMapCollection.cs
- CompatibleIComparer.cs
- UidPropertyAttribute.cs
- LogRecordSequence.cs
- FormViewDeletedEventArgs.cs
- UnsafeNativeMethodsPenimc.cs
- WsdlImporter.cs
- OdbcRowUpdatingEvent.cs
- ViewCellRelation.cs
- NavigationService.cs
- ResXResourceReader.cs
- Int32AnimationUsingKeyFrames.cs
- FlowPosition.cs
- OleDbCommand.cs
- CoTaskMemHandle.cs
- IdleTimeoutMonitor.cs
- Collection.cs
- PropertyTabChangedEvent.cs
- WebServiceFault.cs
- EnumConverter.cs
- SupportingTokenSpecification.cs
- ClassicBorderDecorator.cs
- RemotingServices.cs
- PersistStreamTypeWrapper.cs
- HtmlTernaryTree.cs
- PopupEventArgs.cs
- FileUtil.cs
- QueryCursorEventArgs.cs
- HyperLinkColumn.cs
- IPHostEntry.cs
- ObjectNotFoundException.cs
- DataGridItemAttachedStorage.cs
- RepeatButton.cs
- GeneralTransform3DCollection.cs
- QilTargetType.cs
- SplayTreeNode.cs
- StateItem.cs
- BaseTypeViewSchema.cs
- AssociatedControlConverter.cs
- IList.cs
- IndexedGlyphRun.cs
- XamlParser.cs
- TcpHostedTransportConfiguration.cs
- BuildManager.cs
- AttributedMetaModel.cs
- TextBox.cs
- RoleManagerModule.cs
- ConnectionProviderAttribute.cs