[EXaml] Add code for load EXaml
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / EXaml / Action / GatherBindablePropertiesAction.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Reflection;
4 using System.Text;
5
6 namespace Tizen.NUI.EXaml
7 {
8     internal class GatherBindablePropertiesAction : Action
9     {
10         public GatherBindablePropertiesAction(Action parent)
11         {
12             this.parent = parent;
13         }
14
15         private Action parent;
16
17         public Action DealChar(char c)
18         {
19             switch (c)
20             {
21                 case ' ':
22                 case '\n':
23                 case '\r':
24                     break;
25
26                 case '(':
27                     childOp = new GetValueListAction(')', this);
28                     return childOp;
29
30                 case '>':
31                     parent?.OnActive();
32                     return parent;
33             }
34
35             return this;
36         }
37
38         private GetValueListAction childOp;
39
40         public void Init()
41         {
42             childOp = null;
43         }
44
45         public void OnActive()
46         {
47             int typeIndex = int.Parse(childOp.ValueList[0] as string);
48             string propertyName = childOp.ValueList[1] as string;
49
50             LoadEXaml.Operations.Add(new GatherBindableProperties(typeIndex, propertyName));
51         }
52     }
53 }