Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CopyAttributesAction.cs
Go to the documentation of this file.
2
4
5internal sealed class CopyAttributesAction : Action
6{
7 private static readonly CopyAttributesAction s_Action = new CopyAttributesAction();
8
10 {
11 return s_Action;
12 }
13
14 internal override void Execute(Processor processor, ActionFrame frame)
15 {
16 while (processor.CanContinue)
17 {
18 switch (frame.State)
19 {
20 default:
21 return;
22 case 0:
23 if (!frame.Node.HasAttributes || !frame.Node.MoveToFirstAttribute())
24 {
25 frame.Finished();
26 return;
27 }
28 frame.State = 2;
29 goto case 2;
30 case 2:
31 if (SendBeginEvent(processor, frame.Node))
32 {
33 frame.State = 3;
34 break;
35 }
36 return;
37 case 3:
38 if (SendTextEvent(processor, frame.Node))
39 {
40 frame.State = 4;
41 break;
42 }
43 return;
44 case 4:
45 if (SendEndEvent(processor, frame.Node))
46 {
47 frame.State = 5;
48 break;
49 }
50 return;
51 case 5:
52 if (frame.Node.MoveToNextAttribute())
53 {
54 frame.State = 2;
55 break;
56 }
57 frame.Node.MoveToParent();
58 frame.Finished();
59 return;
60 case 1:
61 return;
62 }
63 }
64 }
65
67 {
68 return processor.BeginEvent(XPathNodeType.Attribute, node.Prefix, node.LocalName, node.NamespaceURI, empty: false);
69 }
70
72 {
73 return processor.TextEvent(node.Value);
74 }
75
77 {
78 return processor.EndEvent(XPathNodeType.Attribute);
79 }
80}
static bool SendBeginEvent(Processor processor, XPathNavigator node)
override void Execute(Processor processor, ActionFrame frame)
static readonly CopyAttributesAction s_Action
static bool SendEndEvent(Processor processor, XPathNavigator node)
static bool SendTextEvent(Processor processor, XPathNavigator node)