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
- EventNotify.cs
- XXXInfos.cs
- GifBitmapEncoder.cs
- LayoutTable.cs
- HtmlTableCellCollection.cs
- HorizontalAlignConverter.cs
- X509SecurityTokenAuthenticator.cs
- ArcSegment.cs
- InternalSafeNativeMethods.cs
- LoginCancelEventArgs.cs
- LogicalExpressionTypeConverter.cs
- RoutedPropertyChangedEventArgs.cs
- TextServicesCompartmentContext.cs
- MapPathBasedVirtualPathProvider.cs
- SecurityContext.cs
- COAUTHIDENTITY.cs
- DataGridViewImageColumn.cs
- UITypeEditor.cs
- CompensatableTransactionScopeActivity.cs
- ADMembershipProvider.cs
- ContentElement.cs
- TextEditorMouse.cs
- TailPinnedEventArgs.cs
- HtmlInputHidden.cs
- CodeConditionStatement.cs
- ValueOfAction.cs
- Walker.cs
- XmlCDATASection.cs
- ConsoleTraceListener.cs
- VirtualPath.cs
- UriSectionData.cs
- SerializerDescriptor.cs
- GridViewRowCollection.cs
- WindowInteropHelper.cs
- BamlReader.cs
- RegexRunnerFactory.cs
- InvalidOperationException.cs
- GridViewColumnHeaderAutomationPeer.cs
- BinHexEncoder.cs
- FileCodeGroup.cs
- WizardSideBarListControlItemEventArgs.cs
- RequiredArgumentAttribute.cs
- EnumUnknown.cs
- ResourceSetExpression.cs
- UnsafeNativeMethods.cs
- MembershipSection.cs
- IApplicationTrustManager.cs
- ChangeConflicts.cs
- ListViewItem.cs
- UIElementCollection.cs
- WebColorConverter.cs
- XPathArrayIterator.cs
- TextServicesCompartmentContext.cs
- NameValueConfigurationCollection.cs
- Stack.cs
- LayoutUtils.cs
- WebPartConnectionsConnectVerb.cs
- ClientBuildManagerCallback.cs
- MulticastDelegate.cs
- MessageVersion.cs
- EntityDataSourceView.cs
- ResourceDictionary.cs
- SymbolEqualComparer.cs
- WmlTextViewAdapter.cs
- SqlClientFactory.cs
- StatusBar.cs
- GCHandleCookieTable.cs
- PartialCachingAttribute.cs
- MediaElementAutomationPeer.cs
- IArgumentProvider.cs
- TraceLevelStore.cs
- SoapRpcMethodAttribute.cs
- StickyNoteHelper.cs
- SessionPageStatePersister.cs
- input.cs
- XsltCompileContext.cs
- SqlUtil.cs
- LineSegment.cs
- LineGeometry.cs
- TraceContextEventArgs.cs
- PackagePart.cs
- ParserExtension.cs
- TextCollapsingProperties.cs
- Column.cs
- SchemaType.cs
- CreateRefExpr.cs
- EventLogEntryCollection.cs
- XmlElementCollection.cs
- XmlDomTextWriter.cs
- RNGCryptoServiceProvider.cs
- ParseHttpDate.cs
- UserControlCodeDomTreeGenerator.cs
- DefaultParameterValueAttribute.cs
- WebPartAddingEventArgs.cs
- EdmComplexTypeAttribute.cs
- OracleParameterCollection.cs
- PersonalizationProviderCollection.cs
- TextSelectionHighlightLayer.cs
- IdnMapping.cs
- CommentEmitter.cs