Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / XmlUtils / System / Xml / Xsl / XsltOld / TextAction.cs / 1305376 / TextAction.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.Xml; using System.Xml.XPath; internal class TextAction : CompiledAction { private bool disableOutputEscaping; private string text; internal override void Compile(Compiler compiler) { CompileAttributes(compiler); CompileContent(compiler); } internal override bool CompileAttribute(Compiler compiler) { string name = compiler.Input.LocalName; string value = compiler.Input.Value; if (Ref.Equal(name, compiler.Atoms.DisableOutputEscaping)) { this.disableOutputEscaping = compiler.GetYesNo(value); } else { return false; } return true; } private void CompileContent(Compiler compiler) { if (compiler.Recurse()) { NavigatorInput input = compiler.Input; this.text = string.Empty; do { switch (input.NodeType) { case XPathNodeType.Text: case XPathNodeType.Whitespace: case XPathNodeType.SignificantWhitespace: this.text += input.Value; break; case XPathNodeType.Comment: case XPathNodeType.ProcessingInstruction: break; default: throw compiler.UnexpectedKeyword(); } } while(compiler.Advance()); compiler.ToParent(); } } internal override void Execute(Processor processor, ActionFrame frame) { Debug.Assert(processor != null && frame != null); switch (frame.State) { case Initialized: if (processor.TextEvent(this.text, disableOutputEscaping)) { frame.Finished(); } break; default: Debug.Fail("Invalid execution state in TextAction"); break; } } } } // 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.Xml; using System.Xml.XPath; internal class TextAction : CompiledAction { private bool disableOutputEscaping; private string text; internal override void Compile(Compiler compiler) { CompileAttributes(compiler); CompileContent(compiler); } internal override bool CompileAttribute(Compiler compiler) { string name = compiler.Input.LocalName; string value = compiler.Input.Value; if (Ref.Equal(name, compiler.Atoms.DisableOutputEscaping)) { this.disableOutputEscaping = compiler.GetYesNo(value); } else { return false; } return true; } private void CompileContent(Compiler compiler) { if (compiler.Recurse()) { NavigatorInput input = compiler.Input; this.text = string.Empty; do { switch (input.NodeType) { case XPathNodeType.Text: case XPathNodeType.Whitespace: case XPathNodeType.SignificantWhitespace: this.text += input.Value; break; case XPathNodeType.Comment: case XPathNodeType.ProcessingInstruction: break; default: throw compiler.UnexpectedKeyword(); } } while(compiler.Advance()); compiler.ToParent(); } } internal override void Execute(Processor processor, ActionFrame frame) { Debug.Assert(processor != null && frame != null); switch (frame.State) { case Initialized: if (processor.TextEvent(this.text, disableOutputEscaping)) { frame.Finished(); } break; default: Debug.Fail("Invalid execution state in TextAction"); break; } } } } // 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
- TrustManagerMoreInformation.cs
- ReadOnlyTernaryTree.cs
- VBCodeProvider.cs
- Delegate.cs
- PropertyPath.cs
- DataGridPageChangedEventArgs.cs
- _StreamFramer.cs
- InvalidCastException.cs
- ButtonPopupAdapter.cs
- XmlSerializerOperationBehavior.cs
- StrokeRenderer.cs
- RtfToXamlReader.cs
- InProcStateClientManager.cs
- XamlTreeBuilderBamlRecordWriter.cs
- BitmapData.cs
- AnnouncementInnerClientCD1.cs
- SettingsBase.cs
- PerformanceCounterManager.cs
- CategoryAttribute.cs
- EventBuilder.cs
- DecoderFallbackWithFailureFlag.cs
- AsyncSerializedWorker.cs
- EmptyStringExpandableObjectConverter.cs
- FlowSwitchDesigner.xaml.cs
- ResourceKey.cs
- HostingPreferredMapPath.cs
- NavigationCommands.cs
- ProtocolViolationException.cs
- DataGridViewCellStyle.cs
- AsyncPostBackErrorEventArgs.cs
- ExceptionUtil.cs
- CollectionViewProxy.cs
- ToolStripDropDownItem.cs
- UnmanagedMarshal.cs
- SQLInt16.cs
- MatrixValueSerializer.cs
- TraceInternal.cs
- RoleManagerEventArgs.cs
- SetIndexBinder.cs
- ToolStripOverflow.cs
- ObjectIDGenerator.cs
- NativeRecognizer.cs
- XmlEnumAttribute.cs
- ConvertEvent.cs
- PingReply.cs
- FontEmbeddingManager.cs
- UpdateException.cs
- UserNameSecurityTokenAuthenticator.cs
- CompilerWrapper.cs
- CapabilitiesSection.cs
- PlatformNotSupportedException.cs
- TargetInvocationException.cs
- LinqDataSourceDeleteEventArgs.cs
- WCFBuildProvider.cs
- HttpListenerRequest.cs
- FileLogRecordStream.cs
- ClientCultureInfo.cs
- FormatConvertedBitmap.cs
- CompilerGlobalScopeAttribute.cs
- RSAPKCS1KeyExchangeFormatter.cs
- InvalidCastException.cs
- Ref.cs
- AlphabeticalEnumConverter.cs
- LabelLiteral.cs
- wgx_commands.cs
- HtmlProps.cs
- NativeMethods.cs
- XmlBaseWriter.cs
- OutputWindow.cs
- TableLayoutSettingsTypeConverter.cs
- FilterRepeater.cs
- XmlLinkedNode.cs
- ToolStripComboBox.cs
- Sql8ConformanceChecker.cs
- Wizard.cs
- OletxTransactionHeader.cs
- ServiceProviders.cs
- GeneralTransform3DTo2D.cs
- CodeMemberMethod.cs
- SerializationFieldInfo.cs
- PolyBezierSegment.cs
- StrokeSerializer.cs
- TreeViewImageKeyConverter.cs
- RowToParametersTransformer.cs
- RegexReplacement.cs
- DbTransaction.cs
- AxisAngleRotation3D.cs
- StateRuntime.cs
- EntityModelSchemaGenerator.cs
- ValidationResult.cs
- XmlElementList.cs
- WebHeaderCollection.cs
- RTTypeWrapper.cs
- CrossContextChannel.cs
- EngineSite.cs
- XmlSchemaInfo.cs
- ActivationArguments.cs
- ProgressChangedEventArgs.cs
- MimeTextImporter.cs
- XmlCodeExporter.cs