2 * Copyright(c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Collections.Generic;
19 using System.ComponentModel;
21 namespace Tizen.NUI.EXaml
23 internal static class LoadEXaml
25 internal static void Load(object view, string xaml)
27 var globalDataList = new GlobalDataList();
29 CreateInstanceAction.Root = view;
33 var createInstance = new CreateInstanceAction(globalDataList, null);
34 var getObjectByProperty = new GetObjectByPropertyAction(globalDataList, null);
35 var addExistInstance = new AddExistInstanceAction(globalDataList, null);
36 var registerXName = new RegisterXNameAction(globalDataList, null);
37 var setProperty = new SetPropertyAction(globalDataList, null);
38 var addToCollectionProperty = new AddToCollectionPropertyAction(globalDataList, null);
39 var addEvent = new AddEventAction(globalDataList, null);
40 var setBindalbeProperty = new SetBindalbePropertyAction(globalDataList, null);
41 var addObject = new CallAddMethodAction(globalDataList, null);
42 var setDynamicResourceAction = new SetDynamicResourceAction(globalDataList, null);
43 var addToResourceDictionaryAction = new AddToResourceDictionaryAction(globalDataList, null);
44 var setBindingAction = new SetBindingAction(globalDataList, null);
46 foreach (char c in xaml)
48 if (null == currentOp)
55 currentOp = new GatherAssembliesBlock(globalDataList, null);
61 currentOp = new GatherTypesBlock(globalDataList, null);
67 currentOp = new GatherPropertiesBlock(globalDataList, null);
73 currentOp = new GatherEventsBlock(globalDataList, null);
79 currentOp = new GatherMethodsBlock(globalDataList, null);
85 currentOp = new GatherBindablePropertiesBlock(globalDataList, null);
92 currentOp = createInstance;
97 currentOp = getObjectByProperty;
102 currentOp = addExistInstance;
107 currentOp = registerXName;
112 currentOp = setProperty;
117 currentOp = addToCollectionProperty;
122 currentOp = addEvent;
127 currentOp = setBindalbeProperty;
132 currentOp = setDynamicResourceAction;
137 currentOp = addObject;
142 currentOp = addToResourceDictionaryAction;
147 currentOp = setBindingAction;
154 currentOp = currentOp.DealChar(c);
158 foreach (var op in globalDataList.Operations)
164 private static Action currentOp = null;