Updates referencesource to .NET 4.7
[mono-project.git] / mcs / class / referencesource / System.Data.SqlXml / System / Xml / Xsl / XsltOld / CommentAction.cs
blob67c7503bf0151b8098c2f8ac64560cc1e419c41e
1 //------------------------------------------------------------------------------
2 // <copyright file="CommentAction.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
4 // </copyright>
5 // <owner current="true" primary="true">Microsoft</owner>
6 //------------------------------------------------------------------------------
8 namespace System.Xml.Xsl.XsltOld {
9 using Res = System.Xml.Utils.Res;
10 using System;
11 using System.Diagnostics;
12 using System.Xml;
13 using System.Xml.XPath;
15 internal class CommentAction : ContainerAction {
16 internal override void Compile(Compiler compiler) {
17 CompileAttributes(compiler);
19 if (compiler.Recurse()) {
20 CompileTemplate(compiler);
21 compiler.ToParent();
25 internal override void Execute(Processor processor, ActionFrame frame) {
26 Debug.Assert(processor != null && frame != null);
28 switch (frame.State) {
29 case Initialized:
30 if (processor.BeginEvent(XPathNodeType.Comment, string.Empty, string.Empty, string.Empty, false) == false) {
31 // Come back later
32 break;
35 processor.PushActionFrame(frame);
36 frame.State = ProcessingChildren;
37 break; // Allow children to run
39 case ProcessingChildren:
40 if (processor.EndEvent(XPathNodeType.Comment) == false) {
41 break;
44 frame.Finished();
45 break;
47 default:
48 Debug.Fail("Invalid IfAction execution state");
49 break;