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
- SessionStateSection.cs
- Exceptions.cs
- RuntimeEnvironment.cs
- Geometry3D.cs
- XmlSchemaGroupRef.cs
- EmptyStringExpandableObjectConverter.cs
- InputReportEventArgs.cs
- TraceUtility.cs
- TemplateControlBuildProvider.cs
- DataObjectEventArgs.cs
- StrongTypingException.cs
- DefaultProxySection.cs
- ToolStripRenderEventArgs.cs
- ContainerParagraph.cs
- ObjectSecurity.cs
- ListItemCollection.cs
- ForceCopyBuildProvider.cs
- HtmlButton.cs
- BuildProvider.cs
- HandlerBase.cs
- ActivityExecutorOperation.cs
- WebPartVerbCollection.cs
- PresentationAppDomainManager.cs
- QueryOptionExpression.cs
- URLMembershipCondition.cs
- UIElementParagraph.cs
- ConfigXmlCDataSection.cs
- Parameter.cs
- GroupQuery.cs
- PEFileReader.cs
- OleDbParameterCollection.cs
- SegmentInfo.cs
- TabControl.cs
- Int32KeyFrameCollection.cs
- HashMembershipCondition.cs
- TemplateFactory.cs
- TemplateApplicationHelper.cs
- TableAdapterManagerNameHandler.cs
- DateBoldEvent.cs
- FacetValues.cs
- DataGridViewUtilities.cs
- SrgsToken.cs
- TextBlock.cs
- WebPartConnectionsCancelEventArgs.cs
- ObjectParameter.cs
- SingleObjectCollection.cs
- HttpListenerRequestTraceRecord.cs
- CircleHotSpot.cs
- JoinGraph.cs
- RichTextBoxAutomationPeer.cs
- DllHostedComPlusServiceHost.cs
- HMACSHA256.cs
- LinqDataSourceSelectEventArgs.cs
- CodeSubDirectoriesCollection.cs
- Pkcs9Attribute.cs
- CqlBlock.cs
- DefaultEvaluationContext.cs
- WorkflowOwnershipException.cs
- TimeoutTimer.cs
- SelectorAutomationPeer.cs
- ClockGroup.cs
- COM2ExtendedUITypeEditor.cs
- ObjectListGeneralPage.cs
- __Filters.cs
- TypedTableBase.cs
- ListViewContainer.cs
- SqlConnectionHelper.cs
- MemberDomainMap.cs
- ResXResourceSet.cs
- XmlSecureResolver.cs
- CompilerCollection.cs
- UpdateDelegates.Generated.cs
- SocketStream.cs
- SoapIncludeAttribute.cs
- RelationshipEndMember.cs
- ShortcutKeysEditor.cs
- TypeConverterHelper.cs
- BinaryHeap.cs
- NavigationProperty.cs
- AuthenticationServiceManager.cs
- DependencyObject.cs
- Message.cs
- SecureUICommand.cs
- ICspAsymmetricAlgorithm.cs
- PrimitiveCodeDomSerializer.cs
- SubstitutionList.cs
- AppDomainGrammarProxy.cs
- TableHeaderCell.cs
- ToolStripLabel.cs
- DataGridViewUtilities.cs
- DataServiceKeyAttribute.cs
- AsyncSerializedWorker.cs
- ErrorHandler.cs
- HelpKeywordAttribute.cs
- DefaultValueTypeConverter.cs
- OleDbReferenceCollection.cs
- TemplateColumn.cs
- PropertyPathWorker.cs
- TextureBrush.cs
- EventLogEntryCollection.cs