Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / Microsoft / Scripting / Utils / ReferenceEqualityComparer.cs / 1305376 / ReferenceEqualityComparer.cs
/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * * This source code is subject to terms and conditions of the Microsoft Public License. A * copy of the license can be found in the License.html file at the root of this distribution. If * you cannot locate the Microsoft Public License, please send an email to * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound * by the terms of the Microsoft Public License. * * You must not remove this notice, or any other, from this software. * * * ***************************************************************************/ using System.Collections.Generic; using System.Runtime.CompilerServices; namespace System.Dynamic.Utils { internal sealed class ReferenceEqualityComparer: IEqualityComparer { internal static readonly ReferenceEqualityComparer Instance = new ReferenceEqualityComparer (); private ReferenceEqualityComparer() { } public bool Equals(T x, T y) { return object.ReferenceEquals(x, y); } public int GetHashCode(T obj) { return RuntimeHelpers.GetHashCode(obj); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. /* **************************************************************************** * * Copyright (c) Microsoft Corporation. * * This source code is subject to terms and conditions of the Microsoft Public License. A * copy of the license can be found in the License.html file at the root of this distribution. If * you cannot locate the Microsoft Public License, please send an email to * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound * by the terms of the Microsoft Public License. * * You must not remove this notice, or any other, from this software. * * * ***************************************************************************/ using System.Collections.Generic; using System.Runtime.CompilerServices; namespace System.Dynamic.Utils { internal sealed class ReferenceEqualityComparer : IEqualityComparer { internal static readonly ReferenceEqualityComparer Instance = new ReferenceEqualityComparer (); private ReferenceEqualityComparer() { } public bool Equals(T x, T y) { return object.ReferenceEquals(x, y); } public int GetHashCode(T obj) { return RuntimeHelpers.GetHashCode(obj); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ValidationRuleCollection.cs
- UnsafeNativeMethods.cs
- relpropertyhelper.cs
- TypographyProperties.cs
- TextChange.cs
- SchemaType.cs
- Environment.cs
- _Semaphore.cs
- WebHttpBindingCollectionElement.cs
- MsmqIntegrationInputChannel.cs
- CustomError.cs
- RuntimeIdentifierPropertyAttribute.cs
- base64Transforms.cs
- XmlUtil.cs
- AssemblyBuilderData.cs
- PasswordTextNavigator.cs
- StrongTypingException.cs
- PngBitmapEncoder.cs
- SimplePropertyEntry.cs
- COM2IProvidePropertyBuilderHandler.cs
- WmlObjectListAdapter.cs
- XamlBrushSerializer.cs
- ValueTypeFixupInfo.cs
- ListBase.cs
- DisplayNameAttribute.cs
- _NetworkingPerfCounters.cs
- PathFigure.cs
- TraceSection.cs
- InstanceDescriptor.cs
- SQLMoney.cs
- BaseServiceProvider.cs
- InitializeCorrelation.cs
- OdbcParameter.cs
- UnmanagedMemoryStreamWrapper.cs
- RenderData.cs
- AuthorizationPolicyTypeElement.cs
- StringArrayConverter.cs
- CacheForPrimitiveTypes.cs
- DrawingAttributeSerializer.cs
- ListViewDeleteEventArgs.cs
- MetadataArtifactLoaderFile.cs
- GridLength.cs
- EndpointConfigContainer.cs
- XmlDocument.cs
- MarshalDirectiveException.cs
- GlyphRun.cs
- BinaryUtilClasses.cs
- ComAdminInterfaces.cs
- DemultiplexingClientMessageFormatter.cs
- QueueSurrogate.cs
- UrlAuthFailedErrorFormatter.cs
- TabItemAutomationPeer.cs
- TraceSection.cs
- DefaultEvaluationContext.cs
- NavigationEventArgs.cs
- HyperLinkStyle.cs
- webeventbuffer.cs
- Fonts.cs
- VirtualPathUtility.cs
- DataExpression.cs
- CompModSwitches.cs
- UnmanagedBitmapWrapper.cs
- LoginUtil.cs
- ServicePointManager.cs
- MetadataItemCollectionFactory.cs
- MatrixConverter.cs
- FormViewRow.cs
- FactoryId.cs
- Typeface.cs
- ContextMenu.cs
- ParamArrayAttribute.cs
- CustomErrorsSectionWrapper.cs
- WindowsToolbarAsMenu.cs
- Page.cs
- WindowsComboBox.cs
- TrustLevel.cs
- DataBindingCollection.cs
- IdnElement.cs
- GridLength.cs
- LogFlushAsyncResult.cs
- Matrix.cs
- DataObjectFieldAttribute.cs
- ProgressChangedEventArgs.cs
- WebGetAttribute.cs
- SmiEventStream.cs
- RoleProviderPrincipal.cs
- Predicate.cs
- sqlpipe.cs
- TextEffectResolver.cs
- XmlTextAttribute.cs
- CharConverter.cs
- ReachDocumentReferenceCollectionSerializer.cs
- ValidatingCollection.cs
- HtmlFormParameterWriter.cs
- ThreadPool.cs
- Utilities.cs
- MenuItemBindingCollection.cs
- unitconverter.cs
- ModelFunction.cs
- BufferedReadStream.cs