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
- DataGridViewControlCollection.cs
- CheckBoxList.cs
- ValueSerializer.cs
- BamlLocalizer.cs
- OdbcParameter.cs
- WindowsStatusBar.cs
- GrammarBuilderPhrase.cs
- QuaternionRotation3D.cs
- ExcCanonicalXml.cs
- SqlTypeSystemProvider.cs
- ProfilePropertySettings.cs
- Pair.cs
- RoleManagerEventArgs.cs
- ResolveMatchesMessageCD1.cs
- PeerInputChannelListener.cs
- SessionEndedEventArgs.cs
- ResourceExpressionEditorSheet.cs
- DBDataPermission.cs
- UrlMapping.cs
- ConfigurationCollectionAttribute.cs
- XmlElementAttributes.cs
- OleDbMetaDataFactory.cs
- DesignColumnCollection.cs
- BamlRecordReader.cs
- XmlSerializableWriter.cs
- WpfGeneratedKnownTypes.cs
- OdbcCommand.cs
- ForeignConstraint.cs
- CollectionType.cs
- DatagridviewDisplayedBandsData.cs
- UrlAuthFailedErrorFormatter.cs
- EventTrigger.cs
- StandardBindingReliableSessionElement.cs
- ParameterElementCollection.cs
- HitTestParameters3D.cs
- IndexOutOfRangeException.cs
- ImageFormat.cs
- TypeSystemHelpers.cs
- DBSqlParserColumn.cs
- XmlSchemaAny.cs
- WebPartManagerInternals.cs
- XPathNodeHelper.cs
- ServicePointManager.cs
- HyperLinkStyle.cs
- CodeSubDirectoriesCollection.cs
- SemanticTag.cs
- CompilerGlobalScopeAttribute.cs
- ColorAnimationUsingKeyFrames.cs
- DataGridViewCheckBoxColumn.cs
- RepeaterItem.cs
- AliasGenerator.cs
- DateTime.cs
- InputReferenceExpression.cs
- DbParameterCollectionHelper.cs
- RuntimeComponentFilter.cs
- ClassValidator.cs
- HttpApplicationFactory.cs
- DataGridViewSelectedRowCollection.cs
- BindStream.cs
- Rectangle.cs
- UIServiceHelper.cs
- HandlerBase.cs
- WebHostUnsafeNativeMethods.cs
- DependencyObject.cs
- DocumentCollection.cs
- DataSourceControlBuilder.cs
- DataGridViewColumnConverter.cs
- SafeEventLogReadHandle.cs
- Binding.cs
- DoubleLinkListEnumerator.cs
- CustomErrorsSection.cs
- PenLineCapValidation.cs
- ValidationPropertyAttribute.cs
- SqlOuterApplyReducer.cs
- ListMarkerLine.cs
- SamlAssertion.cs
- DataTemplateSelector.cs
- EditorZoneAutoFormat.cs
- _TransmitFileOverlappedAsyncResult.cs
- WindowsHyperlink.cs
- EqualityComparer.cs
- SecurityState.cs
- TabPanel.cs
- StylusPlugInCollection.cs
- ValidatorCollection.cs
- MetadataProperty.cs
- FilterElement.cs
- FastPropertyAccessor.cs
- CompositeKey.cs
- AsymmetricKeyExchangeFormatter.cs
- DependencyPropertyKey.cs
- UpDownEvent.cs
- Base64Decoder.cs
- TableCellAutomationPeer.cs
- ByteAnimationUsingKeyFrames.cs
- grammarelement.cs
- FontCollection.cs
- UIElementCollection.cs
- QuotedPrintableStream.cs
- GradientBrush.cs