Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataSet / System / Data / SortExpressionBuilder.cs / 1305376 / SortExpressionBuilder.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
// [....]
//-----------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Data;
using System.Linq;
using System.Diagnostics;
namespace System.Data
{
///
/// This class represents a combined sort expression build using mutiple sort expressions.
///
///
internal class SortExpressionBuilder : IComparer>
{
/**
* This class ensures multiple orderby/thenbys are handled correctly. Its semantics is as follows:
*
* Query 1:
* orderby a
* thenby b
* orderby c
* orderby d
* thenby e
*
* is equivalent to:
*
* Query 2:
* orderby d
* thenby e
* thenby c
* thenby a
* thenby b
*
**/
//Selectors and comparers are mapped using the index in the list.
//E.g: _comparers[i] is used with _selectors[i]
LinkedList> _selectors = new LinkedList>();
LinkedList> _comparers = new LinkedList>();
LinkedListNode> _currentSelector = null;
LinkedListNode> _currentComparer = null;
///
/// Adds a sorting selector/comparer in the correct order
///
internal void Add(Func keySelector, Comparison
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- OutOfMemoryException.cs
- WindowsIPAddress.cs
- KeyTimeConverter.cs
- HandlerBase.cs
- ItemType.cs
- WebResourceUtil.cs
- QilGenerator.cs
- DbDeleteCommandTree.cs
- ComponentTray.cs
- TemplateNameScope.cs
- StreamHelper.cs
- DeploymentExceptionMapper.cs
- ProxyElement.cs
- ByteStreamGeometryContext.cs
- XmlSchemaSimpleTypeList.cs
- SiteMapSection.cs
- ActivityBuilderXamlWriter.cs
- ProfileSettings.cs
- DbParameterHelper.cs
- CapacityStreamGeometryContext.cs
- ChangePassword.cs
- InfoCardRSACryptoProvider.cs
- FontStretch.cs
- OutputCacheEntry.cs
- wgx_render.cs
- EntityDataSourceChangingEventArgs.cs
- CharacterBufferReference.cs
- RegionData.cs
- Visual3DCollection.cs
- Helpers.cs
- Imaging.cs
- Command.cs
- IPPacketInformation.cs
- DbParameterHelper.cs
- UiaCoreTypesApi.cs
- NameValueFileSectionHandler.cs
- Console.cs
- ConstrainedDataObject.cs
- PropertyGridCommands.cs
- ControlPager.cs
- HtmlInputHidden.cs
- HttpCookie.cs
- XPathChildIterator.cs
- TraceInternal.cs
- HierarchicalDataSourceControl.cs
- FileDialogCustomPlaces.cs
- FragmentQueryProcessor.cs
- SourceFilter.cs
- DataRowCollection.cs
- MsdtcClusterUtils.cs
- Evaluator.cs
- List.cs
- SqlInternalConnectionSmi.cs
- OdbcConnectionPoolProviderInfo.cs
- XmlElementAttribute.cs
- InteropBitmapSource.cs
- MultiPageTextView.cs
- DefaultSection.cs
- ExpressionLexer.cs
- InternalBufferOverflowException.cs
- Authorization.cs
- CriticalFinalizerObject.cs
- Figure.cs
- MarkedHighlightComponent.cs
- KeyedByTypeCollection.cs
- XmlTextReaderImplHelpers.cs
- HelpInfo.cs
- ReachDocumentReferenceCollectionSerializer.cs
- ResourceIDHelper.cs
- FilterQueryOptionExpression.cs
- ComponentResourceManager.cs
- PartialCachingControl.cs
- DataGridViewRowConverter.cs
- PeerNameRecordCollection.cs
- ServiceMetadataExtension.cs
- ScrollItemProviderWrapper.cs
- Selection.cs
- WebPartTransformer.cs
- DbParameterCollection.cs
- ConcurrencyMode.cs
- ActionMismatchAddressingException.cs
- SafeIUnknown.cs
- BindingSource.cs
- XmlEntity.cs
- PagesChangedEventArgs.cs
- EqualityComparer.cs
- XmlEncodedRawTextWriter.cs
- ParameterBuilder.cs
- DBPropSet.cs
- RtfControls.cs
- BindStream.cs
- CngKeyBlobFormat.cs
- KeyValueInternalCollection.cs
- SystemIPGlobalProperties.cs
- CodeSnippetExpression.cs
- RegionIterator.cs
- XmlSchemaSubstitutionGroup.cs
- InputElement.cs
- ResizingMessageFilter.cs
- ToolboxItem.cs