Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Linq / Parallel / Utils / ReverseComparer.cs / 1305376 / ReverseComparer.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // ReverseComparer.cs // //[....] // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System.Collections.Generic; namespace System.Linq.Parallel { ////// Comparer that wraps another comparer, and flips the result of each comparison to the /// opposite answer. /// ///internal class ReverseComparer : IComparer { private IComparer m_comparer; internal ReverseComparer(IComparer comparer) { m_comparer = comparer; } public int Compare(T x, T y) { return -m_comparer.Compare(x, y); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // ReverseComparer.cs // // [....] // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System.Collections.Generic; namespace System.Linq.Parallel { ////// Comparer that wraps another comparer, and flips the result of each comparison to the /// opposite answer. /// ///internal class ReverseComparer : IComparer { private IComparer m_comparer; internal ReverseComparer(IComparer comparer) { m_comparer = comparer; } public int Compare(T x, T y) { return -m_comparer.Compare(x, y); } } } // 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
- UnsafeNativeMethodsPenimc.cs
- StatusBarPanel.cs
- BoundColumn.cs
- FileDataSourceCache.cs
- MetadataArtifactLoaderComposite.cs
- __ComObject.cs
- SerializationInfo.cs
- RegexWriter.cs
- XmlReaderSettings.cs
- RegularExpressionValidator.cs
- HealthMonitoringSectionHelper.cs
- RegexMatchCollection.cs
- MetadataUtil.cs
- AbstractSvcMapFileLoader.cs
- PageEventArgs.cs
- XmlDocumentFragment.cs
- SymLanguageVendor.cs
- EventMappingSettingsCollection.cs
- CompilerScopeManager.cs
- XsdCachingReader.cs
- XmlToDatasetMap.cs
- ResourcePool.cs
- SchemaCollectionCompiler.cs
- SecondaryIndex.cs
- Enlistment.cs
- UIPermission.cs
- SuppressMergeCheckAttribute.cs
- BitmapFrame.cs
- SubtreeProcessor.cs
- BaseCodeDomTreeGenerator.cs
- Rfc2898DeriveBytes.cs
- SmiTypedGetterSetter.cs
- EventToken.cs
- EntityProviderServices.cs
- ReferenceEqualityComparer.cs
- BufferModeSettings.cs
- SecurityListenerSettingsLifetimeManager.cs
- GraphicsState.cs
- Int16Converter.cs
- RankException.cs
- RuntimeHelpers.cs
- ParsedAttributeCollection.cs
- GenericIdentity.cs
- WebPartDeleteVerb.cs
- MSAAEventDispatcher.cs
- CodeBinaryOperatorExpression.cs
- ZipArchive.cs
- XmlImplementation.cs
- ArrangedElementCollection.cs
- SqlServices.cs
- Int64Animation.cs
- FolderBrowserDialog.cs
- HierarchicalDataBoundControlAdapter.cs
- ZoomPercentageConverter.cs
- HwndHostAutomationPeer.cs
- SettingsProviderCollection.cs
- WebRequest.cs
- HttpHandlerAction.cs
- ValidatedControlConverter.cs
- HttpChannelHelper.cs
- SortDescription.cs
- DrawingContext.cs
- WindowsRichEdit.cs
- login.cs
- Help.cs
- ObjectDataSourceChooseMethodsPanel.cs
- AssemblyBuilder.cs
- ListBindableAttribute.cs
- MDIControlStrip.cs
- Compiler.cs
- DataBindingList.cs
- IntPtr.cs
- Label.cs
- IsolatedStorageFilePermission.cs
- CategoryAttribute.cs
- InstanceDescriptor.cs
- TextHidden.cs
- IFormattable.cs
- DefaultSection.cs
- AnimationClock.cs
- DataRelationCollection.cs
- DummyDataSource.cs
- DataSourceConverter.cs
- PhysicalOps.cs
- ViewSimplifier.cs
- AllMembershipCondition.cs
- DescendantBaseQuery.cs
- ChainedAsyncResult.cs
- SqlDependencyUtils.cs
- XmlAttributeProperties.cs
- PixelShader.cs
- StructuralObject.cs
- TagMapCollection.cs
- GridViewColumnHeader.cs
- DataGridViewCellLinkedList.cs
- CodeExpressionCollection.cs
- AutoGeneratedFieldProperties.cs
- FontClient.cs
- AdRotator.cs
- ImpersonateTokenRef.cs