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
- PopupRoot.cs
- WindowsRegion.cs
- ValidationErrorCollection.cs
- Sql8ExpressionRewriter.cs
- StyleModeStack.cs
- JsonQNameDataContract.cs
- PointLightBase.cs
- DataGridCell.cs
- KeyValueConfigurationElement.cs
- EntityDataSourceState.cs
- AdjustableArrowCap.cs
- XmlUTF8TextWriter.cs
- OracleInfoMessageEventArgs.cs
- SecurityChannelFactory.cs
- ReceiveDesigner.xaml.cs
- XmlAttributeHolder.cs
- CoordinationService.cs
- SafeSecurityHandles.cs
- HttpHandlerAction.cs
- SafeEventLogWriteHandle.cs
- EntityDesignPluralizationHandler.cs
- BaseCodeDomTreeGenerator.cs
- SystemDropShadowChrome.cs
- NativeMethods.cs
- ProfileInfo.cs
- XmlSchema.cs
- newinstructionaction.cs
- WebPartCatalogAddVerb.cs
- StringStorage.cs
- StringSorter.cs
- SimpleRecyclingCache.cs
- ContractsBCL.cs
- InkSerializer.cs
- TransformConverter.cs
- FixedTextPointer.cs
- RegexBoyerMoore.cs
- QilCloneVisitor.cs
- UserControl.cs
- DeadCharTextComposition.cs
- BinHexEncoder.cs
- BrowserCapabilitiesFactoryBase.cs
- TypeDescriptionProvider.cs
- ActivityCodeDomSerializationManager.cs
- FlowDocumentPageViewerAutomationPeer.cs
- DataBoundControlHelper.cs
- LookupBindingPropertiesAttribute.cs
- DataPager.cs
- ResourceDictionary.cs
- PageSetupDialog.cs
- Misc.cs
- WebScriptEnablingBehavior.cs
- XmlnsDictionary.cs
- HwndStylusInputProvider.cs
- XmlCharacterData.cs
- RoutedPropertyChangedEventArgs.cs
- XPathNavigatorKeyComparer.cs
- CultureSpecificStringDictionary.cs
- XmlAnyAttributeAttribute.cs
- DeviceSpecificChoiceCollection.cs
- CatalogPartCollection.cs
- ComPlusInstanceContextInitializer.cs
- InheritedPropertyChangedEventArgs.cs
- CodeCommentStatement.cs
- TemplateField.cs
- AuthorizationRule.cs
- ConstraintEnumerator.cs
- TextParaLineResult.cs
- InvalidTimeZoneException.cs
- SqlComparer.cs
- ReachUIElementCollectionSerializer.cs
- DBNull.cs
- SystemIPGlobalProperties.cs
- AutoGeneratedField.cs
- XmlSchemaException.cs
- XsdBuilder.cs
- Bookmark.cs
- Comparer.cs
- ChannelBuilder.cs
- SchemaObjectWriter.cs
- SQLByte.cs
- XhtmlBasicPageAdapter.cs
- mda.cs
- PopOutPanel.cs
- DesignerWithHeader.cs
- DocComment.cs
- ContentPropertyAttribute.cs
- AutoResetEvent.cs
- ProgressBarAutomationPeer.cs
- ObjectResult.cs
- ConstructorBuilder.cs
- HttpHandlersSection.cs
- Rights.cs
- ReturnValue.cs
- ParallelTimeline.cs
- _ServiceNameStore.cs
- ExpandCollapseProviderWrapper.cs
- RequestResizeEvent.cs
- DataGridViewCellValidatingEventArgs.cs
- BasePropertyDescriptor.cs
- MappedMetaModel.cs