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
- QuadraticBezierSegment.cs
- PageCatalogPart.cs
- COAUTHIDENTITY.cs
- _RequestCacheProtocol.cs
- IISMapPath.cs
- WmfPlaceableFileHeader.cs
- ClientOptions.cs
- DBConnection.cs
- ScriptingRoleServiceSection.cs
- SingleObjectCollection.cs
- VerticalAlignConverter.cs
- SessionStateUtil.cs
- WebServiceMethodData.cs
- DependencyPropertyDescriptor.cs
- WebServiceEnumData.cs
- ServiceModelConfiguration.cs
- MarginsConverter.cs
- TabPanel.cs
- Sql8ConformanceChecker.cs
- TargetControlTypeAttribute.cs
- PixelFormats.cs
- TimelineClockCollection.cs
- Token.cs
- ItemCollection.cs
- CombinedGeometry.cs
- MessageQueueException.cs
- EventSetter.cs
- DesignTimeParseData.cs
- GenericTypeParameterConverter.cs
- WindowsGraphics.cs
- LogicalChannel.cs
- XmlParser.cs
- EditorBrowsableAttribute.cs
- HttpModulesSection.cs
- ScrollViewerAutomationPeer.cs
- InvalidCastException.cs
- SystemIPInterfaceProperties.cs
- DataSpaceManager.cs
- ObjectDisposedException.cs
- EdmType.cs
- odbcmetadatafactory.cs
- InternalTypeHelper.cs
- BindingExpressionBase.cs
- WinFormsComponentEditor.cs
- CompilerCollection.cs
- WebCategoryAttribute.cs
- Cursor.cs
- ContentPlaceHolder.cs
- MenuItemBindingCollection.cs
- Annotation.cs
- ListViewItemMouseHoverEvent.cs
- SQLSingle.cs
- CodeDelegateCreateExpression.cs
- ErrorTableItemStyle.cs
- CodeAttributeDeclarationCollection.cs
- Vector3DCollectionConverter.cs
- DataGridAddNewRow.cs
- WindowsTitleBar.cs
- _ChunkParse.cs
- SymmetricKeyWrap.cs
- ActivityMetadata.cs
- IOException.cs
- Statements.cs
- InstanceDataCollectionCollection.cs
- IODescriptionAttribute.cs
- TreeNode.cs
- ThemeDictionaryExtension.cs
- ObjectQueryExecutionPlan.cs
- ProofTokenCryptoHandle.cs
- srgsitem.cs
- CodeExporter.cs
- ImageDrawing.cs
- StringSorter.cs
- WorkflowViewService.cs
- WebPart.cs
- SafeMemoryMappedFileHandle.cs
- XmlLoader.cs
- SettingsPropertyWrongTypeException.cs
- QualificationDataAttribute.cs
- SafeNativeMethods.cs
- ViewStateModeByIdAttribute.cs
- WebPartHelpVerb.cs
- QueryCorrelationInitializer.cs
- rsa.cs
- HtmlInputControl.cs
- PerformanceCounterPermissionEntryCollection.cs
- XamlStream.cs
- ControlBuilderAttribute.cs
- HtmlInputPassword.cs
- Run.cs
- XmlBindingWorker.cs
- DesignTimeSiteMapProvider.cs
- MessageDesigner.cs
- webbrowsersite.cs
- CollectionViewGroup.cs
- StoreUtilities.cs
- ToolStripItemCollection.cs
- SiteMapSection.cs
- VarRemapper.cs
- DrawingGroup.cs