Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Linq / Parallel / Utils / PairComparer.cs / 1305376 / PairComparer.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // PairComparer.cs // //[....] // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System.Collections.Generic; namespace System.Linq.Parallel { ////// PairComparer compares pairs by the first element, and breaks ties by the second /// element. /// ////// internal class PairComparer : IComparer > { private IComparer m_comparer1; private IComparer m_comparer2; public PairComparer(IComparer comparer1, IComparer comparer2) { m_comparer1 = comparer1; m_comparer2 = comparer2; } public int Compare(Pair x, Pair y) { int result1 = m_comparer1.Compare(x.First, y.First); if (result1 != 0) { return result1; } return m_comparer2.Compare(x.Second, y.Second); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // PairComparer.cs // // [....] // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System.Collections.Generic; namespace System.Linq.Parallel { ////// PairComparer compares pairs by the first element, and breaks ties by the second /// element. /// ////// internal class PairComparer : IComparer > { private IComparer m_comparer1; private IComparer m_comparer2; public PairComparer(IComparer comparer1, IComparer comparer2) { m_comparer1 = comparer1; m_comparer2 = comparer2; } public int Compare(Pair x, Pair y) { int result1 = m_comparer1.Compare(x.First, y.First); if (result1 != 0) { return result1; } return m_comparer2.Compare(x.Second, y.Second); } } } // 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
- EnumerableCollectionView.cs
- QilExpression.cs
- BaseParaClient.cs
- WebPartsPersonalization.cs
- XmlSchemaAttributeGroup.cs
- DrawingVisual.cs
- BuildProvidersCompiler.cs
- WinEventTracker.cs
- CorruptingExceptionCommon.cs
- DefaultHttpHandler.cs
- CLRBindingWorker.cs
- TypeName.cs
- PageTheme.cs
- QilBinary.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- RegisteredArrayDeclaration.cs
- FaultBookmark.cs
- EmptyEnumerator.cs
- ProxyWebPart.cs
- AmbientValueAttribute.cs
- CompiledIdentityConstraint.cs
- ExpanderAutomationPeer.cs
- TreeNodeBindingCollection.cs
- PriorityBindingExpression.cs
- AsyncInvokeContext.cs
- NumberFunctions.cs
- SafeFileHandle.cs
- ContextProperty.cs
- XPathException.cs
- WindowHideOrCloseTracker.cs
- FontFamily.cs
- TrackingServices.cs
- DataSvcMapFileSerializer.cs
- EntityDataSourceWizardForm.cs
- PeerConnector.cs
- DataGridViewIntLinkedList.cs
- WpfKnownTypeInvoker.cs
- ConnectionStringsExpressionBuilder.cs
- UserControlParser.cs
- AccessorTable.cs
- ScriptingJsonSerializationSection.cs
- MaterialGroup.cs
- EmptyImpersonationContext.cs
- XmlSchemaSimpleTypeUnion.cs
- ContentIterators.cs
- AppSettingsReader.cs
- PrivacyNoticeElement.cs
- TypographyProperties.cs
- dataobject.cs
- ConnectionOrientedTransportChannelFactory.cs
- ProcessHostServerConfig.cs
- ModifierKeysConverter.cs
- FontDialog.cs
- WebPartCatalogAddVerb.cs
- EntityDataSourceQueryBuilder.cs
- PathStreamGeometryContext.cs
- WebPartCloseVerb.cs
- CursorInteropHelper.cs
- WebPartAddingEventArgs.cs
- ProvidePropertyAttribute.cs
- CompilerWrapper.cs
- AsnEncodedData.cs
- DPTypeDescriptorContext.cs
- X509SecurityTokenAuthenticator.cs
- WindowVisualStateTracker.cs
- RadioButtonPopupAdapter.cs
- StrongName.cs
- Compensation.cs
- ColumnHeaderConverter.cs
- BufferAllocator.cs
- ControlPropertyNameConverter.cs
- UTF8Encoding.cs
- URLIdentityPermission.cs
- ShortcutKeysEditor.cs
- CodeTypeOfExpression.cs
- SchemaCollectionPreprocessor.cs
- PerfService.cs
- Stroke2.cs
- CustomAttributeBuilder.cs
- XsdCachingReader.cs
- RequestCacheEntry.cs
- Italic.cs
- XmlObjectSerializerReadContextComplex.cs
- Cursors.cs
- NonNullItemCollection.cs
- dbenumerator.cs
- Point.cs
- DependencyObjectType.cs
- MethodInfo.cs
- FormView.cs
- followingquery.cs
- ImpersonationOption.cs
- RepeatButtonAutomationPeer.cs
- Helpers.cs
- DynamicDataResources.Designer.cs
- DependencyPropertyConverter.cs
- DrawingGroup.cs
- ToolboxCategoryItems.cs
- GiveFeedbackEventArgs.cs
- MemoryMappedView.cs