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
- Cursor.cs
- HandlerFactoryWrapper.cs
- Underline.cs
- StringUtil.cs
- GridViewRow.cs
- Monitor.cs
- XmlElementAttribute.cs
- SqlServer2KCompatibilityCheck.cs
- PackageRelationshipCollection.cs
- XmlHelper.cs
- WebBrowserHelper.cs
- TextEditorDragDrop.cs
- WindowsStatic.cs
- AccessDataSource.cs
- RectangleGeometry.cs
- WebRequestModulesSection.cs
- TextEffectResolver.cs
- Camera.cs
- StrokeNodeOperations.cs
- PromptBuilder.cs
- ConsoleCancelEventArgs.cs
- FormView.cs
- URI.cs
- LabelEditEvent.cs
- Thickness.cs
- EntityObject.cs
- X500Name.cs
- EpmSyndicationContentSerializer.cs
- FileRecordSequenceHelper.cs
- AttachedPropertyInfo.cs
- MissingManifestResourceException.cs
- InternalConfigConfigurationFactory.cs
- Ref.cs
- IdnMapping.cs
- FixedSOMPageElement.cs
- PopupEventArgs.cs
- InputGestureCollection.cs
- LabelDesigner.cs
- HttpDebugHandler.cs
- ConnectionStringsExpressionBuilder.cs
- InputLangChangeRequestEvent.cs
- SecurityKeyUsage.cs
- DrawingContextWalker.cs
- XmlSerializerNamespaces.cs
- QuaternionAnimation.cs
- Vector3DCollection.cs
- SharedRuntimeState.cs
- ZoneMembershipCondition.cs
- ShapeTypeface.cs
- TextParagraphProperties.cs
- XmlValueConverter.cs
- QueryOpcode.cs
- ApplicationSecurityInfo.cs
- RuntimeCompatibilityAttribute.cs
- fixedPageContentExtractor.cs
- NamedPipeChannelListener.cs
- WebRequestModuleElement.cs
- GenericPrincipal.cs
- AmbientValueAttribute.cs
- CategoryAttribute.cs
- LinqDataView.cs
- GPRECTF.cs
- EnvironmentPermission.cs
- TextTreeTextNode.cs
- TaskFormBase.cs
- MetricEntry.cs
- ModuleBuilderData.cs
- HttpConfigurationContext.cs
- WebPartZoneBase.cs
- DesignerHelpers.cs
- ResourceReader.cs
- OdbcStatementHandle.cs
- RawTextInputReport.cs
- SelectionProcessor.cs
- SqlTriggerAttribute.cs
- WebColorConverter.cs
- TextContainer.cs
- Perspective.cs
- DBSqlParserTableCollection.cs
- SerializationException.cs
- ExpressionPrefixAttribute.cs
- DbProviderServices.cs
- VirtualPathProvider.cs
- CdpEqualityComparer.cs
- MulticastDelegate.cs
- returneventsaver.cs
- MsmqChannelListenerBase.cs
- _LazyAsyncResult.cs
- AppearanceEditorPart.cs
- InplaceBitmapMetadataWriter.cs
- JumpList.cs
- LocalizabilityAttribute.cs
- ModelItemImpl.cs
- UnconditionalPolicy.cs
- SwitchAttribute.cs
- BinaryNegotiation.cs
- ZoneButton.cs
- TreeIterators.cs
- ListItemCollection.cs
- CodeParameterDeclarationExpression.cs