Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / MS / Internal / Data / XmlNodeComparer.cs / 1 / XmlNodeComparer.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: Defines XmlNodeComparer object, used to sort a view of data produced by an XmlDataSource. // // Specs: [....]/connecteddata/M5%20Specs/UIBinding.mht // //--------------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Globalization; using System.Xml; using MS.Internal.Data; namespace MS.Internal.Data { ////// The XmlNodeComparer is used to sort a view of data produced by an XmlDataSource. /// internal class XmlNodeComparer : IComparer { ////// Constructor. /// /// array of sort parameters /// namespace manager, to control queries /// culture to use for comparisons internal XmlNodeComparer(SortDescriptionCollection sortParameters, XmlNamespaceManager namespaceManager, CultureInfo culture) { _sortParameters = sortParameters; _namespaceManager = namespaceManager; _culture = (culture == null) ? CultureInfo.InvariantCulture : culture; } int IComparer.Compare(object o1, object o2) { int result = 0; XmlNode node1 = o1 as XmlNode; XmlNode node2 = o2 as XmlNode; if (node1 == null) return -1; if (node2 == null) return +1; for (int k = 0; k < _sortParameters.Count; ++k) { string valueX = XmlHelper.SelectStringValue(node1, _sortParameters[k].PropertyName, _namespaceManager); string valueY = XmlHelper.SelectStringValue(node2, _sortParameters[k].PropertyName, _namespaceManager); result = String.Compare(valueX, valueY, false, _culture); if (_sortParameters[k].Direction == ListSortDirection.Descending) result = -result; if (result != 0) break; } return result; } private SortDescriptionCollection _sortParameters; private XmlNamespaceManager _namespaceManager; CultureInfo _culture; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DragEventArgs.cs
- ColorAnimationUsingKeyFrames.cs
- ErrorInfoXmlDocument.cs
- Win32.cs
- Win32Native.cs
- WebColorConverter.cs
- XmlSerializerFactory.cs
- StructuralCache.cs
- AttachedAnnotationChangedEventArgs.cs
- DesignerOptions.cs
- DesignerActionPropertyItem.cs
- IndentTextWriter.cs
- TypefaceMap.cs
- DBBindings.cs
- Attribute.cs
- Polygon.cs
- InsufficientMemoryException.cs
- CategoryValueConverter.cs
- SupportingTokenBindingElement.cs
- PolyBezierSegment.cs
- InteropAutomationProvider.cs
- ScopedKnownTypes.cs
- PathStreamGeometryContext.cs
- TreeViewCancelEvent.cs
- DictionaryContent.cs
- CharAnimationBase.cs
- XmlSerializerAssemblyAttribute.cs
- UIAgentMonitor.cs
- PolicyLevel.cs
- PathGeometry.cs
- CurrencyManager.cs
- FixUpCollection.cs
- BuildResult.cs
- RangeBase.cs
- MenuBindingsEditorForm.cs
- PingOptions.cs
- Internal.cs
- DateTimePicker.cs
- RuntimeWrappedException.cs
- SafeProcessHandle.cs
- MutableAssemblyCacheEntry.cs
- OracleDataAdapter.cs
- XamlClipboardData.cs
- SqlReorderer.cs
- Overlapped.cs
- URLMembershipCondition.cs
- SettingsPropertyValueCollection.cs
- VirtualPath.cs
- Guid.cs
- RedistVersionInfo.cs
- UInt16.cs
- ErrorInfoXmlDocument.cs
- FlowDocumentPageViewerAutomationPeer.cs
- LockCookie.cs
- Utils.cs
- Models.cs
- InputBuffer.cs
- ThreadExceptionDialog.cs
- XmlReturnReader.cs
- SynchronizedDispatch.cs
- SpellCheck.cs
- LinkArea.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- TableLayoutSettingsTypeConverter.cs
- RayHitTestParameters.cs
- mediapermission.cs
- UDPClient.cs
- XsdBuildProvider.cs
- NetWebProxyFinder.cs
- FilteredDataSetHelper.cs
- BindingsCollection.cs
- DbConnectionInternal.cs
- DesignerMetadata.cs
- BitVector32.cs
- FactoryRecord.cs
- ToolStripDropDownMenu.cs
- TTSVoice.cs
- X509ServiceCertificateAuthenticationElement.cs
- Encoder.cs
- MaskedTextBoxTextEditorDropDown.cs
- ControlParameter.cs
- XmlEncoding.cs
- CultureInfoConverter.cs
- KeyTimeConverter.cs
- columnmapkeybuilder.cs
- FigureHelper.cs
- PreviewPrintController.cs
- CookieParameter.cs
- ScrollEventArgs.cs
- Byte.cs
- SessionPageStatePersister.cs
- NamespaceExpr.cs
- XmlCDATASection.cs
- EntityContainerAssociationSet.cs
- DataGridViewCellStateChangedEventArgs.cs
- DependencyPropertyConverter.cs
- ZipArchive.cs
- SqlWorkflowPersistenceService.cs
- ApplicationSecurityManager.cs
- TouchesCapturedWithinProperty.cs