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
- SqlDataSourceView.cs
- UTF7Encoding.cs
- FacetEnabledSchemaElement.cs
- CreateRefExpr.cs
- DataExpression.cs
- ListControlConvertEventArgs.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- Line.cs
- securitymgrsite.cs
- ToolboxItemFilterAttribute.cs
- IndentedWriter.cs
- TagPrefixInfo.cs
- LicenseException.cs
- UnsafeNativeMethods.cs
- documentsequencetextview.cs
- SmtpException.cs
- EventMappingSettings.cs
- FamilyTypeface.cs
- ActivityMarkupSerializationProvider.cs
- TriggerAction.cs
- OutputCacheModule.cs
- SqlExpressionNullability.cs
- AttributeCollection.cs
- SemanticResultValue.cs
- IsolatedStorageFileStream.cs
- Activation.cs
- PeerInputChannelListener.cs
- LinqDataSourceContextEventArgs.cs
- NetWebProxyFinder.cs
- ArgIterator.cs
- HandlerWithFactory.cs
- LayoutUtils.cs
- GorillaCodec.cs
- BaseParaClient.cs
- PlatformNotSupportedException.cs
- StreamInfo.cs
- DbProviderFactoriesConfigurationHandler.cs
- Trace.cs
- HttpServerVarsCollection.cs
- Enumerable.cs
- RegexCode.cs
- AdapterUtil.cs
- XamlInterfaces.cs
- DBCommand.cs
- HttpConfigurationContext.cs
- ImageClickEventArgs.cs
- StorageInfo.cs
- xsdvalidator.cs
- Int32CollectionConverter.cs
- SafeNativeMethods.cs
- GlyphRunDrawing.cs
- TransportReplyChannelAcceptor.cs
- RotateTransform.cs
- SqlConnectionStringBuilder.cs
- PrivilegedConfigurationManager.cs
- XPathEmptyIterator.cs
- PositiveTimeSpanValidatorAttribute.cs
- ScriptManager.cs
- UIElement3DAutomationPeer.cs
- RoleManagerEventArgs.cs
- SmtpFailedRecipientsException.cs
- GenerateHelper.cs
- CompositionAdorner.cs
- TableLayoutRowStyleCollection.cs
- View.cs
- MetadataItemEmitter.cs
- QilChoice.cs
- ObjectDataSourceSelectingEventArgs.cs
- ResponseBodyWriter.cs
- RawStylusInputCustomData.cs
- ListViewInsertEventArgs.cs
- PostBackOptions.cs
- ManagementEventArgs.cs
- ToolStripDropDownItemDesigner.cs
- MemberHolder.cs
- TextBox.cs
- DbConnectionPoolIdentity.cs
- DataGridParentRows.cs
- QilList.cs
- Symbol.cs
- DataPager.cs
- PersonalizationAdministration.cs
- SqlDataSourceTableQuery.cs
- QueryStoreStatusRequest.cs
- RuntimeEnvironment.cs
- CustomWebEventKey.cs
- Timer.cs
- InternalsVisibleToAttribute.cs
- AttributeCollection.cs
- SqlDataSourceEnumerator.cs
- IsolatedStoragePermission.cs
- CompiledQuery.cs
- Propagator.JoinPropagator.cs
- DiagnosticTrace.cs
- ComboBoxRenderer.cs
- XmlSchemaSimpleTypeRestriction.cs
- CodeLinePragma.cs
- CqlBlock.cs
- DnsEndpointIdentity.cs
- StorageEntityTypeMapping.cs