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
- ServiceOperationViewControl.cs
- ContentWrapperAttribute.cs
- FrameworkObject.cs
- New.cs
- AudioSignalProblemOccurredEventArgs.cs
- QueryStringParameter.cs
- Brush.cs
- Composition.cs
- SingleObjectCollection.cs
- HMACSHA256.cs
- WmlObjectListAdapter.cs
- PictureBox.cs
- Positioning.cs
- LabelDesigner.cs
- DirectoryObjectSecurity.cs
- ToolStripItemEventArgs.cs
- ExeContext.cs
- DataGridColumnHeadersPresenter.cs
- TableSectionStyle.cs
- NavigationFailedEventArgs.cs
- OdbcConnectionPoolProviderInfo.cs
- SelectorItemAutomationPeer.cs
- ObjectDataProvider.cs
- DiscoveryMessageSequence.cs
- ValidationErrorEventArgs.cs
- ErrorHandler.cs
- CollectionViewGroup.cs
- WorkflowApplicationUnhandledExceptionEventArgs.cs
- TdsParserStaticMethods.cs
- SqlWebEventProvider.cs
- wgx_exports.cs
- UnsafeNativeMethodsCLR.cs
- StrokeNode.cs
- EntityAdapter.cs
- ArrayElementGridEntry.cs
- Renderer.cs
- Trigger.cs
- EventPrivateKey.cs
- RelatedPropertyManager.cs
- DemultiplexingClientMessageFormatter.cs
- HandlerBase.cs
- BrowserCapabilitiesFactoryBase.cs
- SiteIdentityPermission.cs
- GiveFeedbackEventArgs.cs
- TextSegment.cs
- GridLength.cs
- HtmlLink.cs
- XmlSchemaExternal.cs
- TextTreeTextElementNode.cs
- MethodImplAttribute.cs
- ByteConverter.cs
- PropertyEmitterBase.cs
- DataGridRow.cs
- ServiceNameElementCollection.cs
- tibetanshape.cs
- FontInfo.cs
- BinaryObjectReader.cs
- DataGridViewRowStateChangedEventArgs.cs
- UtilityExtension.cs
- IntSecurity.cs
- NamedObject.cs
- ParameterDataSourceExpression.cs
- SystemFonts.cs
- OracleLob.cs
- CatalogPartCollection.cs
- mediaclock.cs
- Semaphore.cs
- SqlCacheDependencySection.cs
- FormParameter.cs
- DependencyPropertyChangedEventArgs.cs
- PolicyDesigner.cs
- QilReplaceVisitor.cs
- EventToken.cs
- ObjectDataSourceStatusEventArgs.cs
- ListBindingHelper.cs
- Console.cs
- DataGridViewTextBoxCell.cs
- MTConfigUtil.cs
- LinearGradientBrush.cs
- PlaceHolder.cs
- IndentedTextWriter.cs
- OracleCommandBuilder.cs
- DrawingCollection.cs
- MustUnderstandBehavior.cs
- GeometryCombineModeValidation.cs
- RowToFieldTransformer.cs
- XmlEventCache.cs
- StylusPointPropertyInfo.cs
- XmlSchemaComplexType.cs
- RSACryptoServiceProvider.cs
- XomlCompilerHelpers.cs
- DbConnectionPool.cs
- DetailsViewDeletedEventArgs.cs
- ExpressionSelection.cs
- KeyTimeConverter.cs
- ExternalFile.cs
- EntityReference.cs
- CanExecuteRoutedEventArgs.cs
- MissingFieldException.cs
- Hyperlink.cs