Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / clr / src / BCL / System / Collections / CompatibleComparer.cs / 1 / CompatibleComparer.cs
// Copyright (c) Microsoft Corporation. All rights reserved. namespace System.Collections { [Serializable()] internal class CompatibleComparer: IEqualityComparer { IComparer _comparer; #pragma warning disable 618 IHashCodeProvider _hcp; internal CompatibleComparer(IComparer comparer, IHashCodeProvider hashCodeProvider) { _comparer = comparer; _hcp = hashCodeProvider; } #pragma warning restore 618 public int Compare(Object a, Object b) { if (a == b) return 0; if (a == null) return -1; if (b == null) return 1; if (_comparer != null) return _comparer.Compare(a,b); IComparable ia = a as IComparable; if (ia != null) return ia.CompareTo(b); throw new ArgumentException(Environment.GetResourceString("Argument_ImplementIComparable")); } public new bool Equals(Object a, Object b) { return Compare(a, b) == 0; } public int GetHashCode(Object obj) { if( obj == null) { throw new ArgumentNullException("obj"); } if (_hcp != null) return _hcp.GetHashCode(obj); return obj.GetHashCode(); } // These are helpers for the Hashtable to query the IKeyComparer infrastructure. internal IComparer Comparer { get { return _comparer; } } // These are helpers for the Hashtable to query the IKeyComparer infrastructure. #pragma warning disable 618 internal IHashCodeProvider HashCodeProvider { get { return _hcp; } } #pragma warning restore 618 } } // 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
- Font.cs
- ProxyHelper.cs
- SoapRpcServiceAttribute.cs
- XPathBuilder.cs
- SystemTcpConnection.cs
- OptimisticConcurrencyException.cs
- DataGridLinkButton.cs
- ClientCultureInfo.cs
- SpellerStatusTable.cs
- HostExecutionContextManager.cs
- AssemblyInfo.cs
- XmlSchemaSubstitutionGroup.cs
- SevenBitStream.cs
- IOThreadTimer.cs
- HwndProxyElementProvider.cs
- PropertyItem.cs
- SpStreamWrapper.cs
- RSAOAEPKeyExchangeFormatter.cs
- EmptyEnumerator.cs
- ModuleConfigurationInfo.cs
- backend.cs
- GetIsBrowserClientRequest.cs
- TextEditorContextMenu.cs
- FlowDocumentPageViewerAutomationPeer.cs
- SqlNodeAnnotations.cs
- UserInitiatedRoutedEventPermission.cs
- OpCodes.cs
- XmlSchemaSimpleContentExtension.cs
- util.cs
- SpeechAudioFormatInfo.cs
- fixedPageContentExtractor.cs
- SmiRequestExecutor.cs
- DirectoryObjectSecurity.cs
- DataMisalignedException.cs
- HttpCacheVaryByContentEncodings.cs
- FlagPanel.cs
- FontDriver.cs
- BitmapEffectGroup.cs
- UrlMappingsSection.cs
- SmiRecordBuffer.cs
- SQLByte.cs
- MachineKeySection.cs
- XmlAttributeAttribute.cs
- RelationshipWrapper.cs
- MemberInitExpression.cs
- ExpressionCopier.cs
- HtmlTableCellCollection.cs
- PrimitiveSchema.cs
- StylusLogic.cs
- BevelBitmapEffect.cs
- TextUtf8RawTextWriter.cs
- ThousandthOfEmRealPoints.cs
- RecordManager.cs
- input.cs
- OracleConnectionString.cs
- IsolatedStorageFilePermission.cs
- PerformanceCounterManager.cs
- _FtpControlStream.cs
- COM2ComponentEditor.cs
- CodeTypeDeclarationCollection.cs
- DefaultTraceListener.cs
- Validator.cs
- MyContact.cs
- NetworkInformationException.cs
- XamlClipboardData.cs
- AppManager.cs
- DataSourceViewSchemaConverter.cs
- MapPathBasedVirtualPathProvider.cs
- SimpleTypeResolver.cs
- TheQuery.cs
- SrgsGrammarCompiler.cs
- BindToObject.cs
- SSmlParser.cs
- WorkflowDurableInstance.cs
- ConstructorNeedsTagAttribute.cs
- MultiPropertyDescriptorGridEntry.cs
- NullableBoolConverter.cs
- MonthChangedEventArgs.cs
- NavigationWindow.cs
- GenerateScriptTypeAttribute.cs
- ObjectDataProvider.cs
- EventLogTraceListener.cs
- DelegateSerializationHolder.cs
- BrowsableAttribute.cs
- SymmetricAlgorithm.cs
- EntityDataSourceDesignerHelper.cs
- RepeaterItem.cs
- ValueSerializer.cs
- SelectionRange.cs
- OleDbDataAdapter.cs
- MetafileHeader.cs
- CompositeControlDesigner.cs
- DecimalConstantAttribute.cs
- HostedNamedPipeTransportManager.cs
- WpfKnownMemberInvoker.cs
- WebPartTransformerCollection.cs
- RichTextBoxConstants.cs
- RestHandlerFactory.cs
- BindingNavigator.cs
- ADRoleFactoryConfiguration.cs