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
- Not.cs
- UrlMapping.cs
- PackageStore.cs
- FtpRequestCacheValidator.cs
- AdornerHitTestResult.cs
- Converter.cs
- WebContentFormatHelper.cs
- Fx.cs
- RadioButtonRenderer.cs
- SoapIncludeAttribute.cs
- ClientData.cs
- OleDbException.cs
- ColorContext.cs
- MessageSecurityProtocol.cs
- _ChunkParse.cs
- AmbiguousMatchException.cs
- WebPermission.cs
- SqlParameterCollection.cs
- CodeGotoStatement.cs
- ConfigurationPropertyCollection.cs
- TypedReference.cs
- RowSpanVector.cs
- AddInServer.cs
- Int16Storage.cs
- FacetEnabledSchemaElement.cs
- WhitespaceRuleLookup.cs
- DataPagerFieldItem.cs
- XamlStackWriter.cs
- X509Certificate.cs
- MsiStyleLogWriter.cs
- ProfilePropertyMetadata.cs
- ProfileBuildProvider.cs
- DataGridPageChangedEventArgs.cs
- ResourceCodeDomSerializer.cs
- ReturnType.cs
- EmptyStringExpandableObjectConverter.cs
- InlineCategoriesDocument.cs
- WindowsAltTab.cs
- JavaScriptString.cs
- KeyValueInternalCollection.cs
- SafeReversePInvokeHandle.cs
- Stylus.cs
- OperationPerformanceCounters.cs
- PenLineCapValidation.cs
- EventProperty.cs
- CodeTypeReference.cs
- updatecommandorderer.cs
- DateTimeConverter.cs
- DbConvert.cs
- TrustManagerMoreInformation.cs
- Comparer.cs
- TabItem.cs
- DesignerLoader.cs
- ConstraintStruct.cs
- RequestTimeoutManager.cs
- WebPartDeleteVerb.cs
- NameSpaceExtractor.cs
- QueryResponse.cs
- Pick.cs
- ConditionalAttribute.cs
- FixedDSBuilder.cs
- TrackingStringDictionary.cs
- ParamArrayAttribute.cs
- MetadataProperty.cs
- SelectionHighlightInfo.cs
- SHA1.cs
- KnownBoxes.cs
- DirectoryObjectSecurity.cs
- RecognizerStateChangedEventArgs.cs
- SqlFlattener.cs
- IConvertible.cs
- TemplateKey.cs
- XmlReflectionMember.cs
- DataGridSortCommandEventArgs.cs
- AlphaSortedEnumConverter.cs
- Style.cs
- Int32RectValueSerializer.cs
- ProviderConnectionPointCollection.cs
- NamespaceExpr.cs
- CodeRegionDirective.cs
- HttpClientCertificate.cs
- CommentAction.cs
- SiteMap.cs
- FormViewModeEventArgs.cs
- NumericPagerField.cs
- AssemblyInfo.cs
- PageHandlerFactory.cs
- ComPlusInstanceContextInitializer.cs
- ControlValuePropertyAttribute.cs
- Label.cs
- FileNotFoundException.cs
- RichTextBox.cs
- AccessKeyManager.cs
- cookiecontainer.cs
- VerticalConnector.xaml.cs
- CodeCastExpression.cs
- Themes.cs
- StaticResourceExtension.cs
- Stack.cs
- DynamicField.cs