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
- TemplateInstanceAttribute.cs
- ValueHandle.cs
- MethodImplAttribute.cs
- Vector3DAnimationUsingKeyFrames.cs
- MappingItemCollection.cs
- EncryptedData.cs
- Label.cs
- Rect.cs
- ReflectionUtil.cs
- TextParagraph.cs
- _TransmitFileOverlappedAsyncResult.cs
- Path.cs
- ConfigUtil.cs
- ReceiveContext.cs
- Accessible.cs
- FontConverter.cs
- AccessDataSourceView.cs
- DropDownButton.cs
- XmlAnyAttributeAttribute.cs
- DesignerCommandSet.cs
- GlobalItem.cs
- DefaultPropertyAttribute.cs
- HotSpotCollection.cs
- ReferencedCollectionType.cs
- AdPostCacheSubstitution.cs
- WmfPlaceableFileHeader.cs
- SafeHandles.cs
- IProducerConsumerCollection.cs
- SafeRightsManagementSessionHandle.cs
- ConnectionManagementElementCollection.cs
- WpfXamlType.cs
- OleDbConnectionFactory.cs
- ToolStripArrowRenderEventArgs.cs
- MetadataFile.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- CodeSnippetExpression.cs
- WebSysDescriptionAttribute.cs
- RelationshipEndCollection.cs
- ProfileBuildProvider.cs
- WeakReferenceList.cs
- XXXOnTypeBuilderInstantiation.cs
- Attributes.cs
- MsmqHostedTransportConfiguration.cs
- TransactionOptions.cs
- MarkupObject.cs
- CodeStatementCollection.cs
- DefaultValueConverter.cs
- DataGridViewLinkCell.cs
- PageBuildProvider.cs
- SoapRpcServiceAttribute.cs
- Collection.cs
- ContextBase.cs
- _HelperAsyncResults.cs
- TextTreeRootNode.cs
- Setter.cs
- HttpRequestCacheValidator.cs
- GC.cs
- TabItemAutomationPeer.cs
- DataGridViewRowCancelEventArgs.cs
- GuidConverter.cs
- ConfigurationLocationCollection.cs
- ICspAsymmetricAlgorithm.cs
- AppearanceEditorPart.cs
- TreeWalker.cs
- PackWebRequest.cs
- DetailsViewPageEventArgs.cs
- recordstatescratchpad.cs
- DoubleIndependentAnimationStorage.cs
- PowerModeChangedEventArgs.cs
- ListDesigner.cs
- WindowProviderWrapper.cs
- OdbcCommandBuilder.cs
- RegexFCD.cs
- DateTimeFormatInfoScanner.cs
- X509CertificateTrustedIssuerElement.cs
- PropertyGeneratedEventArgs.cs
- CriticalFinalizerObject.cs
- NetworkAddressChange.cs
- HtmlInputControl.cs
- LineServicesCallbacks.cs
- TraceXPathNavigator.cs
- XmlDataImplementation.cs
- Brush.cs
- NotifyParentPropertyAttribute.cs
- SqlCommandSet.cs
- DBCommand.cs
- DispatcherObject.cs
- ExtendedPropertyDescriptor.cs
- EndpointDiscoveryBehavior.cs
- ResXFileRef.cs
- DateTimeAutomationPeer.cs
- DataView.cs
- Adorner.cs
- CachedBitmap.cs
- DataGridViewHeaderCell.cs
- NamedElement.cs
- DataGridViewColumnTypePicker.cs
- DbModificationClause.cs
- DefaultTraceListener.cs
- SymDocumentType.cs