+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-using Tizen.NUI.Binding;
-using Tizen.NUI.Binding.Internals;
-
-namespace Tizen.NUI.EXaml
-{
- internal class AddEventAction : Action
- {
- public AddEventAction(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case ' ':
- case '\n':
- case '\r':
- break;
-
- case '(':
- childOp = new GetValueListAction(')', this);
- return childOp;
-
- case '#':
- parent?.OnActive();
- return parent;
- }
-
- return this;
- }
-
- private GetValueListAction childOp;
-
- public void Init()
- {
- childOp = null;
- }
-
- public void OnActive()
- {
- if (null != childOp && childOp.ValueList.Count > 3 && (childOp.ValueList[0] is Instance instance) && (childOp.ValueList[1] is Instance element))
- {
- int instanceIndex = instance.Index;
- int elementIndex = element.Index;
- int propertyIndex = (int)childOp.ValueList[2];
- int value = (int)childOp.ValueList[3];
- globalDataList.Operations.Add(new AddEvent(globalDataList, instanceIndex, elementIndex, propertyIndex, value));
- }
- }
- }
-}
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Tizen.NUI.Binding;
-using Tizen.NUI.Binding.Internals;
-
-namespace Tizen.NUI.EXaml
-{
- internal class AddExistInstanceAction : Action
- {
- internal AddExistInstanceAction(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case ' ':
- case '\n':
- case '\r':
- break;
-
- case '@':
- parent?.OnActive();
- return parent;
-
- case '(':
- getValueListOp = new GetValueListAction(')', this);
- return getValueListOp;
-
- case 'o':
- case 'q':
- sign = c;
- break;
- }
-
- return this;
- }
-
- public void Init()
- {
- getValueListOp = null;
- }
-
- public void OnActive()
- {
- if (null != getValueListOp)
- {
- object value0 = getValueListOp.ValueList[0];
- int index = (value0 is Instance) ? (value0 as Instance).Index : (int)value0;
- string value = getValueListOp.ValueList[1] as string;
-
- if ('q' == sign)
- {
- globalDataList.Operations.Add(new GatherConvertedValue(globalDataList, index, value));
- }
- else if ('o' == sign)
- {
- globalDataList.Operations.Add(new GatherEnumValue(globalDataList, index, value));
- }
-
- getValueListOp = null;
- }
- }
-
- private char sign;
- private GetValueListAction getValueListOp;
- }
-}
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-using Tizen.NUI.Binding;
-using Tizen.NUI.Binding.Internals;
-
-namespace Tizen.NUI.EXaml
-{
- internal class AddToCollectionPropertyAction : Action
- {
- public AddToCollectionPropertyAction(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case ' ':
- case '\n':
- case '\r':
- break;
-
- case '(':
- childOp = new GetValueListAction(')', this);
- return childOp;
-
- case '~':
- parent?.OnActive();
- return parent;
- }
-
- return this;
- }
-
- private GetValueListAction childOp;
-
- public void Init()
- {
- childOp = null;
- }
-
- public void OnActive()
- {
- if (null != childOp)
- {
- int instanceIndex = (int)childOp.ValueList[0];
- var value = childOp.ValueList[1];
- globalDataList.Operations.Add(new AddToCollectionProperty(globalDataList, instanceIndex, value));
- }
- }
- }
-}
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-using Tizen.NUI.Binding;
-using Tizen.NUI.Binding.Internals;
-
-namespace Tizen.NUI.EXaml
-{
- internal class AddToResourceDictionaryAction : Action
- {
- public AddToResourceDictionaryAction(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case ' ':
- case '\n':
- case '\r':
- break;
-
- case '(':
- childOp = new GetValueListAction(')', this);
- return childOp;
-
- case '*':
- parent?.OnActive();
- return parent;
- }
-
- return this;
- }
-
- private GetValueListAction childOp;
-
- public void Init()
- {
- childOp = null;
- }
-
- public void OnActive()
- {
- if (null != childOp && childOp.ValueList.Count > 2 && (childOp.ValueList[0] is Instance instance) && (childOp.ValueList[1] is string key))
- {
- int instanceIndex = instance.Index;
- var value = childOp.ValueList[2];
- globalDataList.Operations.Add(new AddToResourceDictionary(globalDataList, instanceIndex, key, value));
- }
- }
- }
-}
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-using Tizen.NUI.Binding;
-using Tizen.NUI.Binding.Internals;
-
-namespace Tizen.NUI.EXaml
-{
- internal class CallAddMethodAction : Action
- {
- public CallAddMethodAction(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case ' ':
- case '\n':
- case '\r':
- break;
-
- case '(':
- childOp = new GetValueListAction(')', this);
- return childOp;
-
- case '^':
- parent?.OnActive();
- return parent;
- }
-
- return this;
- }
-
- private GetValueListAction childOp;
-
- public void Init()
- {
- childOp = null;
- }
-
- public void OnActive()
- {
- if (null != childOp && childOp.ValueList.Count > 2 && (childOp.ValueList[0] is Instance instance))
- {
- int parentIndex = instance.Index;
- var child = childOp.ValueList[1];
- int methodIndex = (int)childOp.ValueList[2];
-
- globalDataList.Operations.Add(new CallAddMethod(globalDataList, parentIndex, child, methodIndex));
- }
- }
- }
-}
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Tizen.NUI.Binding;
-using Tizen.NUI.Binding.Internals;
-
-namespace Tizen.NUI.EXaml
-{
- internal class CreateInstanceAction : Action
- {
- internal CreateInstanceAction(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case ' ':
- case '\n':
- case '\r':
- break;
-
- case '}':
- parent?.OnActive();
- return parent;
-
- case '(':
- getParamListOp = new GetValueListAction(')', this);
- return getParamListOp;
-
- case '[':
- getXFactoryMethodIndexOp = new GetValueListAction(']', this);
- return getXFactoryMethodIndexOp;
-
- case '{':
- getStaticInstanceOp = new GetValueListAction('}', this);
- return getStaticInstanceOp;
-
- case '`':
- getTypeObjectIndexOp = new GetValueListAction(c, this);
- return getTypeObjectIndexOp;
-
- default:
- getTypeIndexOp = new GetValueAction(c, this);
- return getTypeIndexOp;
- }
-
- return this;
- }
-
- public void Init()
- {
- getTypeIndexOp = null;
- getXFactoryMethodIndexOp = null;
- getParamListOp = null;
- getStaticInstanceOp = null;
- }
-
- public void OnActive()
- {
- if (null != getTypeIndexOp)
- {
- int typeIndex = (int)getTypeIndexOp.Value;
- if (null != getStaticInstanceOp)
- {
- var propertyName = getStaticInstanceOp.ValueList[0] as string;
- var fieldName = getStaticInstanceOp.ValueList[1] as string;
- getStaticInstanceOp = null;
-
- globalDataList.Operations.Add(new GatherStaticInstance(globalDataList, typeIndex, propertyName, fieldName));
- }
- else
- {
- int xFactoryMethodIndex = (null == getXFactoryMethodIndexOp) ? -1 : (int)getXFactoryMethodIndexOp.ValueList[0];
- getXFactoryMethodIndexOp = null;
-
- if (null == getParamListOp)
- {
- globalDataList.Operations.Add(new CreateInstance(globalDataList, typeIndex, xFactoryMethodIndex));
- }
- else
- {
- globalDataList.Operations.Add(new CreateInstance(globalDataList, typeIndex, xFactoryMethodIndex, getParamListOp.ValueList));
- }
-
- getParamListOp = null;
- }
- }
- else if (null != getTypeObjectIndexOp)
- {
- int typeIndex = (int)(getTypeObjectIndexOp.ValueList[0]);
- globalDataList.Operations.Add(new GatherTypeObject(globalDataList, typeIndex));
- }
-
- getTypeIndexOp = null;
- getTypeObjectIndexOp = null;
- }
-
- private GetValueAction getTypeIndexOp;
- private GetValueListAction getXFactoryMethodIndexOp;
- private GetValueListAction getParamListOp;
- private GetValueListAction getStaticInstanceOp;
- private GetValueListAction getTypeObjectIndexOp;
- }
-}
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Tizen.NUI.Binding;
-using Tizen.NUI.Binding.Internals;
-
-namespace Tizen.NUI.EXaml
-{
- internal class GetObjectByPropertyAction : Action
- {
- internal GetObjectByPropertyAction(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case ' ':
- case '\n':
- case '\r':
- break;
-
- case '`':
- parent?.OnActive();
- return parent;
-
- case '(':
- childOp = new GetValueListAction(')', this);
- return childOp;
- }
-
- return this;
- }
-
- public void Init()
- {
- childOp = null;
- }
-
- public void OnActive()
- {
- if (null != childOp && childOp.ValueList[0] is Instance valueList0)
- {
- int instanceIndex = valueList0.Index;
- string propertyName = childOp.ValueList[1] as string;
- globalDataList.Operations.Add(new GetObjectByProperty(globalDataList, instanceIndex, propertyName));
- }
-
- childOp = null;
- }
-
- private GetValueListAction childOp;
- }
-}
}
break;
+ case '\'':
+ Value = valueString[0];
+ break;
+
case 'z':
Value = null;
break;
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Tizen.NUI.Binding;
-using Tizen.NUI.Binding.Internals;
-
-namespace Tizen.NUI.EXaml
-{
- internal class OtherActions : Action
- {
- internal OtherActions(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case ' ':
- case '\n':
- case '\r':
- break;
-
- case 'a':
- parent?.OnActive();
- return parent;
-
- case '(':
- getValues = new GetValueListAction(')', this);
- return getValues;
- }
-
- return this;
- }
-
- public void Init()
- {
- getValues = null;
- }
-
- public void OnActive()
- {
- if (null != getValues)
- {
- int index = (int)getValues.ValueList[0];
-
- switch (index)
- {
- case 0:
- {
- int typeIndex = (int)getValues.ValueList[1];
- var items = getValues.ValueList[2] as List<object>;
- var createArrayInstanceOp = new CreateArrayInstance(globalDataList, typeIndex, items);
- globalDataList.Operations.Add(createArrayInstanceOp);
- }
- break;
-
- case 1:
- {
- int typeIndex = (int)getValues.ValueList[1];
- int startIndex = (int)getValues.ValueList[2];
- int endIndex = (int)getValues.ValueList[3];
- var createDataTemplateOp = new CreateDataTemplate(globalDataList, typeIndex, (startIndex, endIndex));
- globalDataList.Operations.Add(createDataTemplateOp);
- }
- break;
-
- case 2:
- {
- int instanceIndex = (getValues.ValueList[1] as Instance).Index;
- var value = getValues.ValueList[2];
- globalDataList.Operations.Add(new AddToCollectionInstance(globalDataList, instanceIndex, value));
- }
- break;
-
- default:
- break;
- }
- }
-
- getValues = null;
- }
-
- private GetValueListAction getValues;
- }
-}
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-using Tizen.NUI.Binding;
-using Tizen.NUI.Binding.Internals;
-
-namespace Tizen.NUI.EXaml
-{
- internal class RegisterXNameAction : Action
- {
- public RegisterXNameAction(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case ' ':
- case '\n':
- case '\r':
- break;
-
- case '(':
- childOp = new GetValueListAction(')', this);
- return childOp;
-
- case '&':
- parent?.OnActive();
- return parent;
- }
-
- return this;
- }
-
- private GetValueListAction childOp;
-
- public void Init()
- {
- childOp = null;
- }
-
- public void OnActive()
- {
- object instance = childOp.ValueList[0];
- string xName = childOp.ValueList[1] as string;
-
- globalDataList.Operations.Add(new RegisterXName(globalDataList, instance, xName));
- }
- }
-}
--- /dev/null
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Tizen.NUI.EXaml
+{
+ internal class RootAction : Action
+ {
+ delegate void CreateOperation(GlobalDataList globalDataList, List<object> operationInfo);
+
+ public RootAction(GlobalDataList globalDataList)
+ {
+ this.globalDataList = globalDataList;
+
+ childAction = new GetValueListAction(')', this);
+ childAction.Init();
+ }
+
+ public Action DealChar(char c)
+ {
+ if ('(' == c)
+ {
+ childAction.Init();
+ return childAction;
+ }
+ else if ('\n' == c)
+ {
+ return this;
+ }
+ else
+ {
+ throw new Exception($"RootAction must not deal the char {c}");
+ }
+ }
+
+ public void Init()
+ {
+ childAction.Init();
+ }
+
+ public void OnActive()
+ {
+ int opIndex = (int)childAction.ValueList[0];
+ Operations[opIndex].Invoke(globalDataList, childAction.ValueList[1] as List<object>);
+
+ childAction.Init();
+ }
+
+ private GlobalDataList globalDataList;
+ private GetValueListAction childAction;
+
+ private static CreateOperation[] operations;
+
+ private static CreateOperation[] Operations
+ {
+ get
+ {
+ if (null == operations)
+ {
+ InitOperationFactory(out operations);
+ }
+
+ return operations;
+ }
+ }
+
+ private static void InitOperationFactory(out CreateOperation[] createOperations)
+ {
+ createOperations = new CreateOperation[(int)EXamlOperationType.MAX];
+
+ createOperations[(int)EXamlOperationType.GatherAssembly] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new GatherAssembly(globalDataList, opInfo);
+ globalDataList.PreLoadOperations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.GatherType] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new GatherType(globalDataList, opInfo);
+ globalDataList.PreLoadOperations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.GatherProperty] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new GatherProperty(globalDataList, opInfo);
+ globalDataList.PreLoadOperations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.GatherEvent] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new GatherEvent(globalDataList, opInfo);
+ globalDataList.PreLoadOperations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.GatherMethod] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new GatherMethod(globalDataList, opInfo);
+ globalDataList.PreLoadOperations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.GatherBindableProperty] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new GatherBindableProperties(globalDataList, opInfo);
+ globalDataList.PreLoadOperations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.CreateObject] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new CreateObject(globalDataList, opInfo);
+ globalDataList.Operations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.CreateArrayObject] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new CreateArrayObject(globalDataList, opInfo);
+ globalDataList.Operations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.CreateDataTemplate] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new CreateDataTemplate(globalDataList, opInfo);
+ globalDataList.Operations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.GetStaticObject] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new GetStaticObject(globalDataList, opInfo);
+ globalDataList.Operations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.GetTypeObject] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new GetTypeObject(globalDataList, opInfo);
+ globalDataList.Operations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.GetObjectConvertedFromString] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new GetObjectConvertedFromString(globalDataList, opInfo);
+ globalDataList.Operations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.GetEnumObject] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new GetEnumObject(globalDataList, opInfo);
+ globalDataList.Operations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.GetObjectByProperty] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new GetObjectByProperty(globalDataList, opInfo);
+ globalDataList.Operations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.SetProperty] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new SetProperty(globalDataList, opInfo);
+ globalDataList.Operations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.SetBindableProperty] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new SetBindableProperty(globalDataList, opInfo);
+ globalDataList.Operations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.SetBinding] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new SetBinding(globalDataList, opInfo);
+ globalDataList.Operations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.SetDynamicResource] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new SetDynamicResource(globalDataList, opInfo);
+ globalDataList.Operations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.AddEvent] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new AddEvent(globalDataList, opInfo);
+ globalDataList.Operations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.AddObject] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new AddObject(globalDataList, opInfo);
+ globalDataList.Operations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.AddToCollectionObject] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new AddToCollectionObject(globalDataList, opInfo);
+ globalDataList.Operations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.AddToCollectionProperty] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new AddToCollectionProperty(globalDataList, opInfo);
+ globalDataList.Operations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.AddToResourceDictionary] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new AddToResourceDictionary(globalDataList, opInfo);
+ globalDataList.Operations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.RegisterXName] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ var operation = new RegisterXName(globalDataList, opInfo);
+ globalDataList.Operations.Add(operation);
+ };
+
+ createOperations[(int)EXamlOperationType.GetLongString] = (GlobalDataList globalDataList, List<object> opInfo) =>
+ {
+ globalDataList.LongStrings = opInfo[0] as string;
+ };
+ }
+ }
+}
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-using Tizen.NUI.Binding;
-using Tizen.NUI.Binding.Internals;
-
-namespace Tizen.NUI.EXaml
-{
- internal class SetBindalbePropertyAction : Action
- {
- public SetBindalbePropertyAction(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case ' ':
- case '\n':
- case '\r':
- break;
-
- case '(':
- childOp = new GetValueListAction(')', this);
- return childOp;
-
- case '!':
- parent?.OnActive();
- return parent;
- }
-
- return this;
- }
-
- private GetValueListAction childOp;
-
- public void Init()
- {
- childOp = null;
- }
-
- public void OnActive()
- {
- if (null != childOp && childOp.ValueList.Count > 2 && (childOp.ValueList[0] is Instance instance))
- {
- int instanceIndex = instance.Index;
- int bindalbePropertyIndex = (int)childOp.ValueList[1];
- var value = childOp.ValueList[2];
- globalDataList.Operations.Add(new SetBindalbeProperty(globalDataList, instanceIndex, bindalbePropertyIndex, value));
- }
- }
- }
-}
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-using Tizen.NUI.Binding;
-using Tizen.NUI.Binding.Internals;
-
-namespace Tizen.NUI.EXaml
-{
- internal class SetBindingAction : Action
- {
- public SetBindingAction(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case ' ':
- case '\n':
- case '\r':
- break;
-
- case '(':
- childOp = new GetValueListAction(')', this);
- return childOp;
-
- case '%':
- parent?.OnActive();
- return parent;
- }
-
- return this;
- }
-
- private GetValueListAction childOp;
-
- public void Init()
- {
- childOp = null;
- }
-
- public void OnActive()
- {
- if (null != childOp && childOp.ValueList.Count > 2 && (childOp.ValueList[0] is Instance instance) && (childOp.ValueList[2] is Instance value))
- {
- int instanceIndex = instance.Index;
- var propertyIndex = (int)childOp.ValueList[1];
- int valueIndex = value.Index;
-
- globalDataList.Operations.Add(new SetBinding(globalDataList, instanceIndex, propertyIndex, valueIndex));
- }
- }
- }
-}
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Tizen.NUI.EXaml
-{
- internal class SetDynamicResourceAction : Action
- {
- public SetDynamicResourceAction(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case ' ':
- case '\n':
- case '\r':
- break;
-
- case '(':
- childOp = new GetValueListAction(')', this);
- return childOp;
-
- case '$':
- parent?.OnActive();
- return parent;
- }
-
- return this;
- }
-
- private GetValueListAction childOp;
-
- public void Init()
- {
- childOp = null;
- }
-
- public void OnActive()
- {
- if (null != childOp && childOp.ValueList.Count > 2 && (childOp.ValueList[0] is Instance instance) && (childOp.ValueList[2] is string key))
- {
- int instanceIndex = instance.Index;
- int propertyIndex = (int)childOp.ValueList[1];
- globalDataList.Operations.Add(new SetDynamicResource(globalDataList, instanceIndex, propertyIndex, key));
- }
- }
- }
-}
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-using Tizen.NUI.Binding;
-using Tizen.NUI.Binding.Internals;
-
-namespace Tizen.NUI.EXaml
-{
- internal class SetPropertyAction : Action
- {
- public SetPropertyAction(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case ' ':
- case '\n':
- case '\r':
- break;
-
- case '(':
- childOp = new GetValueListAction(')', this);
- return childOp;
-
- case ']':
- parent?.OnActive();
- return parent;
- }
-
- return this;
- }
-
- private GetValueListAction childOp;
-
- public void Init()
- {
- childOp = null;
- }
-
- public void OnActive()
- {
- if (null != childOp && childOp.ValueList.Count > 2 && (childOp.ValueList[0] is Instance instance))
- {
- int instanceIndex = instance.Index;
- int propertyIndex = (int)childOp.ValueList[1];
- var value = childOp.ValueList[2];
- globalDataList.Operations.Add(new SetProperty(globalDataList, instanceIndex, propertyIndex, value));
- }
- }
- }
-}
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-
-namespace Tizen.NUI.EXaml
-{
- internal class GatherAssembliesBlock : Action
- {
- public GatherAssembliesBlock(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case ' ':
- case '\n':
- case '\r':
- break;
-
- case '\"':
- childOp = new GetValueAction(c, this);
- return childOp;
-
- case '>':
- parent?.OnActive();
- return parent;
- }
-
- return this;
- }
-
- private GetValueAction childOp;
-
- public void Init()
- {
- childOp = null;
- }
-
- public void OnActive()
- {
- var readedAssemblyName = childOp.Value as string;
- globalDataList.PreLoadOperations.Add(new GatherAssembly(globalDataList, readedAssemblyName));
- childOp = null;
- }
- }
-}
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-
-namespace Tizen.NUI.EXaml
-{
- internal class GatherBindablePropertiesBlock : Action
- {
- public GatherBindablePropertiesBlock(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case ' ':
- case '\n':
- case '\r':
- break;
-
- case '(':
- childOp = new GetValueListAction(')', this);
- return childOp;
-
- case '>':
- parent?.OnActive();
- return parent;
- }
-
- return this;
- }
-
- private GetValueListAction childOp;
-
- public void Init()
- {
- childOp = null;
- }
-
- public void OnActive()
- {
- int typeIndex = int.Parse(childOp.ValueList[0] as string);
- string propertyName = childOp.ValueList[1] as string;
-
- globalDataList.PreLoadOperations.Add(new GatherBindableProperties(globalDataList, typeIndex, propertyName));
- }
- }
-}
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-
-namespace Tizen.NUI.EXaml
-{
- internal class GatherEventsBlock : Action
- {
- public GatherEventsBlock(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case ' ':
- case '\n':
- case '\r':
- break;
-
- case '(':
- childOp = new GetValueListAction(')', this);
- return childOp;
-
- case '>':
- parent?.OnActive();
- return parent;
- }
-
- return this;
- }
-
- private GetValueListAction childOp;
-
- public void Init()
- {
- childOp = null;
- }
-
- public void OnActive()
- {
- int typeIndex = int.Parse(childOp.ValueList[0] as string);
- string eventName = childOp.ValueList[1] as string;
-
- globalDataList.PreLoadOperations.Add(new GatherEvent(globalDataList, typeIndex, eventName));
- }
- }
-}
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-
-namespace Tizen.NUI.EXaml
-{
- internal class GatherLongStringsBlock : Action
- {
- public GatherLongStringsBlock(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case '>':
- blockStartCount--;
- break;
-
- case '<':
- blockStartCount++;
- break;
- }
-
- if (0 == blockStartCount)
- {
- parent?.OnActive();
- return parent;
- }
- else
- {
- globalDataList.LongStrings += c;
- return this;
- }
- }
-
- private int blockStartCount = 1;
-
- public void Init()
- {
- }
-
- public void OnActive()
- {
- }
- }
-}
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-
-namespace Tizen.NUI.EXaml
-{
- internal class GatherMethodsBlock : Action
- {
- public GatherMethodsBlock(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case ' ':
- case '\n':
- case '\r':
- break;
-
- case '(':
- childOp = new GetValueListAction(')', this);
- return childOp;
-
- case '>':
- parent?.OnActive();
- return parent;
- }
-
- return this;
- }
-
- private GetValueListAction childOp;
-
- public void Init()
- {
- childOp = null;
- }
-
- public void OnActive()
- {
- int typeIndex = int.Parse(childOp.ValueList[0] as string);
- string name = childOp.ValueList[1] as string;
- var paramList = childOp.ValueList[2] as List<object>;
- globalDataList.PreLoadOperations.Add(new GatherMethod(globalDataList, typeIndex, name, paramList));
- }
- }
-}
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-
-namespace Tizen.NUI.EXaml
-{
- internal class GatherPropertiesBlock : Action
- {
- public GatherPropertiesBlock(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case ' ':
- case '\n':
- case '\r':
- break;
-
- case '(':
- childOp = new GetValueListAction(')', this);
- return childOp;
-
- case '>':
- parent?.OnActive();
- return parent;
- }
-
- return this;
- }
-
- private GetValueListAction childOp;
-
- public void Init()
- {
- childOp = null;
- }
-
- public void OnActive()
- {
- int typeIndex = int.Parse(childOp.ValueList[0] as string);
- string propertyName = childOp.ValueList[1] as string;
-
- globalDataList.PreLoadOperations.Add(new GatherProperty(globalDataList, typeIndex, propertyName));
- }
- }
-}
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-
-namespace Tizen.NUI.EXaml
-{
- internal class GatherTypesBlock : Action
- {
- public GatherTypesBlock(GlobalDataList globalDataList, Action parent)
- {
- this.parent = parent;
- this.globalDataList = globalDataList;
- }
-
- private Action parent;
- private GlobalDataList globalDataList;
-
- public Action DealChar(char c)
- {
- switch (c)
- {
- case ' ':
- case '\n':
- case '\r':
- break;
-
- case '(':
- childOp = new GetValueListAction(')', this);
- return childOp;
-
- case '>':
- parent?.OnActive();
- return parent;
- }
-
- return this;
- }
-
- private GetValueListAction childOp;
-
- public void Init()
- {
- childOp = null;
- }
-
- public void OnActive()
- {
- globalDataList.PreLoadOperations.Add(GatherType(childOp.ValueList));
- childOp = null;
- }
-
- private GatherType GatherType(List<object> valueList)
- {
- int assemblyIndex = int.Parse(valueList[0] as string);
- string typeName = valueList[valueList.Count - 1] as string;
-
- if (valueList.Count > 2)
- {
- List<int> genericTypeIndexs = new List<int>();
- var genericTypeIndexList = valueList[1] as List<object>;
- if (genericTypeIndexList != null)
- {
- foreach (var index in genericTypeIndexList)
- {
- genericTypeIndexs.Add((int)index);
- }
- }
- return new GatherType(globalDataList, assemblyIndex, typeName, genericTypeIndexs);
- }
- else
- {
- return new GatherType(globalDataList, assemblyIndex, typeName);
- }
- }
- }
-}
{
var globalDataList = new GlobalDataList();
- int index = 0;
-
- var createInstance = new CreateInstanceAction(globalDataList, null);
- var getObjectByProperty = new GetObjectByPropertyAction(globalDataList, null);
- var addExistInstance = new AddExistInstanceAction(globalDataList, null);
- var registerXName = new RegisterXNameAction(globalDataList, null);
- var setProperty = new SetPropertyAction(globalDataList, null);
- var addToCollectionProperty = new AddToCollectionPropertyAction(globalDataList, null);
- var addEvent = new AddEventAction(globalDataList, null);
- var setBindalbeProperty = new SetBindalbePropertyAction(globalDataList, null);
- var addObject = new CallAddMethodAction(globalDataList, null);
- var setDynamicResourceAction = new SetDynamicResourceAction(globalDataList, null);
- var addToResourceDictionaryAction = new AddToResourceDictionaryAction(globalDataList, null);
- var setBindingAction = new SetBindingAction(globalDataList, null);
- var otherActions = new OtherActions(globalDataList, null);
-
- Action currentOp = null;
-
- Action[] blockActions = new Action[]
- {
- new GatherAssembliesBlock(globalDataList, null),
- new GatherTypesBlock(globalDataList, null),
- new GatherPropertiesBlock(globalDataList, null),
- new GatherEventsBlock(globalDataList, null),
- new GatherMethodsBlock(globalDataList, null),
- new GatherBindablePropertiesBlock(globalDataList, null),
- new GatherLongStringsBlock(globalDataList, null)
- };
+ Action currentAction = new RootAction(globalDataList);
foreach (char c in xaml)
{
- if (null == currentOp)
- {
- switch (c)
- {
- case '<':
- currentOp = blockActions[index++];
- currentOp.Init();
- break;
-
- case '{':
- currentOp = createInstance;
- currentOp.Init();
- break;
-
- case '`':
- currentOp = getObjectByProperty;
- currentOp.Init();
- break;
-
- case '@':
- currentOp = addExistInstance;
- currentOp.Init();
- break;
-
- case '&':
- currentOp = registerXName;
- currentOp.Init();
- break;
-
- case '[':
- currentOp = setProperty;
- currentOp.Init();
- break;
-
- case '~':
- currentOp = addToCollectionProperty;
- currentOp.Init();
- break;
-
- case '#':
- currentOp = addEvent;
- currentOp.Init();
- break;
-
- case '!':
- currentOp = setBindalbeProperty;
- currentOp.Init();
- break;
-
- case '$':
- currentOp = setDynamicResourceAction;
- currentOp.Init();
- break;
-
- case '^':
- currentOp = addObject;
- currentOp.Init();
- break;
-
- case '*':
- currentOp = addToResourceDictionaryAction;
- currentOp.Init();
- break;
-
- case '%':
- currentOp = setBindingAction;
- currentOp.Init();
- break;
-
- case 'a':
- currentOp = otherActions;
- currentOp.Init();
- break;
- }
- }
- else
- {
- currentOp = currentOp.DealChar(c);
- }
+ Console.Write(c);
+ currentAction = currentAction.DealChar(c);
}
foreach (var op in globalDataList.PreLoadOperations)
{
internal class AddEvent : Operation
{
- public AddEvent(GlobalDataList globalDataList, int instanceIndex, int elementIndex, int eventIndex, int valueIndex)
+ public AddEvent(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.instanceIndex = instanceIndex;
- this.elementIndex = elementIndex;
- this.eventIndex = eventIndex;
- this.valueIndex = valueIndex;
+ instanceIndex = (int)operationInfo[0];
+ elementIndex = (int)operationInfo[1];
+ eventIndex = (int)operationInfo[2];
+ valueIndex = (int)operationInfo[3];
this.globalDataList = globalDataList;
}
namespace Tizen.NUI.EXaml
{
- internal class CallAddMethod : Operation
+ internal class AddObject : Operation
{
- public CallAddMethod(GlobalDataList globalDataList, int parentIndex, object child, int methodIndex)
+ public AddObject(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.parentIndex = parentIndex;
- this.child = child;
- this.methodIndex = methodIndex;
+ parentIndex = (int)operationInfo[0];
+ child = operationInfo[1];
+ methodIndex = (int)operationInfo[2];
this.globalDataList = globalDataList;
}
namespace Tizen.NUI.EXaml
{
- internal class AddToCollectionInstance : Operation
+ internal class AddToCollectionObject : Operation
{
- public AddToCollectionInstance(GlobalDataList globalDataList, int instanceIndex, object value)
+ public AddToCollectionObject(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.instanceIndex = instanceIndex;
- this.value = value;
+ instanceIndex = (int)operationInfo[0];
+ value = operationInfo[1];
this.globalDataList = globalDataList;
}
{
internal class AddToCollectionProperty : Operation
{
- public AddToCollectionProperty(GlobalDataList globalDataList, int instanceIndex, object value)
+ public AddToCollectionProperty(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.instanceIndex = instanceIndex;
- this.value = value;
+ instanceIndex = (int)operationInfo[0];
+ value = operationInfo[1];
this.globalDataList = globalDataList;
}
{
internal class AddToResourceDictionary : Operation
{
- internal AddToResourceDictionary(GlobalDataList globalDataList, int instanceIndex, string key, object value)
+ public AddToResourceDictionary(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.instanceIndex = instanceIndex;
- this.key = key;
- this.value = value;
+ instanceIndex = (int)operationInfo[0];
+ key = operationInfo[1] as string;
+ value = operationInfo[2];
this.globalDataList = globalDataList;
}
namespace Tizen.NUI.EXaml
{
- internal class CreateArrayInstance : Operation
+ internal class CreateArrayObject : Operation
{
- public CreateArrayInstance(GlobalDataList globalDataList, int typeIndex, List<object> items)
+ public CreateArrayObject(GlobalDataList globalDataList, List<object> operationInfos)
{
- this.typeIndex = typeIndex;
- this.items = items;
+ this.typeIndex = (int)operationInfos[0];
+ if (2 == operationInfos.Count)
+ {
+ this.items = operationInfos[1] as List<object>;
+ }
this.globalDataList = globalDataList;
}
public void Do()
{
var type = globalDataList.GatheredTypes[typeIndex];
- var array = Array.CreateInstance(type, items.Count);
+ var array = Array.CreateInstance(type, null == items ? 0 : items.Count);
- for (int i = 0; i < items.Count; i++)
+ if (null != items)
{
- if (items[i] is Instance instance)
+ for (int i = 0; i < items.Count; i++)
{
- ((IList)array)[i] = globalDataList.GatheredInstances[instance.Index];
+ if (items[i] is Instance instance)
+ {
+ ((IList)array)[i] = globalDataList.GatheredInstances[instance.Index];
+ }
}
}
{
class CreateDataTemplate : Operation
{
- public CreateDataTemplate(GlobalDataList globalDataList, int typeIndex, (int, int) indexRangeOfContent)
+ public CreateDataTemplate(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.typeIndex = typeIndex;
- this.indexRangeOfContent = indexRangeOfContent;
+ typeIndex = (int)operationInfo[0];
+ indexRangeOfContent = ((int)operationInfo[1], (int)operationInfo[2]);
this.globalDataList = globalDataList;
}
namespace Tizen.NUI.EXaml
{
- internal class CreateInstance : Operation
+ internal class CreateObject : Operation
{
- public CreateInstance(GlobalDataList globalDataList, int typeIndex, int xFactoryMethodIndex, List<object> paramList = null)
+ public CreateObject(GlobalDataList globalDataList, List<object> operationInfos)
{
- this.typeIndex = typeIndex;
- this.paramList = paramList;
+ this.typeIndex = (int)operationInfos[0];
+ this.xFactoryMethodIndex = (int)operationInfos[1];
+ if (3 == operationInfos.Count)
+ {
+ this.paramList = operationInfos[2] as List<object>;
+ }
this.globalDataList = globalDataList;
- this.xFactoryMethodIndex = xFactoryMethodIndex;
}
private GlobalDataList globalDataList;
{
internal class GatherAssembly : Operation
{
- public GatherAssembly(GlobalDataList globalDataList, string assemblyName)
+ public GatherAssembly(GlobalDataList globalDataList, List<object> opInfo)
{
- this.assemblyName = assemblyName;
+ this.assemblyName = opInfo[0] as string;
this.globalDataList = globalDataList;
}
{
internal class GatherBindableProperties : Operation
{
- public GatherBindableProperties(GlobalDataList globalDataList, int typeIndex, string propertyName)
+ public GatherBindableProperties(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.typeIndex = typeIndex;
- this.propertyName = propertyName;
+ typeIndex = (int)operationInfo[0];
+ propertyName = operationInfo[1] as string;
this.globalDataList = globalDataList;
}
{
internal class GatherEvent : Operation
{
- public GatherEvent(GlobalDataList globalDataList, int typeIndex, string eventName)
+ public GatherEvent(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.typeIndex = typeIndex;
- this.eventName = eventName;
+ typeIndex = (int)operationInfo[0];
+ eventName = operationInfo[1] as string;
this.globalDataList = globalDataList;
}
{
internal class GatherMethod : Operation
{
- public GatherMethod(GlobalDataList globalDataList, int typeIndex, string methodName, List<object> paramList)
+ public GatherMethod(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.typeIndex = typeIndex;
- this.methodName = methodName;
+ typeIndex = (int)operationInfo[0];
+ methodName = operationInfo[1] as string;
+ paramList = operationInfo[2] as List<object>;
this.globalDataList = globalDataList;
- this.paramList = paramList;
}
private GlobalDataList globalDataList;
{
List<Type> paramTypeList = new List<Type>();
- foreach (var obj in paramList)
+ if (null != paramList)
{
- int index = (int)obj;
-
- if (null == paramTypeList)
+ foreach (var obj in paramList)
{
- paramTypeList = new List<Type>();
- }
+ int index = (int)obj;
- if (index >= 0)
- {
- paramTypeList.Add(globalDataList.GatheredTypes[index]);
- }
- else
- {
- paramTypeList.Add(GetBaseType.GetBaseTypeByIndex(index));
+ if (null == paramTypeList)
+ {
+ paramTypeList = new List<Type>();
+ }
+
+ if (index >= 0)
+ {
+ paramTypeList.Add(globalDataList.GatheredTypes[index]);
+ }
+ else
+ {
+ paramTypeList.Add(GetBaseType.GetBaseTypeByIndex(index));
+ }
}
}
{
internal class GatherProperty : Operation
{
- public GatherProperty(GlobalDataList globalDataList, int typeIndex, string propertyName)
+ public GatherProperty(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.typeIndex = typeIndex;
- this.propertyName = propertyName;
+ typeIndex = (int)operationInfo[0];
+ propertyName = operationInfo[1] as string;
this.globalDataList = globalDataList;
}
{
internal class GatherType : Operation
{
- public GatherType(GlobalDataList globalDataList, int assemblyIndex, string typeName, List<int> genericTypeIndexs = null)
+ public GatherType(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.assemblyIndex = assemblyIndex;
- this.typeName = typeName;
- this.genericTypeIndexs = genericTypeIndexs;
+ this.assemblyIndex = (int)operationInfo[0];
+ this.typeName = operationInfo[1] as string;
+ if (3 == operationInfo.Count)
+ {
+ this.genericTypeIndexs = operationInfo[2] as List<object>;
+ }
this.globalDataList = globalDataList;
}
var assembly = globalDataList.GatheredAssemblies[assemblyIndex];
var type = assembly.GetType(typeName);
+ if (null != genericTypeIndexs_bak)
+ {
+ Type[] args = new Type[genericTypeIndexs_bak.Count];
+
+ for (int i = 0; i < genericTypeIndexs_bak.Count; i++)
+ {
+ int typeIndex = genericTypeIndexs_bak[i];
+
+ if (typeIndex >= 0)
+ {
+ args[i] = globalDataList.GatheredTypes[typeIndex];
+ }
+ else
+ {
+ args[i] = GetBaseType.GetBaseTypeByIndex(typeIndex);
+ }
+ }
+
+ type = type.MakeGenericType(args);
+ }
+
if (null != genericTypeIndexs)
{
Type[] args = new Type[genericTypeIndexs.Count];
for (int i = 0; i < genericTypeIndexs.Count; i++)
{
- int typeIndex = genericTypeIndexs[i];
+ int typeIndex = (int)genericTypeIndexs[i];
if (typeIndex >= 0)
{
private int assemblyIndex;
private string typeName;
- private List<int> genericTypeIndexs;
+ private List<int> genericTypeIndexs_bak;
+ private List<object> genericTypeIndexs;
}
}
namespace Tizen.NUI.EXaml
{
- internal class GatherEnumValue : Operation
+ internal class GetEnumObject : Operation
{
- public GatherEnumValue(GlobalDataList globalDataList, int typeIndex, string value)
+ public GetEnumObject(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.typeIndex = typeIndex;
- this.value = value;
+ typeIndex = (int)operationInfo[0];
+ value = operationInfo[1] as string;
this.globalDataList = globalDataList;
}
{
internal class GetObjectByProperty : Operation
{
- public GetObjectByProperty(GlobalDataList globalDataList, int instanceIndex, string propertyName)
+ public GetObjectByProperty(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.instanceIndex = instanceIndex;
- this.propertyName = propertyName;
+ instanceIndex = (int)operationInfo[0];
+ propertyName = operationInfo[1] as string;
this.globalDataList = globalDataList;
}
namespace Tizen.NUI.EXaml
{
- internal class GatherConvertedValue : Operation
+ internal class GetObjectConvertedFromString : Operation
{
- public GatherConvertedValue(GlobalDataList globalDataList, int converterIndex, string value)
+ public GetObjectConvertedFromString(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.converterIndex = converterIndex;
- this.value = value;
+ object value0 = operationInfo[0];
+ converterIndex = (value0 is Instance) ? (value0 as Instance).Index : (int)value0;
+ value = operationInfo[1] as string;
this.globalDataList = globalDataList;
}
namespace Tizen.NUI.EXaml
{
- internal class GatherStaticInstance : Operation
+ internal class GetStaticObject : Operation
{
- public GatherStaticInstance(GlobalDataList globalDataList, int typeIndex, string propertyName, string fieldName)
+ public GetStaticObject(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.typeIndex = typeIndex;
- this.propertyName = propertyName;
- this.fieldName = fieldName;
+ typeIndex = (int)operationInfo[0];
+ propertyName = operationInfo[1] as string;
+ fieldName = operationInfo[2] as string;
this.globalDataList = globalDataList;
}
namespace Tizen.NUI.EXaml
{
- internal class GatherTypeObject : Operation
+ internal class GetTypeObject : Operation
{
- public GatherTypeObject(GlobalDataList globalDataList, int typeIndex)
+ public GetTypeObject(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.typeIndex = typeIndex;
+ typeIndex = (int)operationInfo[0];
this.globalDataList = globalDataList;
}
{
internal class RegisterXName : Operation
{
- public RegisterXName(GlobalDataList globalDataList, object instance, string name)
+ public RegisterXName(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.instance = instance;
- this.name = name;
+ instance = operationInfo[0];
+ name = operationInfo[1] as string;
this.globalDataList = globalDataList;
}
namespace Tizen.NUI.EXaml
{
- internal class SetBindalbeProperty : Operation
+ internal class SetBindableProperty : Operation
{
- public SetBindalbeProperty(GlobalDataList globalDataList, int instanceIndex, int bindalbePropertyIndex, object value)
+ public SetBindableProperty(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.instanceIndex = instanceIndex;
- this.bindalbePropertyIndex = bindalbePropertyIndex;
- this.value = value;
+ instanceIndex = (int)operationInfo[0];
+ bindablePropertyIndex = (int)operationInfo[1];
+ value = operationInfo[2];
this.globalDataList = globalDataList;
}
if (null != instance)
{
- var property = globalDataList.GatheredBindableProperties[bindalbePropertyIndex];
+ var property = globalDataList.GatheredBindableProperties[bindablePropertyIndex];
if (value is Instance valueInstance)
{
}
private int instanceIndex;
- private int bindalbePropertyIndex;
+ private int bindablePropertyIndex;
private object value;
}
}
{
internal class SetBinding : Operation
{
- public SetBinding(GlobalDataList globalDataList, int instanceIndex, int bindablePropertyIndex, int valueIndex)
+ public SetBinding(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.instanceIndex = instanceIndex;
- this.bindablePropertyIndex = bindablePropertyIndex;
- this.valueIndex = valueIndex;
+ instanceIndex = (int)operationInfo[0];
+ bindablePropertyIndex = (int)operationInfo[1];
+ valueIndex = (int)operationInfo[2];
this.globalDataList = globalDataList;
}
{
internal class SetDynamicResource : Operation
{
- public SetDynamicResource(GlobalDataList globalDataList, int instanceIndex, int propertyIndex, string key)
+ public SetDynamicResource(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.instanceIndex = instanceIndex;
- this.propertyIndex = propertyIndex;
- this.key = key;
+ instanceIndex = (int)operationInfo[0];
+ propertyIndex = (int)operationInfo[1];
+ key = operationInfo[2] as string;
this.globalDataList = globalDataList;
}
{
internal class SetProperty : Operation
{
- public SetProperty(GlobalDataList globalDataList, int instanceIndex, int propertyIndex, object value)
+ public SetProperty(GlobalDataList globalDataList, List<object> operationInfo)
{
- this.instanceIndex = instanceIndex;
- this.propertyIndex = propertyIndex;
- this.value = value;
+ instanceIndex = (int)operationInfo[0];
+ propertyIndex = (int)operationInfo[1];
+ value = operationInfo[2];
this.globalDataList = globalDataList;
}
--- /dev/null
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Tizen.NUI.EXaml
+{
+ internal enum EXamlOperationType
+ {
+ GatherAssembly = 0,
+ GatherType,
+ GatherProperty,
+ GatherEvent,
+ GatherMethod,
+ GatherBindableProperty,
+ CreateObject,
+ CreateArrayObject,
+ CreateDataTemplate,
+ GetStaticObject,
+ GetTypeObject,
+ GetObjectConvertedFromString,
+ GetEnumObject,
+ GetObjectByProperty,
+ SetProperty,
+ SetBindableProperty,
+ SetBinding,
+ SetDynamicResource,
+ AddEvent,
+ AddObject,
+ AddToCollectionObject,
+ AddToCollectionProperty,
+ AddToResourceDictionary,
+ RegisterXName,
+ GetLongString,
+ MAX
+ }
+}