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
- ExecutionContext.cs
- Visual3D.cs
- FileDataSourceCache.cs
- NullableIntAverageAggregationOperator.cs
- HScrollBar.cs
- Vector3D.cs
- Oid.cs
- DataListItemCollection.cs
- SHA1Managed.cs
- BufferedGraphicsManager.cs
- SByte.cs
- WebBrowserDocumentCompletedEventHandler.cs
- HttpServerVarsCollection.cs
- TypeSystemProvider.cs
- LineMetrics.cs
- JapaneseLunisolarCalendar.cs
- XmlAttributeOverrides.cs
- DockAndAnchorLayout.cs
- LocationUpdates.cs
- NumericUpDown.cs
- Size3D.cs
- RadioButton.cs
- TextEditorMouse.cs
- ModuleBuilderData.cs
- IsolatedStorageException.cs
- ExtensionSimplifierMarkupObject.cs
- SQLUtility.cs
- SqlNodeAnnotations.cs
- Select.cs
- SoapEnumAttribute.cs
- SymmetricKeyWrap.cs
- ZipFileInfo.cs
- SessionStateContainer.cs
- DateTimeUtil.cs
- PolyBezierSegment.cs
- SqlInternalConnectionTds.cs
- ActiveXSite.cs
- NetTcpSectionData.cs
- CategoryList.cs
- FontStyles.cs
- Vector3D.cs
- SafeBitVector32.cs
- IntranetCredentialPolicy.cs
- WebPartManager.cs
- Pts.cs
- QilScopedVisitor.cs
- BitmapSizeOptions.cs
- DelegateSerializationHolder.cs
- RSAOAEPKeyExchangeFormatter.cs
- SspiNegotiationTokenProvider.cs
- controlskin.cs
- VisemeEventArgs.cs
- AttachedPropertyDescriptor.cs
- CriticalHandle.cs
- COM2Enum.cs
- SinglePhaseEnlistment.cs
- PerfService.cs
- HttpRequestCacheValidator.cs
- Stackframe.cs
- HttpHostedTransportConfiguration.cs
- SubqueryRules.cs
- EditingCommands.cs
- RequestQueryParser.cs
- Label.cs
- DotExpr.cs
- CommandBinding.cs
- IIS7UserPrincipal.cs
- XmlSerializationWriter.cs
- NativeMethods.cs
- ScalarOps.cs
- PathGeometry.cs
- ResponseBodyWriter.cs
- SqlUserDefinedAggregateAttribute.cs
- WorkflowTransactionService.cs
- SoapAttributeOverrides.cs
- Line.cs
- DefaultPrintController.cs
- OpenTypeLayoutCache.cs
- NotifyCollectionChangedEventArgs.cs
- UIElement3DAutomationPeer.cs
- InheritablePropertyChangeInfo.cs
- DesignerGeometryHelper.cs
- SafeMarshalContext.cs
- ClientSideQueueItem.cs
- OdbcParameterCollection.cs
- ToolboxItemCollection.cs
- LinkConverter.cs
- CommonProperties.cs
- UniqueEventHelper.cs
- Quaternion.cs
- StringAnimationBase.cs
- ExpressionEditorAttribute.cs
- CounterCreationData.cs
- Animatable.cs
- RequestDescription.cs
- StylusButtonCollection.cs
- EntityContainerRelationshipSetEnd.cs
- SQLBoolean.cs
- DBDataPermissionAttribute.cs
- Privilege.cs