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
- KeyInterop.cs
- DataGridViewTopLeftHeaderCell.cs
- RepeatButton.cs
- CrossContextChannel.cs
- SynchronizedCollection.cs
- HtmlElementCollection.cs
- MembershipAdapter.cs
- MatrixAnimationBase.cs
- ProfileServiceManager.cs
- RunWorkerCompletedEventArgs.cs
- ProcessHostServerConfig.cs
- Timer.cs
- PreviewPageInfo.cs
- CodeConditionStatement.cs
- DummyDataSource.cs
- ComponentConverter.cs
- DynamicFilter.cs
- ChildTable.cs
- HttpCacheVaryByContentEncodings.cs
- HandlerWithFactory.cs
- RuntimeHelpers.cs
- EventLogQuery.cs
- XamlRtfConverter.cs
- DockPatternIdentifiers.cs
- OletxEnlistment.cs
- ScriptReferenceEventArgs.cs
- DataSourceView.cs
- SqlBooleanMismatchVisitor.cs
- Polygon.cs
- ReferentialConstraint.cs
- BitmapEffectInputData.cs
- ForceCopyBuildProvider.cs
- HttpAsyncResult.cs
- MDIClient.cs
- ADConnectionHelper.cs
- TextBlock.cs
- FormViewDeletedEventArgs.cs
- PropertyChangingEventArgs.cs
- FreeFormPanel.cs
- CoTaskMemSafeHandle.cs
- StorageConditionPropertyMapping.cs
- MultiDataTrigger.cs
- Message.cs
- basemetadatamappingvisitor.cs
- KeyPressEvent.cs
- LicenseProviderAttribute.cs
- FigureParagraph.cs
- RequestSecurityToken.cs
- ProcessInputEventArgs.cs
- CodeBinaryOperatorExpression.cs
- SQLInt16.cs
- StringOutput.cs
- WebPartConnectionsCancelVerb.cs
- WsatStrings.cs
- EditingMode.cs
- WebHttpEndpoint.cs
- NetworkAddressChange.cs
- XmlIncludeAttribute.cs
- StructuredTypeInfo.cs
- SqlBooleanizer.cs
- IisTraceWebEventProvider.cs
- StdRegProviderWrapper.cs
- XmlLoader.cs
- Decoder.cs
- EventLog.cs
- UriTemplatePathPartiallyEquivalentSet.cs
- CookieParameter.cs
- EnumConverter.cs
- ImageBrush.cs
- FormatVersion.cs
- DBNull.cs
- Section.cs
- DataListItem.cs
- QuadraticBezierSegment.cs
- WorkflowTimerService.cs
- AdRotator.cs
- TcpClientSocketManager.cs
- DataKeyCollection.cs
- PropertyGridEditorPart.cs
- OpenTypeCommon.cs
- QuaternionAnimation.cs
- XPathNavigatorReader.cs
- InternalMappingException.cs
- Point3DIndependentAnimationStorage.cs
- FloaterParaClient.cs
- WindowHelperService.cs
- HttpCookiesSection.cs
- DesignParameter.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- VisualTarget.cs
- ImageCodecInfoPrivate.cs
- SecurityElement.cs
- Pens.cs
- HttpCapabilitiesEvaluator.cs
- DispatcherFrame.cs
- Activity.cs
- ThreadAttributes.cs
- PrintingPermission.cs
- ListViewGroupCollectionEditor.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs