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
- ApplicationTrust.cs
- StorageEntityTypeMapping.cs
- PropertyMapper.cs
- DataRecordInternal.cs
- CorrelationTokenInvalidatedHandler.cs
- contentDescriptor.cs
- WpfPayload.cs
- WindowsAltTab.cs
- DebugControllerThread.cs
- ControlPropertyNameConverter.cs
- ConstraintStruct.cs
- WrappingXamlSchemaContext.cs
- InProcStateClientManager.cs
- Int16KeyFrameCollection.cs
- SapiRecoContext.cs
- FloaterBaseParaClient.cs
- WebServiceTypeData.cs
- CompleteWizardStep.cs
- WaveHeader.cs
- ExcludePathInfo.cs
- SimpleType.cs
- InputEventArgs.cs
- SaveWorkflowCommand.cs
- Registry.cs
- PermissionSet.cs
- ISSmlParser.cs
- UnSafeCharBuffer.cs
- PointIndependentAnimationStorage.cs
- RuntimeHandles.cs
- BindingCompleteEventArgs.cs
- DbConnectionStringCommon.cs
- _AutoWebProxyScriptEngine.cs
- FileEnumerator.cs
- FieldToken.cs
- TableLayoutStyleCollection.cs
- LinkedDataMemberFieldEditor.cs
- BulletDecorator.cs
- KeyedCollection.cs
- LoginCancelEventArgs.cs
- DataGridViewRowsRemovedEventArgs.cs
- Rfc2898DeriveBytes.cs
- XmlDataSourceView.cs
- Dictionary.cs
- DockPanel.cs
- OleDbCommand.cs
- BaseInfoTable.cs
- HyperlinkAutomationPeer.cs
- EditingMode.cs
- FocusChangedEventArgs.cs
- ToolBarPanel.cs
- Matrix3DValueSerializer.cs
- ConfigXmlElement.cs
- WindowsGraphics.cs
- ExpressionsCollectionConverter.cs
- AssemblyBuilder.cs
- SerializationHelper.cs
- ResizeGrip.cs
- FileLoadException.cs
- StylusPoint.cs
- ImageCollectionEditor.cs
- DeviceContext.cs
- DynamicRouteExpression.cs
- GridItemProviderWrapper.cs
- MultiAsyncResult.cs
- PopOutPanel.cs
- Msmq4SubqueuePoisonHandler.cs
- ServiceXNameTypeConverter.cs
- OracleInfoMessageEventArgs.cs
- WindowInteractionStateTracker.cs
- And.cs
- OpenFileDialog.cs
- SqlFormatter.cs
- RotationValidation.cs
- WpfKnownMemberInvoker.cs
- SelectionHighlightInfo.cs
- DesignerWebPartChrome.cs
- X509Chain.cs
- FileUpload.cs
- XmlSchemaSet.cs
- input.cs
- NameNode.cs
- Util.cs
- ServicesUtilities.cs
- PerformanceCounters.cs
- CorrelationQueryBehavior.cs
- CompModSwitches.cs
- AsyncCodeActivityContext.cs
- DesignerActionVerbItem.cs
- ClientConfigurationSystem.cs
- MSAAEventDispatcher.cs
- FilteredDataSetHelper.cs
- ToolboxComponentsCreatedEventArgs.cs
- SafeCloseHandleCritical.cs
- DesignerProperties.cs
- EnumerableRowCollection.cs
- UnitySerializationHolder.cs
- SafeHandles.cs
- StackOverflowException.cs
- HttpNamespaceReservationInstallComponent.cs
- RSAPKCS1SignatureFormatter.cs