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
- Parameter.cs
- WriteableBitmap.cs
- _LazyAsyncResult.cs
- DefaultValueTypeConverter.cs
- TextDecorationCollection.cs
- DataSourceControl.cs
- MenuItemCollectionEditor.cs
- SystemSounds.cs
- SetStateEventArgs.cs
- DataGridViewComboBoxEditingControl.cs
- DataPagerCommandEventArgs.cs
- GenericTextProperties.cs
- Array.cs
- StreamGeometryContext.cs
- _BasicClient.cs
- DiscoveryClientElement.cs
- Control.cs
- TransformationRules.cs
- DataGridViewColumnHeaderCell.cs
- SqlFacetAttribute.cs
- HeaderCollection.cs
- ZoneIdentityPermission.cs
- SchemaMapping.cs
- SelectionManager.cs
- EditorPart.cs
- FunctionImportMapping.cs
- GrabHandleGlyph.cs
- Tool.cs
- UriExt.cs
- cookie.cs
- ParameterElement.cs
- DynamicScriptObject.cs
- DiscoveryEndpointElement.cs
- TreeWalkHelper.cs
- OutputScopeManager.cs
- LineServices.cs
- GridSplitterAutomationPeer.cs
- FormViewCommandEventArgs.cs
- Verify.cs
- BooleanProjectedSlot.cs
- WebPartEditorApplyVerb.cs
- ThicknessConverter.cs
- WinFormsComponentEditor.cs
- RenderData.cs
- ItemsControlAutomationPeer.cs
- PersonalizationStateQuery.cs
- InitializingNewItemEventArgs.cs
- TextTrailingCharacterEllipsis.cs
- WinFormsUtils.cs
- XPathArrayIterator.cs
- Span.cs
- QualifiedCellIdBoolean.cs
- SourceSwitch.cs
- RowParagraph.cs
- TextBoxView.cs
- RuntimeResourceSet.cs
- PropertyTabChangedEvent.cs
- RemoteTokenFactory.cs
- assemblycache.cs
- AuthenticationModulesSection.cs
- XD.cs
- ValuePatternIdentifiers.cs
- odbcmetadatacollectionnames.cs
- FacetChecker.cs
- CreateUserErrorEventArgs.cs
- DbConvert.cs
- KeyNotFoundException.cs
- HtmlListAdapter.cs
- SecurityTokenResolver.cs
- SplitContainer.cs
- FlowDocumentView.cs
- Cloud.cs
- PackageStore.cs
- ToolBarPanel.cs
- SqlXml.cs
- HttpListenerPrefixCollection.cs
- WebPageTraceListener.cs
- DataGridItem.cs
- ParameterBinding.cs
- RuleEngine.cs
- XmlQueryRuntime.cs
- RuntimeResourceSet.cs
- WebPartTracker.cs
- EntityTypeBase.cs
- BulletedList.cs
- ComponentChangedEvent.cs
- DataGridBoolColumn.cs
- Pointer.cs
- SelectionChangedEventArgs.cs
- recordstatefactory.cs
- RsaSecurityTokenAuthenticator.cs
- Geometry3D.cs
- SimpleMailWebEventProvider.cs
- WindowPattern.cs
- ToolStripSeparator.cs
- XmlSchemaExporter.cs
- ObjectViewQueryResultData.cs
- HideDisabledControlAdapter.cs
- RowParagraph.cs
- UInt16.cs