Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- VirtualPathUtility.cs
- DBSchemaTable.cs
- VersionedStream.cs
- SynchronizedDispatch.cs
- ThrowHelper.cs
- Debug.cs
- ProfileParameter.cs
- StylusPointDescription.cs
- PropertyNames.cs
- ComplexTypeEmitter.cs
- RuntimeConfig.cs
- TagMapInfo.cs
- SectionInput.cs
- XsltOutput.cs
- filewebrequest.cs
- ResourceExpressionBuilder.cs
- DbReferenceCollection.cs
- Rectangle.cs
- PageWrapper.cs
- ViewValidator.cs
- TextPattern.cs
- IsolatedStorageFileStream.cs
- RadioButton.cs
- HttpWebResponse.cs
- AxHost.cs
- EditorPartCollection.cs
- TextViewSelectionProcessor.cs
- RecipientInfo.cs
- SingleAnimationBase.cs
- RegistryPermission.cs
- BuiltInPermissionSets.cs
- SupportingTokenChannel.cs
- SchemaInfo.cs
- FrameworkPropertyMetadata.cs
- RemoteHelper.cs
- Label.cs
- LastQueryOperator.cs
- HttpWebResponse.cs
- WindowsListBox.cs
- CapabilitiesState.cs
- XmlLangPropertyAttribute.cs
- Preprocessor.cs
- AmbiguousMatchException.cs
- OlePropertyStructs.cs
- PropertyPushdownHelper.cs
- storepermission.cs
- FtpWebResponse.cs
- X509PeerCertificateElement.cs
- HandlerMappingMemo.cs
- WorkflowViewElement.cs
- ClientSettingsSection.cs
- SkipQueryOptionExpression.cs
- DetailsViewDeleteEventArgs.cs
- PriorityBinding.cs
- XmlCodeExporter.cs
- CompositeDataBoundControl.cs
- SqlParameterCollection.cs
- InertiaExpansionBehavior.cs
- NamespaceInfo.cs
- ToolStripSystemRenderer.cs
- ColumnHeader.cs
- CfgParser.cs
- FlowDocumentFormatter.cs
- ProvidePropertyAttribute.cs
- CustomTypeDescriptor.cs
- DesignerToolboxInfo.cs
- EncodingFallbackAwareXmlTextWriter.cs
- MasterPage.cs
- XhtmlBasicValidatorAdapter.cs
- RectangleF.cs
- DateTimePicker.cs
- Substitution.cs
- ObjectDataSource.cs
- Rectangle.cs
- KeyboardEventArgs.cs
- DataGridColumnCollection.cs
- CodeRegionDirective.cs
- UIElement.cs
- TextTreeTextElementNode.cs
- AnalyzedTree.cs
- DependentList.cs
- AvTraceDetails.cs
- ProfileGroupSettingsCollection.cs
- SmiEventSink_DeferedProcessing.cs
- Inline.cs
- CaretElement.cs
- DiscoveryMessageProperty.cs
- DataComponentNameHandler.cs
- QualificationDataAttribute.cs
- ReflectionHelper.cs
- MulticastDelegate.cs
- ObjectPropertyMapping.cs
- DataSvcMapFileSerializer.cs
- Literal.cs
- ModelItemCollectionImpl.cs
- DataTableCollection.cs
- DispatcherOperation.cs
- XhtmlBasicLinkAdapter.cs
- Metafile.cs
- Dictionary.cs