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
- ObjectIDGenerator.cs
- RouteItem.cs
- DataGridViewRow.cs
- And.cs
- LeaseManager.cs
- DisplayClaim.cs
- MsmqIntegrationProcessProtocolHandler.cs
- FileDialogCustomPlace.cs
- fixedPageContentExtractor.cs
- NetworkCredential.cs
- DbConnectionInternal.cs
- FormsAuthenticationUser.cs
- TextEvent.cs
- ColorMap.cs
- Models.cs
- DataService.cs
- InstanceDataCollectionCollection.cs
- NativeMethodsCLR.cs
- regiisutil.cs
- Documentation.cs
- StructuredTypeEmitter.cs
- ProfileWorkflowElement.cs
- Propagator.JoinPropagator.SubstitutingCloneVisitor.cs
- PathNode.cs
- HostingEnvironmentSection.cs
- FileDialogCustomPlace.cs
- ReadOnlyNameValueCollection.cs
- SiteMap.cs
- MenuItemStyleCollection.cs
- SerializationFieldInfo.cs
- Rethrow.cs
- SqlTypeConverter.cs
- DependencyObjectType.cs
- MenuAdapter.cs
- ApplicationSecurityInfo.cs
- CatalogZoneBase.cs
- XmlEnumAttribute.cs
- ApplicationGesture.cs
- AmbientLight.cs
- AnonymousIdentificationSection.cs
- LocatorManager.cs
- WhiteSpaceTrimStringConverter.cs
- MachineSettingsSection.cs
- ImageInfo.cs
- XmlNavigatorStack.cs
- ErrorsHelper.cs
- NodeFunctions.cs
- AudienceUriMode.cs
- Thickness.cs
- PerfCounterSection.cs
- GridViewSelectEventArgs.cs
- Ticks.cs
- CodeDelegateInvokeExpression.cs
- TriggerCollection.cs
- QuadraticEase.cs
- PresentationSource.cs
- DataKey.cs
- DataGridViewLinkCell.cs
- Win32.cs
- RelOps.cs
- ConfigurationConverterBase.cs
- BehaviorDragDropEventArgs.cs
- SqlWebEventProvider.cs
- LogExtent.cs
- NativeMethodsOther.cs
- PeerNearMe.cs
- CqlErrorHelper.cs
- ContractSearchPattern.cs
- DefaultBinder.cs
- MissingSatelliteAssemblyException.cs
- CheckBox.cs
- ScriptControlDescriptor.cs
- UnknownBitmapDecoder.cs
- ObjectQuery.cs
- QuotaThrottle.cs
- SpeechEvent.cs
- CompilationSection.cs
- NamespaceCollection.cs
- HashHelper.cs
- HttpModuleActionCollection.cs
- CompModHelpers.cs
- EventMetadata.cs
- UnsafeCollabNativeMethods.cs
- WizardDesigner.cs
- CodeGeneratorOptions.cs
- SpellerHighlightLayer.cs
- DataGridHelper.cs
- DuplexSecurityProtocolFactory.cs
- DataColumnMappingCollection.cs
- InheritanceContextChangedEventManager.cs
- AutomationPatternInfo.cs
- XmlSchemaGroupRef.cs
- LinqDataSourceHelper.cs
- UserControlParser.cs
- XhtmlStyleClass.cs
- ZoneIdentityPermission.cs
- RangeValidator.cs
- NativeMethods.cs
- COMException.cs
- MappingItemCollection.cs