Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / Avt.cs / 1 / 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
- Drawing.cs
- AdCreatedEventArgs.cs
- TemplateBindingExpression.cs
- Pen.cs
- DotExpr.cs
- GridViewSelectEventArgs.cs
- EncryptedPackageFilter.cs
- FixedSOMLineCollection.cs
- ViewgenContext.cs
- PolyLineSegment.cs
- TrackingExtract.cs
- EFColumnProvider.cs
- DocumentViewer.cs
- CodeGen.cs
- XmlILIndex.cs
- UnitControl.cs
- PrimitiveXmlSerializers.cs
- GetWinFXPath.cs
- XmlSchemaAttributeGroup.cs
- InputMethodStateChangeEventArgs.cs
- Win32PrintDialog.cs
- FixedSOMLineCollection.cs
- HttpStreamXmlDictionaryWriter.cs
- CreatingCookieEventArgs.cs
- SiteMapProvider.cs
- ControlUtil.cs
- CommonObjectSecurity.cs
- PointLight.cs
- ArgumentException.cs
- ToolStripContainerActionList.cs
- XsltFunctions.cs
- TemplateBindingExpression.cs
- TextTreePropertyUndoUnit.cs
- ListViewCancelEventArgs.cs
- BmpBitmapEncoder.cs
- Substitution.cs
- Win32Exception.cs
- StrongNameIdentityPermission.cs
- EncodedStreamFactory.cs
- PersonalizationStateInfo.cs
- TypeGeneratedEventArgs.cs
- XPathAncestorQuery.cs
- X509ChainElement.cs
- ControlTemplate.cs
- DBCommandBuilder.cs
- PingOptions.cs
- MaskInputRejectedEventArgs.cs
- TabItem.cs
- FlatButtonAppearance.cs
- CollectionViewSource.cs
- WebPartTransformerAttribute.cs
- ListViewTableRow.cs
- WebBrowserNavigatedEventHandler.cs
- XmlWellformedWriter.cs
- SecurityDocument.cs
- Form.cs
- StateManagedCollection.cs
- DateTimePickerDesigner.cs
- RenderData.cs
- CompilerInfo.cs
- DispatchWrapper.cs
- KeysConverter.cs
- ValuePattern.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- Style.cs
- XamlPointCollectionSerializer.cs
- PolicyLevel.cs
- MsmqAppDomainProtocolHandler.cs
- ToolStripPanelCell.cs
- ResourceDescriptionAttribute.cs
- WebPartTracker.cs
- ToolStripDropDownClosingEventArgs.cs
- SafeFileHandle.cs
- StylusPointDescription.cs
- FilterException.cs
- WindowsStartMenu.cs
- SelectionRange.cs
- Function.cs
- WindowsIPAddress.cs
- BinHexDecoder.cs
- WebPartConnectionsCancelEventArgs.cs
- EventToken.cs
- ModuleBuilder.cs
- JavaScriptSerializer.cs
- _ConnectStream.cs
- CqlParserHelpers.cs
- ConfigurationPermission.cs
- ZipIOCentralDirectoryFileHeader.cs
- Expr.cs
- CounterSampleCalculator.cs
- ConfigXmlElement.cs
- CookielessData.cs
- TableCell.cs
- DependencyPropertyValueSerializer.cs
- SystemException.cs
- ExclusiveHandle.cs
- SettingsPropertyNotFoundException.cs
- CacheMemory.cs
- AesManaged.cs
- SignatureConfirmationElement.cs