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)
49 if (null == currentOp)
56 currentOp = new GatherAssembliesBlock(globalDataList, null);
62 currentOp = new GatherTypesBlock(globalDataList, null);
68 currentOp = new GatherPropertiesBlock(globalDataList, null);
74 currentOp = new GatherEventsBlock(globalDataList, null);
80 currentOp = new GatherMethodsBlock(globalDataList, null);
86 currentOp = new GatherBindablePropertiesBlock(globalDataList, null);
93 currentOp = createInstance;
98 currentOp = getObjectByProperty;
103 currentOp = addExistInstance;
108 currentOp = registerXName;
113 currentOp = setProperty;
118 currentOp = addToCollectionProperty;
123 currentOp = addEvent;
128 currentOp = setBindalbeProperty;
133 currentOp = setDynamicResourceAction;
138 currentOp = addObject;
143 currentOp = addToResourceDictionaryAction;
148 currentOp = setBindingAction;
155 currentOp = currentOp.DealChar(c);
159 foreach (var op in globalDataList.Operations)
165 private static Action currentOp = null;