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
- TreeViewHitTestInfo.cs
- BitmapScalingModeValidation.cs
- SQLDoubleStorage.cs
- DataControlFieldHeaderCell.cs
- CodeConstructor.cs
- NavigationCommands.cs
- OneOfElement.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- XmlSerializationWriter.cs
- ContentType.cs
- SaveCardRequest.cs
- Parsers.cs
- Attributes.cs
- FacetValues.cs
- DiscreteKeyFrames.cs
- DebugInfoExpression.cs
- TracePayload.cs
- Normalization.cs
- ConfigurationStrings.cs
- AspNetPartialTrustHelpers.cs
- SkewTransform.cs
- ConfigXmlText.cs
- SmtpFailedRecipientsException.cs
- DiscreteKeyFrames.cs
- Faults.cs
- RepeaterItemCollection.cs
- ActiveXHelper.cs
- ShaderEffect.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- BaseTypeViewSchema.cs
- PrefixQName.cs
- OpenFileDialog.cs
- XNodeNavigator.cs
- IpcPort.cs
- HandleCollector.cs
- CodeStatement.cs
- DiscardableAttribute.cs
- StorageMappingItemCollection.cs
- RawStylusSystemGestureInputReport.cs
- VariableQuery.cs
- DataSvcMapFile.cs
- CheckBox.cs
- EncryptedKey.cs
- ExpressionLink.cs
- documentsequencetextview.cs
- SplitterCancelEvent.cs
- DrawingContextWalker.cs
- SqlConnectionManager.cs
- XmlDataLoader.cs
- HeaderedContentControl.cs
- ProfessionalColorTable.cs
- _IPv4Address.cs
- MailWebEventProvider.cs
- HttpEncoder.cs
- KnowledgeBase.cs
- ApplicationId.cs
- UnknownBitmapEncoder.cs
- TableDetailsRow.cs
- TransactionScope.cs
- UInt16Converter.cs
- HttpModuleAction.cs
- CacheEntry.cs
- PrinterUnitConvert.cs
- ListChangedEventArgs.cs
- TextElementEditingBehaviorAttribute.cs
- SafeTimerHandle.cs
- KeyboardEventArgs.cs
- BitmapEffectInputData.cs
- AppSecurityManager.cs
- _SslSessionsCache.cs
- AudioFormatConverter.cs
- GPPOINTF.cs
- WebPermission.cs
- PackageFilter.cs
- UnaryNode.cs
- Matrix3D.cs
- EntityCommandDefinition.cs
- HttpWebResponse.cs
- BlobPersonalizationState.cs
- WorkflowTransactionOptions.cs
- ReadOnlyHierarchicalDataSourceView.cs
- AttachedAnnotationChangedEventArgs.cs
- SiteMembershipCondition.cs
- TabRenderer.cs
- DrawingVisual.cs
- SecurityDocument.cs
- EntityDataSourceValidationException.cs
- HtmlInputControl.cs
- WebBrowserBase.cs
- TextElementCollectionHelper.cs
- SmtpClient.cs
- EncryptedData.cs
- MailMessage.cs
- PrintPageEvent.cs
- BehaviorEditorPart.cs
- QilScopedVisitor.cs
- DictionarySectionHandler.cs
- GridViewUpdatedEventArgs.cs
- Helpers.cs
- DataGridViewTextBoxCell.cs