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
- VirtualPathProvider.cs
- Style.cs
- CodeTryCatchFinallyStatement.cs
- WsdlInspector.cs
- SimpleApplicationHost.cs
- SmiRequestExecutor.cs
- LinkedList.cs
- RuntimeCompatibilityAttribute.cs
- UseAttributeSetsAction.cs
- FontStyle.cs
- CriticalFinalizerObject.cs
- DecimalAverageAggregationOperator.cs
- PtsContext.cs
- ProtocolsSection.cs
- SimpleTableProvider.cs
- ColumnResult.cs
- Hyperlink.cs
- safex509handles.cs
- CopyAction.cs
- Mutex.cs
- ActivityExecutorDelegateInfo.cs
- ConfigurationManagerHelper.cs
- SpellerInterop.cs
- TaiwanCalendar.cs
- RuleConditionDialog.cs
- LocationUpdates.cs
- SafeSecurityHandles.cs
- Error.cs
- AbandonedMutexException.cs
- ActivityPropertyReference.cs
- HttpProfileBase.cs
- ReadOnlyObservableCollection.cs
- ScriptingSectionGroup.cs
- XmlSchemaProviderAttribute.cs
- DBSqlParserColumn.cs
- ListViewGroupItemCollection.cs
- RestHandler.cs
- DataGridViewComboBoxEditingControl.cs
- NavigationService.cs
- GroupBoxRenderer.cs
- StringComparer.cs
- Variant.cs
- TaskExtensions.cs
- GroupQuery.cs
- DesignerTextWriter.cs
- DataGridColumnHeader.cs
- WebBrowser.cs
- TypeLoadException.cs
- SizeKeyFrameCollection.cs
- HTMLTextWriter.cs
- Mapping.cs
- CodeTypeDeclaration.cs
- FramingFormat.cs
- ExpressionBindings.cs
- JsonWriter.cs
- Decorator.cs
- IdlingCommunicationPool.cs
- CellIdBoolean.cs
- RightsManagementEncryptedStream.cs
- RangeValuePatternIdentifiers.cs
- ClientSponsor.cs
- StateChangeEvent.cs
- SwitchLevelAttribute.cs
- TabControlEvent.cs
- PostBackOptions.cs
- AsymmetricSignatureFormatter.cs
- SqlConnectionString.cs
- SecurityChannel.cs
- SimpleExpression.cs
- ShapeTypeface.cs
- DataGridViewRowCollection.cs
- ClientScriptManagerWrapper.cs
- DesignTimeData.cs
- Overlapped.cs
- ControlAdapter.cs
- ArgumentNullException.cs
- TimeoutValidationAttribute.cs
- UnsafePeerToPeerMethods.cs
- HMACSHA384.cs
- TimerTable.cs
- RegexCompiler.cs
- XmlHierarchicalEnumerable.cs
- Baml2006Reader.cs
- IERequestCache.cs
- WebPartUtil.cs
- SpellerHighlightLayer.cs
- TextBoxBase.cs
- ProcessInfo.cs
- TrustSection.cs
- PreviewPrintController.cs
- ToolStripContentPanelRenderEventArgs.cs
- Validator.cs
- ModelTreeManager.cs
- CustomAttributeSerializer.cs
- HMACSHA256.cs
- DesignTimeType.cs
- BitmapMetadataEnumerator.cs
- DrawingCollection.cs
- CodeSnippetTypeMember.cs