[Xaml] Support import other xaml as the source of resource dictionary
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.XamlBuild / src / public / XamlBuild / ILContext.cs
1 /*
2  * Copyright(c) 2022 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17 using System;
18 using System.Collections.Generic;
19
20 using Mono.Cecil;
21 using Mono.Cecil.Cil;
22
23 using Tizen.NUI.Xaml;
24
25 namespace Tizen.NUI.Xaml.Build.Tasks
26 {
27     class ILContext
28     {
29         public ILContext(ILProcessor il, MethodBody body, List<Instruction> insOfAddEvent, ModuleDefinition module, string embeddedResourceNameSpace, FieldDefinition parentContextValues = null)
30         {
31             IL = il;
32             Body = body;
33             InsOfAddEvent = insOfAddEvent;
34             Values = new Dictionary<INode, object>();
35             Variables = new Dictionary<IElementNode, VariableDefinition>();
36             Scopes = new Dictionary<INode, Tuple<VariableDefinition, IList<string>>>();
37             TypeExtensions = new Dictionary<INode, TypeReference>();
38             EmbeddedResourceNameSpace = embeddedResourceNameSpace;
39             ParentContextValues = parentContextValues;
40             Module = module;
41         }
42
43         public Dictionary<INode, object> Values { get; private set; }
44
45         public Dictionary<IElementNode, VariableDefinition> Variables { get; private set; }
46
47         public Dictionary<INode, Tuple<VariableDefinition, IList<string>>> Scopes { get; private set; }
48
49         public Dictionary<INode, TypeReference> TypeExtensions { get; }
50
51         public string EmbeddedResourceNameSpace { get; }
52
53         public FieldDefinition ParentContextValues { get; private set; }
54
55         public object Root { get; set; } //FieldDefinition or VariableDefinition
56
57         public ILProcessor IL { get; private set; }
58
59         public MethodBody Body { get; private set; }
60
61         public List<Instruction> InsOfAddEvent { get; private set; }
62
63         public ModuleDefinition Module { get; private set; }
64     }
65 }
66