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
- CompareValidator.cs
- SchemaCollectionPreprocessor.cs
- ChannelDispatcherBase.cs
- SmtpReplyReader.cs
- DocumentEventArgs.cs
- TextLineResult.cs
- AspCompat.cs
- CapacityStreamGeometryContext.cs
- WebRequestModuleElementCollection.cs
- StylusPointDescription.cs
- AlternateViewCollection.cs
- DbParameterHelper.cs
- ToolStripItemTextRenderEventArgs.cs
- HttpCacheParams.cs
- ServerValidateEventArgs.cs
- DataChangedEventManager.cs
- ResXBuildProvider.cs
- AutomationIdentifier.cs
- LoadWorkflowByInstanceKeyCommand.cs
- TypeContext.cs
- IImplicitResourceProvider.cs
- SchemaDeclBase.cs
- ExtensionWindowResizeGrip.cs
- DoubleLinkList.cs
- translator.cs
- EntityViewContainer.cs
- HwndKeyboardInputProvider.cs
- BlockCollection.cs
- OutputCacheProfile.cs
- NetCodeGroup.cs
- mda.cs
- DetailsViewCommandEventArgs.cs
- NodeFunctions.cs
- MembershipPasswordException.cs
- EnumType.cs
- XmlException.cs
- CommittableTransaction.cs
- DataGridViewRowCollection.cs
- PipeSecurity.cs
- RightsManagementEncryptionTransform.cs
- DiscreteKeyFrames.cs
- BufferedGraphicsContext.cs
- Int64.cs
- SettingsContext.cs
- Page.cs
- TraceContextEventArgs.cs
- IncrementalReadDecoders.cs
- MSHTMLHost.cs
- TextEditorTables.cs
- RelationshipSet.cs
- ClientConfigurationSystem.cs
- RoutedEvent.cs
- WinFormsSpinner.cs
- URLAttribute.cs
- ValidationSummary.cs
- PackagePartCollection.cs
- DiscardableAttribute.cs
- WaitHandle.cs
- CompiledRegexRunnerFactory.cs
- Type.cs
- FixedSOMSemanticBox.cs
- Attribute.cs
- HandleCollector.cs
- BitmapEffectInputData.cs
- CachedPathData.cs
- CancellationState.cs
- IntellisenseTextBox.cs
- ObjectDataSourceChooseMethodsPanel.cs
- PropertyDescriptor.cs
- Rfc4050KeyFormatter.cs
- BooleanToSelectiveScrollingOrientationConverter.cs
- ListChunk.cs
- FtpCachePolicyElement.cs
- DictionaryBase.cs
- TraceUtility.cs
- XamlSerializerUtil.cs
- ResourceDictionaryCollection.cs
- LocatorPart.cs
- ToolStripSeparatorRenderEventArgs.cs
- FileSystemEventArgs.cs
- Int64AnimationUsingKeyFrames.cs
- RSAOAEPKeyExchangeFormatter.cs
- BaseTemplateParser.cs
- ColorKeyFrameCollection.cs
- UnmanagedHandle.cs
- URL.cs
- ToolboxComponentsCreatingEventArgs.cs
- DnsPermission.cs
- TimeSpanSecondsConverter.cs
- DownloadProgressEventArgs.cs
- NativeMethods.cs
- WinFormsComponentEditor.cs
- ProgressBar.cs
- QilXmlReader.cs
- ObjectDataSourceSelectingEventArgs.cs
- DrawItemEvent.cs
- DataGridViewRowHeaderCell.cs
- ReadOnlyMetadataCollection.cs
- SiteMapDataSourceView.cs
- XmlAttributeProperties.cs