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
- RubberbandSelector.cs
- SafeNativeMethods.cs
- NativeMethods.cs
- VSWCFServiceContractGenerator.cs
- LiteralTextContainerControlBuilder.cs
- PcmConverter.cs
- DiscoveryRequestHandler.cs
- ElementProxy.cs
- ReferenceEqualityComparer.cs
- ProcessHostConfigUtils.cs
- FormDocumentDesigner.cs
- UserControlBuildProvider.cs
- ClickablePoint.cs
- ValueChangedEventManager.cs
- WebRequestModulesSection.cs
- DataGridItem.cs
- AlphabeticalEnumConverter.cs
- DependencyPropertyAttribute.cs
- HttpRuntime.cs
- TextElementEnumerator.cs
- DefinitionBase.cs
- RoleService.cs
- DataGridViewComboBoxColumn.cs
- WebControlsSection.cs
- Boolean.cs
- SID.cs
- WebPart.cs
- Color.cs
- PartManifestEntry.cs
- PersonalizationProviderHelper.cs
- UIElementParagraph.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- MinimizableAttributeTypeConverter.cs
- MediaElement.cs
- DefaultSerializationProviderAttribute.cs
- FormsAuthenticationModule.cs
- RenderingBiasValidation.cs
- TextFindEngine.cs
- SmiEventStream.cs
- CssClassPropertyAttribute.cs
- DefaultBinder.cs
- NavigationService.cs
- ResXResourceSet.cs
- Label.cs
- TranslateTransform.cs
- ConstrainedGroup.cs
- PrinterSettings.cs
- ProcessHostFactoryHelper.cs
- EnvelopedPkcs7.cs
- ScriptingJsonSerializationSection.cs
- ComponentGuaranteesAttribute.cs
- GenericNameHandler.cs
- QueryPrefixOp.cs
- ExternalException.cs
- QueryRewriter.cs
- BitmapSource.cs
- TableColumnCollectionInternal.cs
- ValueUnavailableException.cs
- SimpleType.cs
- COM2FontConverter.cs
- ArrayList.cs
- RectIndependentAnimationStorage.cs
- ScriptDescriptor.cs
- ConsumerConnectionPoint.cs
- DataProviderNameConverter.cs
- PipelineModuleStepContainer.cs
- WMICapabilities.cs
- AuthenticationSchemesHelper.cs
- ChtmlPhoneCallAdapter.cs
- EncodingDataItem.cs
- GeometryGroup.cs
- LogAppendAsyncResult.cs
- PropertyGridEditorPart.cs
- DoWorkEventArgs.cs
- MethodExpr.cs
- PartitionedStream.cs
- SizeConverter.cs
- EditableTreeList.cs
- ContainerSelectorActiveEvent.cs
- FlowDocumentScrollViewer.cs
- RadioButton.cs
- EmptyImpersonationContext.cs
- SpellerStatusTable.cs
- DuplicateWaitObjectException.cs
- EventListener.cs
- XmlTextWriter.cs
- ConstraintEnumerator.cs
- ListViewItem.cs
- UntrustedRecipientException.cs
- Stopwatch.cs
- ShapingEngine.cs
- RemoteX509AsymmetricSecurityKey.cs
- PingOptions.cs
- ManualWorkflowSchedulerService.cs
- RequestCacheValidator.cs
- EntityDataSource.cs
- OleDbInfoMessageEvent.cs
- SubtreeProcessor.cs
- TypeConverterAttribute.cs
- TreeView.cs