Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- ScriptResourceInfo.cs
- Mapping.cs
- ObjectAnimationUsingKeyFrames.cs
- CodeMemberEvent.cs
- shaper.cs
- EDesignUtil.cs
- _IPv6Address.cs
- Utils.cs
- HostingEnvironmentSection.cs
- XmlToDatasetMap.cs
- PeoplePickerWrapper.cs
- ActivityPreviewDesigner.cs
- XmlSchemaException.cs
- ConfigurationPermission.cs
- XmlValueConverter.cs
- WindowsAuthenticationModule.cs
- ExpressionBuilder.cs
- Models.cs
- RegexCode.cs
- AsyncResult.cs
- MarshalByValueComponent.cs
- BitmapFrameDecode.cs
- Logging.cs
- ISFClipboardData.cs
- DirectoryRootQuery.cs
- AppSettingsReader.cs
- cookie.cs
- DeferredTextReference.cs
- Stack.cs
- SQLInt64Storage.cs
- TagMapInfo.cs
- CompilationUtil.cs
- XamlToRtfParser.cs
- ImmutableCommunicationTimeouts.cs
- BrowserPolicyValidator.cs
- KeyManager.cs
- XPathConvert.cs
- SecurityDescriptor.cs
- SafeSerializationManager.cs
- ComPlusAuthorization.cs
- FormatVersion.cs
- PreloadHost.cs
- SmtpReplyReader.cs
- EdmScalarPropertyAttribute.cs
- PeerTransportCredentialType.cs
- XmlSchemaAttributeGroup.cs
- MulticastNotSupportedException.cs
- MessageTransmitTraceRecord.cs
- XamlNamespaceHelper.cs
- SqlInternalConnectionSmi.cs
- HeaderedItemsControl.cs
- MsmqMessageProperty.cs
- AbsoluteQuery.cs
- DataGridTableCollection.cs
- AssemblyAssociatedContentFileAttribute.cs
- ConnectionStringsExpressionBuilder.cs
- SqlInternalConnectionTds.cs
- ToolBarButtonClickEvent.cs
- MarkupCompilePass1.cs
- TakeQueryOptionExpression.cs
- X509ChainPolicy.cs
- DefaultAssemblyResolver.cs
- ErasingStroke.cs
- SendMailErrorEventArgs.cs
- BlockExpression.cs
- ChannelServices.cs
- TextRangeAdaptor.cs
- LabelDesigner.cs
- CodeExpressionCollection.cs
- LazyTextWriterCreator.cs
- ipaddressinformationcollection.cs
- GridViewColumnHeader.cs
- TemplateBindingExpressionConverter.cs
- ComplexBindingPropertiesAttribute.cs
- StrokeNodeEnumerator.cs
- MemberDescriptor.cs
- CounterSampleCalculator.cs
- Visual.cs
- XComponentModel.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- ProxyWebPartConnectionCollection.cs
- SerializationFieldInfo.cs
- HttpConfigurationSystem.cs
- ToolStripManager.cs
- EntityType.cs
- ADMembershipUser.cs
- PreviewKeyDownEventArgs.cs
- ImageInfo.cs
- ArgIterator.cs
- HashAlgorithm.cs
- ProofTokenCryptoHandle.cs
- IProvider.cs
- Semaphore.cs
- BindingOperations.cs
- SerialErrors.cs
- PropertyMetadata.cs
- XsltConvert.cs
- ObjectParameter.cs
- ReadOnlyHierarchicalDataSource.cs
- Process.cs