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
- XPathAncestorQuery.cs
- WebEvents.cs
- XPathPatternBuilder.cs
- DbDataAdapter.cs
- JavascriptXmlWriterWrapper.cs
- SelectionProviderWrapper.cs
- IItemProperties.cs
- ZoneLinkButton.cs
- PageContentCollection.cs
- BaseDataBoundControl.cs
- DictionaryEntry.cs
- MasterPageBuildProvider.cs
- HeaderUtility.cs
- HMACRIPEMD160.cs
- CollectionViewGroup.cs
- XmlSiteMapProvider.cs
- sortedlist.cs
- ImageCodecInfo.cs
- QueryOptionExpression.cs
- DictionaryBase.cs
- FunctionImportMapping.cs
- ChangePassword.cs
- PassportAuthentication.cs
- XmlMemberMapping.cs
- CodeNamespaceCollection.cs
- CustomErrorsSectionWrapper.cs
- AnnotationResourceCollection.cs
- ContentIterators.cs
- RenameRuleObjectDialog.cs
- StrokeSerializer.cs
- BeginSelectCardRequest.cs
- DebugControllerThread.cs
- FixedBufferAttribute.cs
- Control.cs
- UncommonField.cs
- WriteableBitmap.cs
- ErrorStyle.cs
- TableItemStyle.cs
- SoapIncludeAttribute.cs
- TableRowGroup.cs
- RowToFieldTransformer.cs
- _Semaphore.cs
- TemplateXamlTreeBuilder.cs
- TextContainer.cs
- PointAnimationUsingKeyFrames.cs
- QilLiteral.cs
- UserControlBuildProvider.cs
- Item.cs
- IISMapPath.cs
- JobPageOrder.cs
- ReadOnlyHierarchicalDataSourceView.cs
- DataChangedEventManager.cs
- FacetChecker.cs
- HostingEnvironmentException.cs
- HandleRef.cs
- TagPrefixInfo.cs
- VariableDesigner.xaml.cs
- ReadOnlyHierarchicalDataSource.cs
- Schema.cs
- StorageScalarPropertyMapping.cs
- MailWriter.cs
- path.cs
- DataPagerFieldItem.cs
- RowUpdatedEventArgs.cs
- HttpCacheVaryByContentEncodings.cs
- UInt32Converter.cs
- objectquery_tresulttype.cs
- DataGridColumn.cs
- IndentedTextWriter.cs
- Baml2006Reader.cs
- LoginAutoFormat.cs
- ConfigurationElement.cs
- SchemaMerger.cs
- QilStrConcatenator.cs
- ResetableIterator.cs
- Helper.cs
- XsdDuration.cs
- DesignBindingValueUIHandler.cs
- EmbeddedMailObjectCollectionEditor.cs
- datacache.cs
- SqlClientPermission.cs
- StylusPointDescription.cs
- LoginUtil.cs
- XmlSchemaExporter.cs
- RawStylusInputCustomData.cs
- MimeMapping.cs
- SchemaMerger.cs
- ComponentEvent.cs
- RepeaterItem.cs
- LinkClickEvent.cs
- TdsParser.cs
- ReflectionServiceProvider.cs
- ValidatingPropertiesEventArgs.cs
- TextServicesLoader.cs
- TextFormatter.cs
- ProvideValueServiceProvider.cs
- XsltCompileContext.cs
- ColumnHeaderConverter.cs
- SafeCloseHandleCritical.cs
- BufferModesCollection.cs