3 namespace Tizen.NUI.Xaml
5 internal interface IXamlNodeVisitor
7 TreeVisitingMode VisitingMode { get; }
8 bool StopOnDataTemplate { get; }
9 bool VisitNodeOnDataTemplate { get; }
10 bool StopOnResourceDictionary { get; }
12 void Visit(ValueNode node, INode parentNode);
13 void Visit(MarkupNode node, INode parentNode);
14 void Visit(ElementNode node, INode parentNode);
15 void Visit(RootNode node, INode parentNode);
16 void Visit(ListNode node, INode parentNode);
17 bool SkipChildren(INode node, INode parentNode);
18 bool IsResourceDictionary(ElementNode node);
21 internal enum TreeVisitingMode
27 internal class XamlNodeVisitor : IXamlNodeVisitor
29 readonly Action<INode, INode> action;
31 public XamlNodeVisitor(Action<INode, INode> action, TreeVisitingMode visitingMode = TreeVisitingMode.TopDown, bool stopOnDataTemplate = false, bool visitNodeOnDataTemplate = true)
34 VisitingMode = visitingMode;
35 StopOnDataTemplate = stopOnDataTemplate;
36 VisitNodeOnDataTemplate = visitNodeOnDataTemplate;
39 public TreeVisitingMode VisitingMode { get; }
40 public bool StopOnDataTemplate { get; }
41 public bool StopOnResourceDictionary { get; }
42 public bool VisitNodeOnDataTemplate { get; }
44 public void Visit(ValueNode node, INode parentNode) => action(node, parentNode);
45 public void Visit(MarkupNode node, INode parentNode) => action(node, parentNode);
46 public void Visit(ElementNode node, INode parentNode) => action(node, parentNode);
47 public void Visit(RootNode node, INode parentNode) => action(node, parentNode);
48 public void Visit(ListNode node, INode parentNode) => action(node, parentNode);
49 public bool SkipChildren(INode node, INode parentNode) => false;
50 public bool IsResourceDictionary(ElementNode node) => false;