Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / Xslt / QilStrConcatenator.cs / 1305376 / QilStrConcatenator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- using System.Diagnostics; using System.Xml; using System.Text; using System.Xml.Schema; using System.Xml.Xsl.XPath; using System.Xml.Xsl.Qil; namespace System.Xml.Xsl.Xslt { internal class QilStrConcatenator { private XPathQilFactory f; private StringBuilder builder; private QilList concat; private bool inUse = false; public QilStrConcatenator(XPathQilFactory f) { this.f = f; builder = new StringBuilder(); } public void Reset() { Debug.Assert(! inUse); inUse = true; builder.Length = 0; concat = null; } private void FlushBuilder() { if (concat == null) { concat = f.BaseFactory.Sequence(); } if (builder.Length != 0) { concat.Add(f.String(builder.ToString())); builder.Length = 0; } } public void Append(string value) { Debug.Assert(inUse, "Reset() wasn't called"); builder.Append(value); } public void Append(char value) { Debug.Assert(inUse, "Reset() wasn't called"); builder.Append(value); } public void Append(QilNode value) { Debug.Assert(inUse, "Reset() wasn't called"); if (value != null) { Debug.Assert(value.XmlType.TypeCode == XmlTypeCode.String); if (value.NodeType == QilNodeType.LiteralString) { builder.Append((string)(QilLiteral)value); } else { FlushBuilder(); concat.Add(value); } } } public QilNode ToQil() { Debug.Assert(inUse); // If we want allow multiple calls to ToQil() this logic should be changed inUse = false; if (concat == null) { return f.String(builder.ToString()); } else { FlushBuilder(); return f.StrConcat(concat); } } } } // 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
- KerberosSecurityTokenProvider.cs
- ExtensionSimplifierMarkupObject.cs
- PageVisual.cs
- BuildProvider.cs
- AppliesToBehaviorDecisionTable.cs
- TiffBitmapDecoder.cs
- CaseStatementProjectedSlot.cs
- DbConnectionPoolOptions.cs
- TypeSemantics.cs
- MinimizableAttributeTypeConverter.cs
- Debug.cs
- DataGridViewSelectedColumnCollection.cs
- SoapUnknownHeader.cs
- HebrewCalendar.cs
- ListMarkerSourceInfo.cs
- TransformerConfigurationWizardBase.cs
- AutomationProperties.cs
- TdsParserSessionPool.cs
- CommandPlan.cs
- PerformanceCounterLib.cs
- PersonalizationState.cs
- SafeHandles.cs
- MimeReflector.cs
- JournalEntry.cs
- GenericIdentity.cs
- CacheManager.cs
- Geometry.cs
- ImageKeyConverter.cs
- SafeTimerHandle.cs
- D3DImage.cs
- SizeLimitedCache.cs
- DataGridViewRowHeaderCell.cs
- StickyNoteAnnotations.cs
- SecureEnvironment.cs
- VarInfo.cs
- UmAlQuraCalendar.cs
- StateChangeEvent.cs
- OleCmdHelper.cs
- CompositeControl.cs
- Bits.cs
- NativeCompoundFileAPIs.cs
- FixedStringLookup.cs
- ButtonFlatAdapter.cs
- ChildrenQuery.cs
- XmlCDATASection.cs
- NullRuntimeConfig.cs
- DataSourceCache.cs
- WorkflowMarkupSerializer.cs
- SiblingIterators.cs
- MdImport.cs
- GenericPrincipal.cs
- AssemblyAttributesGoHere.cs
- HttpModule.cs
- FastEncoderWindow.cs
- EventRoute.cs
- WindowsSolidBrush.cs
- TextFragmentEngine.cs
- WebPartsSection.cs
- FloatMinMaxAggregationOperator.cs
- FixedSOMImage.cs
- UnwrappedTypesXmlSerializerManager.cs
- path.cs
- Properties.cs
- MouseButton.cs
- DataGridRowClipboardEventArgs.cs
- _ConnectionGroup.cs
- IconHelper.cs
- ImageButton.cs
- RichTextBox.cs
- QuadraticEase.cs
- CompiledAction.cs
- ErrorRuntimeConfig.cs
- MetaModel.cs
- TemplatedMailWebEventProvider.cs
- Util.cs
- PackWebResponse.cs
- ZipIOLocalFileHeader.cs
- TreeIterators.cs
- TextureBrush.cs
- ArgumentNullException.cs
- TreeNode.cs
- EnumValAlphaComparer.cs
- ProfileEventArgs.cs
- RuntimeVariablesExpression.cs
- Rotation3DKeyFrameCollection.cs
- OdbcCommand.cs
- _ConnectionGroup.cs
- PartialCachingAttribute.cs
- _NTAuthentication.cs
- DataAdapter.cs
- KoreanCalendar.cs
- Descriptor.cs
- SqlUdtInfo.cs
- CompilationUtil.cs
- ToolStripPanelRenderEventArgs.cs
- CounterCreationData.cs
- ObjRef.cs
- TypeAccessException.cs
- SendKeys.cs
- DbExpressionVisitor_TResultType.cs