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
- DataReaderContainer.cs
- SamlAuthenticationStatement.cs
- PngBitmapDecoder.cs
- Symbol.cs
- TextEffect.cs
- ProtocolsConfiguration.cs
- FixedSOMPage.cs
- DataGridHeaderBorder.cs
- Section.cs
- StorageModelBuildProvider.cs
- DesignerOptions.cs
- ValidatorUtils.cs
- EpmSyndicationContentDeSerializer.cs
- MsmqIntegrationProcessProtocolHandler.cs
- PassportAuthenticationModule.cs
- PathGradientBrush.cs
- CachingHintValidation.cs
- GridViewColumnHeader.cs
- DataAdapter.cs
- Line.cs
- AttributeInfo.cs
- SqlStatistics.cs
- NameValuePermission.cs
- ListItem.cs
- FileDataSourceCache.cs
- ObjectStateEntry.cs
- QilList.cs
- StateMachineWorkflowDesigner.cs
- FixedStringLookup.cs
- EntityRecordInfo.cs
- EmptyCollection.cs
- IntellisenseTextBox.cs
- UnsafeNativeMethodsPenimc.cs
- SqlCacheDependency.cs
- AmbiguousMatchException.cs
- Directory.cs
- XPathNavigator.cs
- DeferrableContentConverter.cs
- ToolBar.cs
- XmlComplianceUtil.cs
- DeploymentSection.cs
- PersonalizationProvider.cs
- AsymmetricSecurityBindingElement.cs
- XpsSerializationManager.cs
- XmlSerializerVersionAttribute.cs
- RequestNavigateEventArgs.cs
- GroupBox.cs
- LinearQuaternionKeyFrame.cs
- RectValueSerializer.cs
- TriState.cs
- PropertyMetadata.cs
- BasicCellRelation.cs
- HttpModulesSection.cs
- OleDbTransaction.cs
- MailBnfHelper.cs
- RichTextBox.cs
- CompensatableTransactionScopeActivity.cs
- NamedObject.cs
- EFDataModelProvider.cs
- TraceUtils.cs
- SqlNotificationRequest.cs
- QueryCacheKey.cs
- TabControl.cs
- UnmanagedMarshal.cs
- FileDialog_Vista.cs
- XhtmlConformanceSection.cs
- IntegerFacetDescriptionElement.cs
- Soap12ProtocolImporter.cs
- SharedPerformanceCounter.cs
- FileDialog.cs
- ManagementOptions.cs
- ItemChangedEventArgs.cs
- AtlasWeb.Designer.cs
- Part.cs
- DateTimeFormatInfoScanner.cs
- CancelRequestedRecord.cs
- PathData.cs
- altserialization.cs
- ResourceReader.cs
- DataGridCellsPresenter.cs
- UnmanagedMarshal.cs
- VirtualDirectoryMapping.cs
- BufferedGraphics.cs
- DataGridParentRows.cs
- XmlCDATASection.cs
- ComplexTypeEmitter.cs
- InputLanguageSource.cs
- DataFormat.cs
- ListItem.cs
- RuntimeEnvironment.cs
- ItemContainerGenerator.cs
- FunctionDetailsReader.cs
- ManualWorkflowSchedulerService.cs
- StylusPointPropertyUnit.cs
- BridgeDataRecord.cs
- HostingEnvironmentException.cs
- BooleanAnimationBase.cs
- ProxyGenerationError.cs
- SQlBooleanStorage.cs
- BitVector32.cs