Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- ObjectIDGenerator.cs
- StyleXamlParser.cs
- DeviceContext2.cs
- RouteTable.cs
- BinaryFormatter.cs
- PrintingPermissionAttribute.cs
- ImplicitInputBrush.cs
- Domain.cs
- DrawingGroup.cs
- TextTreePropertyUndoUnit.cs
- MediaElement.cs
- ToolStrip.cs
- ReflectEventDescriptor.cs
- IntegerValidator.cs
- RectangleConverter.cs
- DataGridViewRowsRemovedEventArgs.cs
- Label.cs
- LinkedResourceCollection.cs
- TypeBuilder.cs
- PointF.cs
- WebResponse.cs
- SchemaTypeEmitter.cs
- SecurityTokenContainer.cs
- BindingMemberInfo.cs
- PersonalizableAttribute.cs
- FontSourceCollection.cs
- WebPartsPersonalization.cs
- DataGridViewCellStyleChangedEventArgs.cs
- TextMarkerSource.cs
- SetterBase.cs
- ObjectStateEntry.cs
- GridViewRowCollection.cs
- SqlCommandSet.cs
- PrimitiveList.cs
- ContentValidator.cs
- BindingContext.cs
- MessageBox.cs
- OdbcCommand.cs
- XmlAnyAttributeAttribute.cs
- RenameRuleObjectDialog.Designer.cs
- ReflectionHelper.cs
- DelimitedListTraceListener.cs
- ToolStripSplitButton.cs
- GradientSpreadMethodValidation.cs
- EncoderParameter.cs
- DbCommandTree.cs
- Point3D.cs
- TraceHandlerErrorFormatter.cs
- DecoderFallback.cs
- SchemaElementDecl.cs
- XXXOnTypeBuilderInstantiation.cs
- RawStylusInputCustomData.cs
- DataKey.cs
- DetailsView.cs
- DoubleConverter.cs
- MetadataItem_Static.cs
- TableProviderWrapper.cs
- ConfigurationException.cs
- OpenTypeCommon.cs
- DependencyPropertyValueSerializer.cs
- PersonalizationState.cs
- XamlRtfConverter.cs
- MSHTMLHostUtil.cs
- XmlCountingReader.cs
- ExpressionEditorSheet.cs
- Converter.cs
- DirectoryInfo.cs
- PartitionerQueryOperator.cs
- BaseServiceProvider.cs
- EncodingDataItem.cs
- ObjectListDesigner.cs
- HtmlSelectionListAdapter.cs
- CopyOfAction.cs
- RemoteWebConfigurationHostServer.cs
- Brush.cs
- SqlTypeSystemProvider.cs
- ScriptingRoleServiceSection.cs
- DataServiceResponse.cs
- DuplexChannelBinder.cs
- ImageMap.cs
- MediaTimeline.cs
- UpdateTranslator.cs
- xamlnodes.cs
- XPathNode.cs
- ServerValidateEventArgs.cs
- GroupQuery.cs
- Repeater.cs
- DecoderFallback.cs
- MdiWindowListItemConverter.cs
- ListViewItem.cs
- Matrix3DStack.cs
- XmlSchemaSimpleTypeList.cs
- NonSerializedAttribute.cs
- AllMembershipCondition.cs
- SoapElementAttribute.cs
- ImageIndexEditor.cs
- SerialPinChanges.cs
- ProcessModelInfo.cs
- ServiceOperation.cs
- KeyValuePairs.cs