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
- StringWriter.cs
- PopOutPanel.cs
- SyndicationDeserializer.cs
- DataListItemEventArgs.cs
- BufferBuilder.cs
- ProgressiveCrcCalculatingStream.cs
- EmulateRecognizeCompletedEventArgs.cs
- SqlBulkCopy.cs
- InkPresenter.cs
- WebPartConnectionsEventArgs.cs
- ToggleProviderWrapper.cs
- TraceXPathNavigator.cs
- AmbientValueAttribute.cs
- IntSecurity.cs
- InstanceDataCollection.cs
- OutputCacheProfile.cs
- WizardPanel.cs
- ImageClickEventArgs.cs
- WindowsFont.cs
- securitycriticaldataformultiplegetandset.cs
- ErrorWebPart.cs
- MailMessage.cs
- ReflectionTypeLoadException.cs
- Accessible.cs
- HostingEnvironmentWrapper.cs
- SharedDp.cs
- Screen.cs
- PathGradientBrush.cs
- ServiceModelConfigurationSectionCollection.cs
- InputEventArgs.cs
- ValueTable.cs
- UxThemeWrapper.cs
- InheritedPropertyChangedEventArgs.cs
- WizardPanel.cs
- HostVisual.cs
- DataGridRelationshipRow.cs
- SecurityTokenContainer.cs
- OdbcCommandBuilder.cs
- PrintEvent.cs
- UrlPropertyAttribute.cs
- ValidationError.cs
- GPRECTF.cs
- EntityClassGenerator.cs
- XsdDuration.cs
- EntityDataSourceStatementEditor.cs
- QueryOperationResponseOfT.cs
- XslTransformFileEditor.cs
- DbSetClause.cs
- SchemaType.cs
- HttpsTransportBindingElement.cs
- Polyline.cs
- BroadcastEventHelper.cs
- InputProcessorProfiles.cs
- LinkArea.cs
- DataView.cs
- MergePropertyDescriptor.cs
- Comparer.cs
- DbConnectionInternal.cs
- MemoryResponseElement.cs
- InkCanvasSelectionAdorner.cs
- NetWebProxyFinder.cs
- TaiwanCalendar.cs
- SystemColors.cs
- XPathConvert.cs
- StaticTextPointer.cs
- PopupEventArgs.cs
- ReceiveCompletedEventArgs.cs
- RTLAwareMessageBox.cs
- XdrBuilder.cs
- CatalogPart.cs
- ControlPropertyNameConverter.cs
- WaitHandleCannotBeOpenedException.cs
- DelegateArgument.cs
- PersonalizableTypeEntry.cs
- MemberDomainMap.cs
- RuleRef.cs
- TextWriterTraceListener.cs
- SqlClientPermission.cs
- ContractNamespaceAttribute.cs
- ReachSerializationUtils.cs
- WindowsGraphics2.cs
- NodeLabelEditEvent.cs
- InputScopeAttribute.cs
- CustomBindingElement.cs
- HtmlWindow.cs
- SqlDataSource.cs
- TextServicesHost.cs
- QilTypeChecker.cs
- NumberSubstitution.cs
- UnwrappedTypesXmlSerializerManager.cs
- PathStreamGeometryContext.cs
- XmlNavigatorStack.cs
- CngAlgorithm.cs
- WasHttpModulesInstallComponent.cs
- InfoCardAsymmetricCrypto.cs
- CalendarDay.cs
- SecurityRuntime.cs
- loginstatus.cs
- Expander.cs
- DataTableCollection.cs