Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- RepeaterItemCollection.cs
- PassportPrincipal.cs
- Registry.cs
- Page.cs
- XmlAttributeOverrides.cs
- DtdParser.cs
- InvalidEnumArgumentException.cs
- SectionVisual.cs
- XmlStreamNodeWriter.cs
- WindowHideOrCloseTracker.cs
- ProxyWebPartManagerDesigner.cs
- precedingquery.cs
- FormsAuthenticationUserCollection.cs
- GridViewAutomationPeer.cs
- DataTrigger.cs
- TextLineBreak.cs
- Range.cs
- Vector3DValueSerializer.cs
- Debug.cs
- ImportOptions.cs
- LayoutEngine.cs
- UserInitiatedNavigationPermission.cs
- ToolboxItemCollection.cs
- DataGridViewTextBoxEditingControl.cs
- CodePrimitiveExpression.cs
- StateElementCollection.cs
- DefinitionBase.cs
- RootProfilePropertySettingsCollection.cs
- CachedPathData.cs
- Run.cs
- BinaryConverter.cs
- MarginsConverter.cs
- ToolboxCategoryItems.cs
- WebPartMovingEventArgs.cs
- RequestCachingSection.cs
- ControlCollection.cs
- SmtpDigestAuthenticationModule.cs
- ObjRef.cs
- SqlConnectionFactory.cs
- FixedPage.cs
- LowerCaseStringConverter.cs
- webeventbuffer.cs
- SelectionItemProviderWrapper.cs
- DataGridViewRowConverter.cs
- ExtendedPropertyDescriptor.cs
- MouseEvent.cs
- DbProviderFactory.cs
- HasCopySemanticsAttribute.cs
- SqlReferenceCollection.cs
- NameSpaceEvent.cs
- XamlFigureLengthSerializer.cs
- COM2ComponentEditor.cs
- Util.cs
- Focus.cs
- XmlTextReaderImpl.cs
- ActivityDefaults.cs
- QueryOperator.cs
- DataViewManagerListItemTypeDescriptor.cs
- CompletedAsyncResult.cs
- FixedHyperLink.cs
- SeverityFilter.cs
- safesecurityhelperavalon.cs
- ElementHostAutomationPeer.cs
- TransactionException.cs
- GridViewSortEventArgs.cs
- TextRunCacheImp.cs
- DriveInfo.cs
- InternalSafeNativeMethods.cs
- FactoryId.cs
- ViewService.cs
- SHA512Managed.cs
- LZCodec.cs
- GeneratedCodeAttribute.cs
- NavigationEventArgs.cs
- DbExpressionVisitor.cs
- CompilerGeneratedAttribute.cs
- SeekStoryboard.cs
- ScrollProviderWrapper.cs
- ReflectionHelper.cs
- OdbcInfoMessageEvent.cs
- TableLayoutColumnStyleCollection.cs
- ResXFileRef.cs
- DateTimeFormatInfo.cs
- EncryptedXml.cs
- PermissionSetEnumerator.cs
- IndexedWhereQueryOperator.cs
- RootProfilePropertySettingsCollection.cs
- BindingWorker.cs
- ColorConvertedBitmapExtension.cs
- CapacityStreamGeometryContext.cs
- SystemBrushes.cs
- sqlpipe.cs
- WebPartVerbsEventArgs.cs
- XmlSchemaException.cs
- BypassElementCollection.cs
- PageCache.cs
- TextLine.cs
- XmlBaseReader.cs
- BitStack.cs
- NodeLabelEditEvent.cs