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
- SystemFonts.cs
- ButtonBaseAutomationPeer.cs
- XamlDesignerSerializationManager.cs
- WriterOutput.cs
- XmlTextEncoder.cs
- PostBackTrigger.cs
- ActiveDocumentEvent.cs
- ConnectionPointCookie.cs
- LocalizationParserHooks.cs
- NegotiateStream.cs
- TrackingDataItemValue.cs
- BufferedResponseStream.cs
- UseLicense.cs
- DataGridTextBox.cs
- DependencyProperty.cs
- EditorAttribute.cs
- SoapTypeAttribute.cs
- RtfToXamlLexer.cs
- wpf-etw.cs
- MatrixAnimationBase.cs
- ToolStripArrowRenderEventArgs.cs
- ParentQuery.cs
- FilterableAttribute.cs
- Triangle.cs
- SimpleWebHandlerParser.cs
- ButtonFieldBase.cs
- ConnectionProviderAttribute.cs
- XamlWrapperReaders.cs
- LinkLabelLinkClickedEvent.cs
- PersonalizationDictionary.cs
- SafeFreeMibTable.cs
- PolyLineSegmentFigureLogic.cs
- FactoryGenerator.cs
- ListBox.cs
- DropTarget.cs
- SynchronizationLockException.cs
- DataGridRowHeader.cs
- ListBoxAutomationPeer.cs
- regiisutil.cs
- XmlName.cs
- _StreamFramer.cs
- MouseEventArgs.cs
- CharEnumerator.cs
- DocumentViewerAutomationPeer.cs
- TextHidden.cs
- ColorTranslator.cs
- CompositeFontFamily.cs
- Splitter.cs
- CallSiteOps.cs
- TaskFileService.cs
- DataObjectSettingDataEventArgs.cs
- Formatter.cs
- NetTcpSectionData.cs
- UnsafeNativeMethods.cs
- ConfigXmlAttribute.cs
- Filter.cs
- ConcurrentBag.cs
- BamlTreeMap.cs
- ConfigsHelper.cs
- FontSizeConverter.cs
- OutputScopeManager.cs
- Convert.cs
- returneventsaver.cs
- TextServicesDisplayAttribute.cs
- cookiecontainer.cs
- AQNBuilder.cs
- TextBlock.cs
- StringUtil.cs
- WebPartCatalogCloseVerb.cs
- ConfigXmlWhitespace.cs
- SessionStateItemCollection.cs
- IConvertible.cs
- CodeVariableDeclarationStatement.cs
- MatrixConverter.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- TextComposition.cs
- cookiecontainer.cs
- XmlDocumentType.cs
- CompilerError.cs
- CatalogZone.cs
- PingOptions.cs
- WhereaboutsReader.cs
- CodeLabeledStatement.cs
- BitmapFrame.cs
- StretchValidation.cs
- CommandManager.cs
- EventMappingSettings.cs
- ColorConvertedBitmap.cs
- UnmanagedBitmapWrapper.cs
- UiaCoreProviderApi.cs
- VSWCFServiceContractGenerator.cs
- InfocardClientCredentials.cs
- DockPattern.cs
- DoubleAnimationBase.cs
- Repeater.cs
- SamlAuthenticationClaimResource.cs
- GeneralTransform3DCollection.cs
- SerializerDescriptor.cs
- AssemblyEvidenceFactory.cs
- ToolStripSeparatorRenderEventArgs.cs