Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / Runtime / XmlILIndex.cs / 1305376 / XmlILIndex.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Xml.XPath; namespace System.Xml.Xsl.Runtime { ////// This class manages nodes from one input document, indexed by key value(s). /// [EditorBrowsable(EditorBrowsableState.Never)] public sealed class XmlILIndex { private Dictionarytable; /// /// This constructor is internal so that external users cannot construct it (and therefore we do not have to test it separately). /// internal XmlILIndex() { this.table = new Dictionary(); } /// /// Add a node indexed by the specified key value. /// public void Add(string key, XPathNavigator navigator) { XmlQueryNodeSequence seq; if (!this.table.TryGetValue(key, out seq)) { // Create a new sequence and add it to the index seq = new XmlQueryNodeSequence(); seq.AddClone(navigator); this.table.Add(key, seq); } else { // The nodes are guaranteed to be added in document order with possible duplicates. // Add node to the existing sequence if it differs from the last one. Debug.Assert(navigator.ComparePosition(seq[seq.Count - 1]) >= 0, "Index nodes must be added in document order"); if (!navigator.IsSamePosition(seq[seq.Count - 1])) { seq.AddClone(navigator); } } } ////// Lookup a sequence of nodes that are indexed by the specified key value. /// Return a non-null empty sequence, if there are no nodes associated with the key. /// public XmlQueryNodeSequence Lookup(string key) { XmlQueryNodeSequence seq; if (!this.table.TryGetValue(key, out seq)) seq = new XmlQueryNodeSequence(); return seq; } } } // 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
- WebEncodingValidator.cs
- ReadOnlyNameValueCollection.cs
- PropertyStore.cs
- AutomationPatternInfo.cs
- ListViewGroupCollectionEditor.cs
- CollectionDataContract.cs
- ProfileSettingsCollection.cs
- ControlCachePolicy.cs
- Misc.cs
- LocalizableResourceBuilder.cs
- SR.Designer.cs
- XmlILModule.cs
- RoleManagerSection.cs
- PackageRelationship.cs
- TypeLibConverter.cs
- SelectingProviderEventArgs.cs
- ZipIORawDataFileBlock.cs
- CompositeScriptReference.cs
- SelectedDatesCollection.cs
- CheckBox.cs
- StorageAssociationSetMapping.cs
- EntityDataSourceValidationException.cs
- RouteValueExpressionBuilder.cs
- IPEndPoint.cs
- Win32Exception.cs
- XmlQueryCardinality.cs
- TargetException.cs
- DataViewManager.cs
- Size.cs
- CqlErrorHelper.cs
- GeometryModel3D.cs
- ZeroOpNode.cs
- XmlElementList.cs
- CategoriesDocumentFormatter.cs
- Html32TextWriter.cs
- PeerNeighborManager.cs
- DataGridView.cs
- PackWebRequestFactory.cs
- PageThemeParser.cs
- CryptoProvider.cs
- SimpleTypeResolver.cs
- CompatibleComparer.cs
- ConfigurationPermission.cs
- Light.cs
- CachedFontFace.cs
- ColumnHeaderConverter.cs
- RightsManagementEncryptionTransform.cs
- AddInController.cs
- AppSettingsReader.cs
- ImplicitInputBrush.cs
- TextLineResult.cs
- TraceContext.cs
- MachineKeyConverter.cs
- KeyValuePairs.cs
- MetadataArtifactLoaderFile.cs
- MediaElementAutomationPeer.cs
- ControlBuilder.cs
- OptimisticConcurrencyException.cs
- ItemChangedEventArgs.cs
- XmlTextReaderImplHelpers.cs
- StrokeNodeOperations.cs
- XmlComplianceUtil.cs
- WindowsSysHeader.cs
- Tile.cs
- PersistenceTypeAttribute.cs
- XPathNodeInfoAtom.cs
- ParagraphVisual.cs
- COSERVERINFO.cs
- SchemaRegistration.cs
- WasAdminWrapper.cs
- TypographyProperties.cs
- NullableLongMinMaxAggregationOperator.cs
- WebPartCancelEventArgs.cs
- FlowDecision.cs
- Panel.cs
- SqlCacheDependency.cs
- XmlSchemaComplexType.cs
- Operand.cs
- PageThemeBuildProvider.cs
- ErrorsHelper.cs
- Label.cs
- OfTypeExpression.cs
- DynamicResourceExtension.cs
- TemporaryBitmapFile.cs
- SQLChars.cs
- EventBuilder.cs
- ConfigurationElement.cs
- NativeMethodsCLR.cs
- TextTreeUndoUnit.cs
- Visual3DCollection.cs
- Lease.cs
- OdbcEnvironment.cs
- RenamedEventArgs.cs
- IdlingCommunicationPool.cs
- FixUp.cs
- ResourceContainerWrapper.cs
- SystemException.cs
- ellipse.cs
- SettingsAttributeDictionary.cs
- BoundColumn.cs