Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / Avt.cs / 1305376 / Avt.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.Xsl.XsltOld { using Res = System.Xml.Utils.Res; using System; using System.Diagnostics; using System.Collections; using System.Xml; using System.Xml.XPath; using System.Text; internal sealed class Avt { private string constAvt; private TextEvent[] events; private Avt(string constAvt) { Debug.Assert(constAvt != null); this.constAvt = constAvt; } private Avt(ArrayList eventList) { Debug.Assert(eventList != null); this.events = new TextEvent[eventList.Count]; for(int i = 0; i < eventList.Count; i ++) { this.events[i] = (TextEvent) eventList[i]; } } public bool IsConstant { get {return this.events == null;} } internal string Evaluate(Processor processor, ActionFrame frame) { if (IsConstant) { Debug.Assert(constAvt != null); return constAvt; } else { Debug.Assert(processor != null && frame != null); StringBuilder builder = processor.GetSharedStringBuilder(); for(int i = 0; i < events.Length; i ++) { builder.Append(events[i].Evaluate(processor, frame)); } processor.ReleaseSharedStringBuilder(); return builder.ToString(); } } internal static Avt CompileAvt(Compiler compiler, string avtText) { Debug.Assert(compiler != null); Debug.Assert(avtText != null); bool constant; ArrayList list = compiler.CompileAvt(avtText, out constant); return constant ? new Avt(avtText) : new Avt(list); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml.Xsl.XsltOld { using Res = System.Xml.Utils.Res; using System; using System.Diagnostics; using System.Collections; using System.Xml; using System.Xml.XPath; using System.Text; internal sealed class Avt { private string constAvt; private TextEvent[] events; private Avt(string constAvt) { Debug.Assert(constAvt != null); this.constAvt = constAvt; } private Avt(ArrayList eventList) { Debug.Assert(eventList != null); this.events = new TextEvent[eventList.Count]; for(int i = 0; i < eventList.Count; i ++) { this.events[i] = (TextEvent) eventList[i]; } } public bool IsConstant { get {return this.events == null;} } internal string Evaluate(Processor processor, ActionFrame frame) { if (IsConstant) { Debug.Assert(constAvt != null); return constAvt; } else { Debug.Assert(processor != null && frame != null); StringBuilder builder = processor.GetSharedStringBuilder(); for(int i = 0; i < events.Length; i ++) { builder.Append(events[i].Evaluate(processor, frame)); } processor.ReleaseSharedStringBuilder(); return builder.ToString(); } } internal static Avt CompileAvt(Compiler compiler, string avtText) { Debug.Assert(compiler != null); Debug.Assert(avtText != null); bool constant; ArrayList list = compiler.CompileAvt(avtText, out constant); return constant ? new Avt(avtText) : new Avt(list); } } } // 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
- EntitySqlQueryCacheKey.cs
- SpeakCompletedEventArgs.cs
- OracleConnectionStringBuilder.cs
- MetafileHeader.cs
- StringConcat.cs
- DodSequenceMerge.cs
- XmlReaderSettings.cs
- FacetChecker.cs
- ProviderSettings.cs
- CustomAssemblyResolver.cs
- EntityAdapter.cs
- EventPropertyMap.cs
- Italic.cs
- ComboBoxRenderer.cs
- DateTimeStorage.cs
- VarRemapper.cs
- Utility.cs
- SetStateEventArgs.cs
- InfoCardArgumentException.cs
- UnionExpr.cs
- CodeThrowExceptionStatement.cs
- DictionaryKeyPropertyAttribute.cs
- WpfPayload.cs
- CredentialCache.cs
- BitmapEffectRenderDataResource.cs
- TokenBasedSet.cs
- UrlMappingsSection.cs
- SelectionProviderWrapper.cs
- GradientBrush.cs
- StringWriter.cs
- ConnectivityStatus.cs
- OdbcConnectionStringbuilder.cs
- TypeDelegator.cs
- TextTreeInsertUndoUnit.cs
- ExceptionUtil.cs
- HtmlUtf8RawTextWriter.cs
- BaseCodePageEncoding.cs
- ContainerCodeDomSerializer.cs
- RowParagraph.cs
- SchemaInfo.cs
- ConnectionPoolManager.cs
- SystemWebCachingSectionGroup.cs
- SQLByteStorage.cs
- Marshal.cs
- HttpDictionary.cs
- LinqDataSourceStatusEventArgs.cs
- DataKey.cs
- MimeReturn.cs
- WinInetCache.cs
- CssStyleCollection.cs
- ModelVisual3D.cs
- PersonalizablePropertyEntry.cs
- ExecutionContext.cs
- ComponentChangingEvent.cs
- ContainerControlDesigner.cs
- XmlQueryCardinality.cs
- EnumDataContract.cs
- ConfigXmlComment.cs
- RemoteWebConfigurationHostServer.cs
- BindingBase.cs
- FontStretches.cs
- EDesignUtil.cs
- GrowingArray.cs
- DocumentPage.cs
- GridSplitterAutomationPeer.cs
- TabItem.cs
- NameValuePair.cs
- CommandHelpers.cs
- LinkLabelLinkClickedEvent.cs
- XmlSchemaType.cs
- LogEntrySerializationException.cs
- HotSpot.cs
- AssertUtility.cs
- LineGeometry.cs
- LocalClientSecuritySettingsElement.cs
- odbcmetadatafactory.cs
- Solver.cs
- EntityDescriptor.cs
- XLinq.cs
- QueryableFilterRepeater.cs
- HttpTransportElement.cs
- VariableElement.cs
- TypeUsageBuilder.cs
- Collection.cs
- MemberAccessException.cs
- ImageList.cs
- WindowsFormsHostPropertyMap.cs
- XPathSelfQuery.cs
- CodeDomDesignerLoader.cs
- FeatureAttribute.cs
- ConfigXmlDocument.cs
- HtmlSelect.cs
- RsaSecurityKey.cs
- HttpModuleActionCollection.cs
- GeneralTransform3D.cs
- updateconfighost.cs
- NodeLabelEditEvent.cs
- Clipboard.cs
- XPathNavigatorException.cs
- LineSegment.cs