Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Xml / System / Xml / schema / ChameleonKey.cs / 1 / ChameleonKey.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
//-----------------------------------------------------------------------------
namespace System.Xml.Schema {
using System.Collections;
using System.ComponentModel;
using System.Xml.Serialization;
// Case insensitive file name key for use in a hashtable.
internal class ChameleonKey {
internal string targetNS;
internal Uri chameleonLocation;
int hashCode;
public ChameleonKey(string ns, Uri location) {
targetNS = ns;
chameleonLocation = location;
}
public override int GetHashCode() {
if (hashCode == 0) {
hashCode = targetNS.GetHashCode() + chameleonLocation.GetHashCode();
}
return hashCode;
}
public override bool Equals(object obj) {
if (Ref.ReferenceEquals(this,obj)) {
return true;
}
ChameleonKey cKey = obj as ChameleonKey;
if (cKey != null) {
return this.targetNS.Equals(cKey.targetNS) && this.chameleonLocation.Equals(cKey.chameleonLocation);
}
return false;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
//-----------------------------------------------------------------------------
namespace System.Xml.Schema {
using System.Collections;
using System.ComponentModel;
using System.Xml.Serialization;
// Case insensitive file name key for use in a hashtable.
internal class ChameleonKey {
internal string targetNS;
internal Uri chameleonLocation;
int hashCode;
public ChameleonKey(string ns, Uri location) {
targetNS = ns;
chameleonLocation = location;
}
public override int GetHashCode() {
if (hashCode == 0) {
hashCode = targetNS.GetHashCode() + chameleonLocation.GetHashCode();
}
return hashCode;
}
public override bool Equals(object obj) {
if (Ref.ReferenceEquals(this,obj)) {
return true;
}
ChameleonKey cKey = obj as ChameleonKey;
if (cKey != null) {
return this.targetNS.Equals(cKey.targetNS) && this.chameleonLocation.Equals(cKey.chameleonLocation);
}
return false;
}
}
}
// 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
- DataListItemEventArgs.cs
- ZipIOCentralDirectoryFileHeader.cs
- NamespaceMapping.cs
- FontConverter.cs
- EventDriven.cs
- SimpleExpression.cs
- DataGridViewHitTestInfo.cs
- SqlDataSourceSelectingEventArgs.cs
- SecurityContextTokenValidationException.cs
- Vector3D.cs
- ExpressionBuilder.cs
- UncommonField.cs
- mongolianshape.cs
- TextAutomationPeer.cs
- RelatedView.cs
- TextRangeEditLists.cs
- ConfigurationPermission.cs
- ZipIOExtraFieldElement.cs
- ConfigurationSectionCollection.cs
- PointValueSerializer.cs
- Dump.cs
- ColorKeyFrameCollection.cs
- SyndicationContent.cs
- TreeView.cs
- SafeFileMapViewHandle.cs
- RotationValidation.cs
- EventBindingService.cs
- LinearKeyFrames.cs
- DocumentNUp.cs
- TypedElement.cs
- CommandEventArgs.cs
- GeometryDrawing.cs
- BackgroundWorker.cs
- ObjectConverter.cs
- RowCache.cs
- ListViewCommandEventArgs.cs
- TranslateTransform3D.cs
- AsyncOperationManager.cs
- UiaCoreProviderApi.cs
- Codec.cs
- MenuItemAutomationPeer.cs
- ProxyWebPartManagerDesigner.cs
- UserMapPath.cs
- TextDecorations.cs
- DirectionalLight.cs
- RenamedEventArgs.cs
- XslTransform.cs
- PropertyChangeTracker.cs
- DbParameterHelper.cs
- OracleBoolean.cs
- GridItemPatternIdentifiers.cs
- UpdateCompiler.cs
- OracleConnectionFactory.cs
- SafeReversePInvokeHandle.cs
- XPathParser.cs
- EncryptedReference.cs
- SymbolEqualComparer.cs
- DependencyObjectType.cs
- DisplayMemberTemplateSelector.cs
- SoapExtension.cs
- XPathBuilder.cs
- WorkflowTraceTransfer.cs
- DockAndAnchorLayout.cs
- PostBackOptions.cs
- WorkflowRuntimeBehavior.cs
- DataGridDesigner.cs
- IsolatedStorageFilePermission.cs
- VarRemapper.cs
- KnownColorTable.cs
- SharedStream.cs
- PrtCap_Public.cs
- PenLineCapValidation.cs
- SizeAnimationUsingKeyFrames.cs
- Model3DGroup.cs
- XmlElementList.cs
- FontSizeConverter.cs
- EditBehavior.cs
- DayRenderEvent.cs
- regiisutil.cs
- ContentOperations.cs
- DynamicVirtualDiscoSearcher.cs
- ReadOnlyDictionary.cs
- DataGridRelationshipRow.cs
- RadialGradientBrush.cs
- NameValueFileSectionHandler.cs
- Profiler.cs
- TextParentUndoUnit.cs
- TextTreeRootTextBlock.cs
- FailedToStartupUIException.cs
- DragEvent.cs
- PageContent.cs
- WebHeaderCollection.cs
- AsyncWaitHandle.cs
- LongValidator.cs
- DataGridViewColumnConverter.cs
- TextTreeObjectNode.cs
- PolyLineSegmentFigureLogic.cs
- TranslateTransform.cs
- PlatformCulture.cs
- GcHandle.cs