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
- SyntaxCheck.cs
- CollectionChangeEventArgs.cs
- AdornerDecorator.cs
- ProfileEventArgs.cs
- Literal.cs
- RequiredFieldValidator.cs
- EventsTab.cs
- UnsafeNativeMethods.cs
- LabelEditEvent.cs
- BehaviorService.cs
- KeyBinding.cs
- RuleAttributes.cs
- SqlFacetAttribute.cs
- TextRangeProviderWrapper.cs
- Overlapped.cs
- NamespaceQuery.cs
- ChangeNode.cs
- Constraint.cs
- ProjectionCamera.cs
- CollectionViewSource.cs
- MailBnfHelper.cs
- OpenFileDialog.cs
- DesignerListAdapter.cs
- DecimalConverter.cs
- SystemGatewayIPAddressInformation.cs
- FormatException.cs
- XmlUtilWriter.cs
- DBConcurrencyException.cs
- PersistChildrenAttribute.cs
- RealProxy.cs
- RtfNavigator.cs
- GridViewRowCollection.cs
- FieldBuilder.cs
- RotationValidation.cs
- ConstructorBuilder.cs
- MultiAsyncResult.cs
- TextEditorParagraphs.cs
- PersistenceProviderDirectory.cs
- SafeSystemMetrics.cs
- dbenumerator.cs
- PolicyFactory.cs
- HttpPostedFile.cs
- FileDialog_Vista.cs
- StructuredTypeEmitter.cs
- UriTemplateDispatchFormatter.cs
- DiffuseMaterial.cs
- WindowsRichEdit.cs
- grammarelement.cs
- EventEntry.cs
- JavaScriptString.cs
- ScrollEvent.cs
- EffectiveValueEntry.cs
- FunctionDefinition.cs
- MonitoringDescriptionAttribute.cs
- SurrogateEncoder.cs
- XmlDataDocument.cs
- TextFormatterContext.cs
- DataGridViewToolTip.cs
- Point3DValueSerializer.cs
- BinaryUtilClasses.cs
- SafeLibraryHandle.cs
- ClientType.cs
- XPathNavigatorKeyComparer.cs
- ActivationProxy.cs
- ContentElement.cs
- HideDisabledControlAdapter.cs
- OutOfProcStateClientManager.cs
- OracleException.cs
- UnhandledExceptionEventArgs.cs
- SizeAnimation.cs
- SudsParser.cs
- ImageIndexEditor.cs
- EntityContainerEmitter.cs
- DesignerActionVerbList.cs
- MultiPageTextView.cs
- GetReadStreamResult.cs
- StateWorkerRequest.cs
- RawMouseInputReport.cs
- TokenizerHelper.cs
- RegexCode.cs
- OleDbMetaDataFactory.cs
- UrlPropertyAttribute.cs
- SpeechAudioFormatInfo.cs
- CaseInsensitiveHashCodeProvider.cs
- StaticDataManager.cs
- AlternateViewCollection.cs
- BaseAsyncResult.cs
- ControlBindingsCollection.cs
- ToolStripGrip.cs
- OpenTypeLayoutCache.cs
- ControllableStoryboardAction.cs
- FileRecordSequenceCompletedAsyncResult.cs
- RadioButton.cs
- TagPrefixInfo.cs
- MetaTableHelper.cs
- TextBoxAutomationPeer.cs
- TreeViewCancelEvent.cs
- DecimalConstantAttribute.cs
- InertiaTranslationBehavior.cs
- VirtualPathUtility.cs