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
- DecimalAnimation.cs
- XmlReader.cs
- SmiContext.cs
- XmlSchemaObjectCollection.cs
- ExpressionBuilderContext.cs
- SqlBuffer.cs
- Types.cs
- VisualBrush.cs
- ProfileSection.cs
- ConfigurationManager.cs
- HandleCollector.cs
- Matrix3DValueSerializer.cs
- SocketPermission.cs
- LocalServiceSecuritySettings.cs
- Number.cs
- DoubleIndependentAnimationStorage.cs
- DecimalAnimationBase.cs
- XPathArrayIterator.cs
- querybuilder.cs
- DataErrorValidationRule.cs
- StyleModeStack.cs
- ProtectedProviderSettings.cs
- CodeObject.cs
- WebServiceParameterData.cs
- SynchronizedInputPattern.cs
- BrowserCapabilitiesCodeGenerator.cs
- UserControlParser.cs
- ProviderBase.cs
- ConnectionManagementElementCollection.cs
- MiniModule.cs
- CustomAttributeBuilder.cs
- SyndicationDeserializer.cs
- Pair.cs
- RenderingEventArgs.cs
- TokenBasedSetEnumerator.cs
- SecurityKeyIdentifierClause.cs
- AsyncStreamReader.cs
- ExpandSegment.cs
- ServiceThrottlingBehavior.cs
- ContourSegment.cs
- SynchronizedInputAdaptor.cs
- RSACryptoServiceProvider.cs
- XmlSchemaElement.cs
- MethodToken.cs
- XmlTextEncoder.cs
- PocoEntityKeyStrategy.cs
- GridItemPattern.cs
- TypeExtensionConverter.cs
- AsyncResult.cs
- DropDownList.cs
- Page.cs
- AddInProcess.cs
- RtfControlWordInfo.cs
- Variant.cs
- MD5CryptoServiceProvider.cs
- _SpnDictionary.cs
- SessionSymmetricTransportSecurityProtocolFactory.cs
- DataGridColumn.cs
- DatagridviewDisplayedBandsData.cs
- PerformanceCounterCategory.cs
- AssociationEndMember.cs
- ProtectedProviderSettings.cs
- CodeRemoveEventStatement.cs
- safePerfProviderHandle.cs
- BuildManager.cs
- ThreadWorkerController.cs
- RadioButtonAutomationPeer.cs
- CharacterBuffer.cs
- ComponentEvent.cs
- Transactions.cs
- Propagator.JoinPropagator.cs
- TriState.cs
- ListViewItemCollectionEditor.cs
- Exceptions.cs
- Image.cs
- XmlCountingReader.cs
- CryptoConfig.cs
- DataControlLinkButton.cs
- ProtocolsSection.cs
- MetaModel.cs
- HostProtectionException.cs
- SchemaImporterExtensionElement.cs
- CommandLibraryHelper.cs
- ProviderUtil.cs
- TrackingConditionCollection.cs
- TdsValueSetter.cs
- InstanceBehavior.cs
- InputGestureCollection.cs
- ProfileGroupSettings.cs
- SizeAnimationBase.cs
- WebBrowserNavigatedEventHandler.cs
- Stack.cs
- FunctionMappingTranslator.cs
- InvalidateEvent.cs
- RichTextBox.cs
- SqlFileStream.cs
- QuotedPrintableStream.cs
- ParserStreamGeometryContext.cs
- StretchValidation.cs
- HtmlTextViewAdapter.cs