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
- SimpleBitVector32.cs
- JobInputBins.cs
- ResolveNextArgumentWorkItem.cs
- RepeatButton.cs
- PerfCounters.cs
- HtmlEmptyTagControlBuilder.cs
- RegexRunner.cs
- SelectionPattern.cs
- UrlParameterReader.cs
- ConnectionConsumerAttribute.cs
- Drawing.cs
- ReachDocumentReferenceCollectionSerializer.cs
- AdCreatedEventArgs.cs
- SQLDecimal.cs
- CodeSubDirectory.cs
- InheritablePropertyChangeInfo.cs
- EventTrigger.cs
- XmlExpressionDumper.cs
- TreeViewAutomationPeer.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- PersistStreamTypeWrapper.cs
- DataGridViewHitTestInfo.cs
- SQLSingle.cs
- TypeConstant.cs
- BinaryReader.cs
- SiteMapDataSource.cs
- VirtualDirectoryMappingCollection.cs
- XmlName.cs
- FrameAutomationPeer.cs
- StatusBarItemAutomationPeer.cs
- ListControl.cs
- ConstraintStruct.cs
- ResponseBodyWriter.cs
- SimpleTextLine.cs
- BufferBuilder.cs
- ParserStreamGeometryContext.cs
- SelectionProviderWrapper.cs
- TemplateField.cs
- PostBackTrigger.cs
- DynamicValidatorEventArgs.cs
- URLIdentityPermission.cs
- Font.cs
- ListView.cs
- WebZone.cs
- HotCommands.cs
- ChannelServices.cs
- ConfigurationManagerInternal.cs
- DataGridAddNewRow.cs
- ToolStripItemImageRenderEventArgs.cs
- PropertyEmitterBase.cs
- DelegateSerializationHolder.cs
- StateMachineDesignerPaint.cs
- DataGridRow.cs
- Form.cs
- Soap.cs
- MULTI_QI.cs
- WsatAdminException.cs
- BaseComponentEditor.cs
- PreviewPageInfo.cs
- GridViewColumnHeader.cs
- ProcessModule.cs
- DataProtection.cs
- EntityConnectionStringBuilder.cs
- WindowsListViewScroll.cs
- TableLayoutPanelBehavior.cs
- FrameworkElement.cs
- BrowserTree.cs
- ToolStripItemCollection.cs
- SoapIgnoreAttribute.cs
- NavigationWindowAutomationPeer.cs
- SecurityTokenAttachmentMode.cs
- FindResponse.cs
- Geometry.cs
- CalculatedColumn.cs
- WS2007HttpBindingElement.cs
- CompiledAction.cs
- SectionXmlInfo.cs
- TraceProvider.cs
- ListViewEditEventArgs.cs
- ContextMenuService.cs
- ListItemCollection.cs
- StylusEditingBehavior.cs
- NegotiateStream.cs
- Rotation3DKeyFrameCollection.cs
- validationstate.cs
- XmlBaseReader.cs
- PresentationAppDomainManager.cs
- ReadOnlyHierarchicalDataSourceView.cs
- OwnerDrawPropertyBag.cs
- Pkcs7Recipient.cs
- WebReferenceCollection.cs
- AssertSection.cs
- SqlInternalConnection.cs
- ProfessionalColors.cs
- TextSelectionHighlightLayer.cs
- Wizard.cs
- _LazyAsyncResult.cs
- WindowsFont.cs
- FixedFlowMap.cs
- IntegerFacetDescriptionElement.cs