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
- NamedPipeHostedTransportConfiguration.cs
- WebScriptEnablingBehavior.cs
- ImportCatalogPart.cs
- DispatcherSynchronizationContext.cs
- TimeSpanFormat.cs
- HandlerWithFactory.cs
- CodeVariableReferenceExpression.cs
- PropertyValueUIItem.cs
- CalendarBlackoutDatesCollection.cs
- InnerItemCollectionView.cs
- FixedTextContainer.cs
- EntitySetBase.cs
- RunWorkerCompletedEventArgs.cs
- Renderer.cs
- SpStreamWrapper.cs
- StrokeCollection2.cs
- StylusPointCollection.cs
- DataGridViewRowsRemovedEventArgs.cs
- PublisherMembershipCondition.cs
- LoginAutoFormat.cs
- ParseChildrenAsPropertiesAttribute.cs
- TextEditor.cs
- EventRouteFactory.cs
- DoubleAnimationUsingKeyFrames.cs
- ViewBox.cs
- ProfileService.cs
- RectangleHotSpot.cs
- EncryptedReference.cs
- DataGridToolTip.cs
- CachedFontFace.cs
- Dispatcher.cs
- ResumeStoryboard.cs
- FrameworkReadOnlyPropertyMetadata.cs
- DoubleAnimationClockResource.cs
- DBConnection.cs
- SmiXetterAccessMap.cs
- TypeDelegator.cs
- MessageQueueAccessControlEntry.cs
- DataGridAddNewRow.cs
- ObjectIDGenerator.cs
- LookupBindingPropertiesAttribute.cs
- XPathBuilder.cs
- SoapDocumentServiceAttribute.cs
- PeerValidationBehavior.cs
- CustomError.cs
- ErrorActivity.cs
- ConnectionPoolManager.cs
- TextDecorationCollectionConverter.cs
- HwndSourceParameters.cs
- CheckBoxRenderer.cs
- TextInfo.cs
- TreeView.cs
- EventDescriptorCollection.cs
- SingleResultAttribute.cs
- TemplateContentLoader.cs
- ArrangedElement.cs
- BindingManagerDataErrorEventArgs.cs
- HtmlTableRowCollection.cs
- DefinitionUpdate.cs
- BamlTreeMap.cs
- CookieProtection.cs
- AppDomainFactory.cs
- KeyBinding.cs
- SortKey.cs
- CustomBindingCollectionElement.cs
- ReflectionPermission.cs
- Byte.cs
- DetailsViewAutoFormat.cs
- PeerName.cs
- DataGridViewColumnCollection.cs
- SocketInformation.cs
- ContextStaticAttribute.cs
- OdbcHandle.cs
- PeerNameRecord.cs
- DefaultIfEmptyQueryOperator.cs
- OpenFileDialog.cs
- ProviderConnectionPoint.cs
- EntityException.cs
- LocatorGroup.cs
- Label.cs
- GeneralTransform2DTo3D.cs
- DBCommandBuilder.cs
- InfoCardBaseException.cs
- SpeechUI.cs
- IPAddressCollection.cs
- SourceFileInfo.cs
- baseaxisquery.cs
- XmlSchemaSet.cs
- PropagatorResult.cs
- TextMarkerSource.cs
- StrokeNodeOperations.cs
- SqlDataSourceConfigureSelectPanel.cs
- SQLInt64.cs
- FacetChecker.cs
- BufferModesCollection.cs
- WebPartHeaderCloseVerb.cs
- DataGridViewComponentPropertyGridSite.cs
- NonParentingControl.cs
- GetIsBrowserClientRequest.cs
- DNS.cs