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
- DeclarativeCatalogPart.cs
- WindowShowOrOpenTracker.cs
- CheckBoxBaseAdapter.cs
- MdbDataFileEditor.cs
- EntityClientCacheKey.cs
- SortedList.cs
- MaterialCollection.cs
- Track.cs
- Ipv6Element.cs
- RightsManagementSuppressedStream.cs
- Pair.cs
- AuthenticateEventArgs.cs
- UpdateExpressionVisitor.cs
- StylusEventArgs.cs
- LedgerEntryCollection.cs
- SQLBytesStorage.cs
- WriteTimeStream.cs
- CollectionViewSource.cs
- ToolStripPanel.cs
- XmlBoundElement.cs
- RoutedEventConverter.cs
- QueryExecutionOption.cs
- XmlDownloadManager.cs
- UnmanagedHandle.cs
- SizeChangedEventArgs.cs
- _WinHttpWebProxyDataBuilder.cs
- PropertyValue.cs
- EntityRecordInfo.cs
- SoapEnumAttribute.cs
- WebEventTraceProvider.cs
- Wrapper.cs
- MatrixTransform3D.cs
- ObjectQuery_EntitySqlExtensions.cs
- X509Certificate2.cs
- DesignerActionHeaderItem.cs
- SoapIgnoreAttribute.cs
- EntityDataSourceWrapperCollection.cs
- ChannelServices.cs
- StrokeCollectionConverter.cs
- Comparer.cs
- FontFamilyIdentifier.cs
- ListViewCancelEventArgs.cs
- SubMenuStyle.cs
- XpsPackagingPolicy.cs
- ListView.cs
- TypeResolver.cs
- DataGridTableCollection.cs
- SQLConvert.cs
- ChannelPoolSettings.cs
- AtomPub10CategoriesDocumentFormatter.cs
- LostFocusEventManager.cs
- Compiler.cs
- SR.cs
- TextSegment.cs
- ThreadPoolTaskScheduler.cs
- Frame.cs
- LinqDataSourceContextEventArgs.cs
- CustomError.cs
- Listen.cs
- XPathNode.cs
- FontClient.cs
- SendingRequestEventArgs.cs
- ControlPersister.cs
- SafeIUnknown.cs
- ListViewItemCollectionEditor.cs
- ListViewInsertionMark.cs
- QueryCacheManager.cs
- EventLogHandle.cs
- InputScopeAttribute.cs
- Context.cs
- URLMembershipCondition.cs
- VisualTreeUtils.cs
- HttpCapabilitiesSectionHandler.cs
- InfoCardProofToken.cs
- PKCS1MaskGenerationMethod.cs
- UnsafeNativeMethods.cs
- ImportContext.cs
- MobileContainerDesigner.cs
- WebSysDescriptionAttribute.cs
- GetWinFXPath.cs
- Misc.cs
- RecommendedAsConfigurableAttribute.cs
- DataSourceControl.cs
- XmlSchema.cs
- _UncName.cs
- ArithmeticException.cs
- HScrollProperties.cs
- ServiceOperationViewControl.cs
- SpecularMaterial.cs
- TextEditorThreadLocalStore.cs
- DataSourceControlBuilder.cs
- TimeBoundedCache.cs
- SizeValueSerializer.cs
- FrameworkElement.cs
- AttributeTable.cs
- ToolTipAutomationPeer.cs
- UniqueEventHelper.cs
- CultureInfoConverter.cs
- DebugInfoExpression.cs
- DPCustomTypeDescriptor.cs