Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / QIL / SubstitutionList.cs / 1305376 / SubstitutionList.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- using System; using System.Collections; using System.Diagnostics; namespace System.Xml.Xsl.Qil { ////// Data structure for use in CloneAndReplace /// ///Isolates the many QilNode classes from changes in /// the underlying data structure. internal sealed class SubstitutionList { // private ArrayList s; public SubstitutionList() { this.s = new ArrayList(4); } ////// Add a substituion pair /// /// a node to be replaced /// its replacement public void AddSubstitutionPair(QilNode find, QilNode replace) { s.Add(find); s.Add(replace); } ////// Remove the last a substituion pair /// public void RemoveLastSubstitutionPair() { s.RemoveRange(s.Count - 2, 2); } ////// Remove the last N substitution pairs /// public void RemoveLastNSubstitutionPairs(int n) { Debug.Assert(n >= 0, "n must be nonnegative"); if (n > 0) { n *= 2; s.RemoveRange(s.Count - n, n); } } ////// Find the replacement for a node /// /// the node to replace ///null if no replacement is found public QilNode FindReplacement(QilNode n) { Debug.Assert(s.Count % 2 == 0); for (int i = s.Count-2; i >= 0; i-=2) if (s[i] == n) return (QilNode)s[i+1]; return null; } } } // 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
- SafeHandle.cs
- Point3DAnimation.cs
- SliderAutomationPeer.cs
- DefaultAssemblyResolver.cs
- PrintingPermissionAttribute.cs
- Grid.cs
- WSHttpBindingBaseElement.cs
- WindowsPen.cs
- BuildManager.cs
- DiscardableAttribute.cs
- LocatorGroup.cs
- SqlGenericUtil.cs
- CustomCategoryAttribute.cs
- ListViewAutomationPeer.cs
- ThreadSafeMessageFilterTable.cs
- ParsedAttributeCollection.cs
- XMLDiffLoader.cs
- EventLogPermission.cs
- MetadataArtifactLoaderResource.cs
- RSAProtectedConfigurationProvider.cs
- HttpFormatExtensions.cs
- PointCollection.cs
- RegistrySecurity.cs
- EdmComplexTypeAttribute.cs
- PipelineComponent.cs
- SubMenuStyleCollection.cs
- FullTextState.cs
- VirtualizingPanel.cs
- TdsParserSafeHandles.cs
- RegexFCD.cs
- DesignerToolStripControlHost.cs
- WebEventCodes.cs
- XmlElementList.cs
- PageCache.cs
- MsmqException.cs
- NetworkAddressChange.cs
- MappingItemCollection.cs
- Parameter.cs
- CollectionChangedEventManager.cs
- GroupItemAutomationPeer.cs
- DynamicRendererThreadManager.cs
- FileDialog.cs
- RemotingSurrogateSelector.cs
- StatusBarAutomationPeer.cs
- DbDataAdapter.cs
- HotSpot.cs
- PreviewControlDesigner.cs
- CompilationUtil.cs
- FontNamesConverter.cs
- FlowDocumentFormatter.cs
- MeasurementDCInfo.cs
- ToolStripItemCollection.cs
- DockPanel.cs
- CatalogZoneBase.cs
- NameTable.cs
- RoutingExtensionElement.cs
- AutomationAttributeInfo.cs
- GenericTypeParameterBuilder.cs
- XmlArrayItemAttribute.cs
- AuthenticationSection.cs
- SafeNativeMethods.cs
- QuaternionIndependentAnimationStorage.cs
- PagePropertiesChangingEventArgs.cs
- DBCSCodePageEncoding.cs
- ExpandSegmentCollection.cs
- XamlToRtfWriter.cs
- ProtocolsSection.cs
- documentsequencetextcontainer.cs
- ZipIOExtraField.cs
- PropertyMetadata.cs
- ListControlConvertEventArgs.cs
- TrustSection.cs
- metadatamappinghashervisitor.cs
- ErrorBehavior.cs
- DashStyle.cs
- ScriptReferenceEventArgs.cs
- ObjectDataSourceDesigner.cs
- VirtualPathUtility.cs
- DaylightTime.cs
- DependencyObject.cs
- CodeActivity.cs
- TextPattern.cs
- ToolStripScrollButton.cs
- MenuCommand.cs
- DefaultAssemblyResolver.cs
- TagNameToTypeMapper.cs
- TagPrefixInfo.cs
- Directory.cs
- Facet.cs
- ApplicationFileCodeDomTreeGenerator.cs
- HostingEnvironmentException.cs
- PropertyChangingEventArgs.cs
- TextChange.cs
- BaseAddressPrefixFilterElement.cs
- GorillaCodec.cs
- SchemaConstraints.cs
- FormatterConverter.cs
- SimpleWebHandlerParser.cs
- DocumentXPathNavigator.cs
- Literal.cs