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
- AsnEncodedData.cs
- HttpRawResponse.cs
- EntitySetBaseCollection.cs
- NullableBoolConverter.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- ToolBarPanel.cs
- XmlSchemaRedefine.cs
- XNameConverter.cs
- QilInvoke.cs
- DynamicPropertyHolder.cs
- RuntimeConfigLKG.cs
- DiscoveryDocumentLinksPattern.cs
- VarRefManager.cs
- ConfigurationLockCollection.cs
- TimeZone.cs
- DefaultEvaluationContext.cs
- ConfigurationManagerHelperFactory.cs
- DesignerLoader.cs
- MetadataItemEmitter.cs
- Transform3DCollection.cs
- BuildProviderCollection.cs
- IisTraceListener.cs
- ImageButton.cs
- PreviewPrintController.cs
- TableLayoutSettingsTypeConverter.cs
- Tuple.cs
- JsonClassDataContract.cs
- Material.cs
- MonthChangedEventArgs.cs
- SynchronizationContext.cs
- UrlPath.cs
- MeasurementDCInfo.cs
- AsyncOperationManager.cs
- CommunicationObjectFaultedException.cs
- SafeFileMappingHandle.cs
- DesignerAdapterAttribute.cs
- RefType.cs
- InputLanguageManager.cs
- WorkflowMarkupSerializationProvider.cs
- LoadedEvent.cs
- FileFormatException.cs
- PageMediaType.cs
- SHA512.cs
- UserPersonalizationStateInfo.cs
- PrintDocument.cs
- IdentityReference.cs
- SqlDataSource.cs
- TypeValidationEventArgs.cs
- mongolianshape.cs
- unsafeIndexingFilterStream.cs
- IdentityReference.cs
- XmlHelper.cs
- _AuthenticationState.cs
- ListDataBindEventArgs.cs
- SqlFactory.cs
- TableProviderWrapper.cs
- SqlConnection.cs
- SystemIPInterfaceStatistics.cs
- SmiConnection.cs
- TypeDescriptor.cs
- StatusBarItem.cs
- CombinedHttpChannel.cs
- HwndAppCommandInputProvider.cs
- ApplicationActivator.cs
- WizardPanel.cs
- MinimizableAttributeTypeConverter.cs
- NetworkAddressChange.cs
- NullableIntAverageAggregationOperator.cs
- CodeTypeMember.cs
- GlyphRun.cs
- TripleDESCryptoServiceProvider.cs
- WebBrowser.cs
- WebScriptMetadataFormatter.cs
- ToolConsole.cs
- WindowsTooltip.cs
- WebContext.cs
- ExceptionAggregator.cs
- DiscoveryClientOutputChannel.cs
- PathGradientBrush.cs
- BlurEffect.cs
- PackageController.cs
- TypeBuilder.cs
- InputQueueChannel.cs
- WorkflowServiceAttributesTypeConverter.cs
- QilPatternFactory.cs
- ThrowHelper.cs
- RepeaterItemEventArgs.cs
- QuotedPairReader.cs
- ActiveXHost.cs
- WebPartDesigner.cs
- OrderByQueryOptionExpression.cs
- XmlWrappingReader.cs
- StackOverflowException.cs
- Ops.cs
- X509ThumbprintKeyIdentifierClause.cs
- Single.cs
- QueueTransferProtocol.cs
- HttpHandlerAction.cs
- DbgCompiler.cs
- ItemCollection.cs