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
- AssociatedControlConverter.cs
- InternalSafeNativeMethods.cs
- HttpGetProtocolImporter.cs
- ByteAnimation.cs
- ColorBuilder.cs
- BlockCollection.cs
- Debugger.cs
- NullableBoolConverter.cs
- AdornerLayer.cs
- Variable.cs
- FileDialogCustomPlacesCollection.cs
- ScriptReferenceBase.cs
- TableCellCollection.cs
- StrokeIntersection.cs
- ForeignKeyConstraint.cs
- EncoderBestFitFallback.cs
- MarkupCompilePass1.cs
- DataGridViewSelectedColumnCollection.cs
- InstancePersistenceCommand.cs
- ZoneMembershipCondition.cs
- HwndHost.cs
- ShadowGlyph.cs
- Opcode.cs
- BlobPersonalizationState.cs
- AppModelKnownContentFactory.cs
- HostSecurityManager.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- SRGSCompiler.cs
- ConfigXmlCDataSection.cs
- Lock.cs
- RichTextBox.cs
- GregorianCalendarHelper.cs
- AnnotationComponentManager.cs
- ImportCatalogPart.cs
- FileLevelControlBuilderAttribute.cs
- WindowsSpinner.cs
- EndEvent.cs
- DataObject.cs
- baseaxisquery.cs
- DesignerSerializationOptionsAttribute.cs
- TakeOrSkipQueryOperator.cs
- Win32PrintDialog.cs
- SqlFormatter.cs
- OleDbConnection.cs
- TreeViewItem.cs
- ValidateNames.cs
- RowSpanVector.cs
- DateTimeStorage.cs
- SmtpReplyReaderFactory.cs
- SafeUserTokenHandle.cs
- FunctionImportElement.cs
- StringWriter.cs
- AssemblyBuilderData.cs
- SystemIcmpV6Statistics.cs
- SqlBinder.cs
- EntityDataSourceDataSelection.cs
- RuleSetDialog.cs
- TiffBitmapDecoder.cs
- XmlLanguageConverter.cs
- KeySpline.cs
- Hash.cs
- IdentityHolder.cs
- NativeMethods.cs
- File.cs
- DataTemplateSelector.cs
- SelectionUIHandler.cs
- XmlSchemaProviderAttribute.cs
- WasAdminWrapper.cs
- Completion.cs
- TableDetailsRow.cs
- TableItemPattern.cs
- InterleavedZipPartStream.cs
- Optimizer.cs
- ColorMatrix.cs
- TreeBuilderXamlTranslator.cs
- ExportOptions.cs
- Int32CollectionConverter.cs
- XmlSignificantWhitespace.cs
- StrongTypingException.cs
- WindowsListViewScroll.cs
- CodeMethodInvokeExpression.cs
- HitTestFilterBehavior.cs
- WorkflowItemPresenter.cs
- AlignmentYValidation.cs
- WindowsBrush.cs
- TableDetailsRow.cs
- ToolBarOverflowPanel.cs
- ResourceDisplayNameAttribute.cs
- wgx_sdk_version.cs
- CssStyleCollection.cs
- DataKeyCollection.cs
- BmpBitmapDecoder.cs
- SmiEventSink.cs
- GridViewSortEventArgs.cs
- ProgressChangedEventArgs.cs
- JavascriptCallbackMessageInspector.cs
- DistinctQueryOperator.cs
- BufferModeSettings.cs
- InstanceKeyNotReadyException.cs
- AsyncOperation.cs