Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- VerificationException.cs
- FontStretch.cs
- VerificationAttribute.cs
- MouseButtonEventArgs.cs
- TrustSection.cs
- ModelFunctionTypeElement.cs
- LabelLiteral.cs
- BitmapEffectCollection.cs
- Utils.cs
- Serializer.cs
- StructuredCompositeActivityDesigner.cs
- StringDictionary.cs
- EdmEntityTypeAttribute.cs
- XmlDictionaryReaderQuotasElement.cs
- OrderingExpression.cs
- QuaternionAnimationBase.cs
- PropertyOverridesTypeEditor.cs
- DesignerVerbCollection.cs
- ObjectNotFoundException.cs
- XmlMessageFormatter.cs
- StickyNoteHelper.cs
- ThreadLocal.cs
- SmtpAuthenticationManager.cs
- _SecureChannel.cs
- DataGridViewCellConverter.cs
- CreateDataSourceDialog.cs
- StylusPointProperties.cs
- RuleValidation.cs
- RsaSecurityToken.cs
- DataSourceProvider.cs
- SqlParameterCollection.cs
- cookie.cs
- ReadonlyMessageFilter.cs
- QueuedDeliveryRequirementsMode.cs
- SelectionItemPattern.cs
- QilChoice.cs
- ClientScriptItem.cs
- _UriSyntax.cs
- SqlMethodAttribute.cs
- TypeSystem.cs
- PolicyLevel.cs
- ContentType.cs
- StateMachineWorkflowDesigner.cs
- DataGridRowDetailsEventArgs.cs
- DatagridviewDisplayedBandsData.cs
- TopClause.cs
- PathGradientBrush.cs
- UpDownBaseDesigner.cs
- LayoutEditorPart.cs
- RtfToken.cs
- EntityDataSourceValidationException.cs
- SizeChangedInfo.cs
- DataError.cs
- InstanceKeyNotReadyException.cs
- LambdaCompiler.ControlFlow.cs
- DisposableCollectionWrapper.cs
- Int32CollectionConverter.cs
- StringFunctions.cs
- ActivityDesignerResources.cs
- ServiceErrorHandler.cs
- TreeViewImageIndexConverter.cs
- CodeMemberProperty.cs
- Win32KeyboardDevice.cs
- FileUtil.cs
- X509Certificate2.cs
- SrgsDocument.cs
- WsdlImporter.cs
- DtdParser.cs
- EntityClientCacheEntry.cs
- StatusBarAutomationPeer.cs
- StoryFragments.cs
- EncoderParameter.cs
- HtmlGenericControl.cs
- IndependentAnimationStorage.cs
- TrackingProfileDeserializationException.cs
- SafeSecurityHelper.cs
- MtomMessageEncodingElement.cs
- SpellerError.cs
- ImageMapEventArgs.cs
- ScopelessEnumAttribute.cs
- DelegatedStream.cs
- TrackingProfile.cs
- TransformConverter.cs
- XPathNavigatorReader.cs
- SerTrace.cs
- TreeView.cs
- IdnElement.cs
- Span.cs
- CodeNamespaceImport.cs
- ConfigXmlAttribute.cs
- TreeBuilder.cs
- Style.cs
- FixedSOMContainer.cs
- WinInet.cs
- LocalizationComments.cs
- AsyncStreamReader.cs
- Relationship.cs
- TreeNodeCollectionEditor.cs
- NativeObjectSecurity.cs
- RightsManagementEncryptedStream.cs