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
- DefaultPropertyAttribute.cs
- IntSecurity.cs
- UIElementCollection.cs
- Privilege.cs
- ExtractedStateEntry.cs
- DescendantQuery.cs
- SqlFunctionAttribute.cs
- BitmapEffectInputConnector.cs
- ContainerVisual.cs
- Panel.cs
- SafeFileMapViewHandle.cs
- XmlNodeChangedEventManager.cs
- SQLGuidStorage.cs
- Int64KeyFrameCollection.cs
- AliasedSlot.cs
- NotifyParentPropertyAttribute.cs
- ToolStripItemImageRenderEventArgs.cs
- BamlLocalizationDictionary.cs
- LingerOption.cs
- ValidationUtility.cs
- SiteMapHierarchicalDataSourceView.cs
- ExpressionEditorAttribute.cs
- Style.cs
- PrimitiveCodeDomSerializer.cs
- TextStore.cs
- BamlTreeUpdater.cs
- odbcmetadatacolumnnames.cs
- UTF32Encoding.cs
- KeyEvent.cs
- ReceiveDesigner.xaml.cs
- BuildResultCache.cs
- FlowLayout.cs
- UInt64.cs
- FigureParagraph.cs
- ErrorStyle.cs
- ISAPIApplicationHost.cs
- filewebrequest.cs
- PointHitTestParameters.cs
- ArrayListCollectionBase.cs
- SafeRightsManagementPubHandle.cs
- DefinitionBase.cs
- mactripleDES.cs
- RayMeshGeometry3DHitTestResult.cs
- EntityDataSourceColumn.cs
- SqlUserDefinedTypeAttribute.cs
- updateconfighost.cs
- ProcessHostConfigUtils.cs
- Timeline.cs
- Vector3D.cs
- SchemaTableColumn.cs
- DesignerTransactionCloseEvent.cs
- MultiTargetingUtil.cs
- IdentityReference.cs
- SerialPort.cs
- PropertySet.cs
- RuleRefElement.cs
- RelatedPropertyManager.cs
- RegexMatchCollection.cs
- SmtpReplyReader.cs
- MenuItemStyleCollection.cs
- EndpointDispatcher.cs
- RequestContextBase.cs
- TextMarkerSource.cs
- EntityTemplateFactory.cs
- ResourceReferenceExpression.cs
- UInt32Converter.cs
- ProtocolImporter.cs
- SamlNameIdentifierClaimResource.cs
- ButtonStandardAdapter.cs
- CancellationHandlerDesigner.cs
- TransformerInfo.cs
- LockCookie.cs
- ChannelManagerHelpers.cs
- CryptoApi.cs
- Polyline.cs
- CustomError.cs
- ReadWriteControlDesigner.cs
- SamlAuthorizationDecisionClaimResource.cs
- EntityDesignerUtils.cs
- DataListItemEventArgs.cs
- LogLogRecordEnumerator.cs
- TemplateKeyConverter.cs
- OleAutBinder.cs
- TransformCryptoHandle.cs
- ListViewItem.cs
- GorillaCodec.cs
- TypeToArgumentTypeConverter.cs
- DispatcherProcessingDisabled.cs
- ReadOnlyCollectionBase.cs
- Crypto.cs
- PropertyPathConverter.cs
- TableItemStyle.cs
- TimerElapsedEvenArgs.cs
- ValidatorCollection.cs
- SqlDataSourceCommandEventArgs.cs
- VectorCollectionValueSerializer.cs
- Code.cs
- NativeMethods.cs
- OracleBFile.cs
- ElementHostPropertyMap.cs