eae1d25c2f491cc85462a700186791f458a4c979
[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, 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             ParentContextValues = parentContextValues;
39             Module = module;
40         }
41
42         public Dictionary<INode, object> Values { get; private set; }
43
44         public Dictionary<IElementNode, VariableDefinition> Variables { get; private set; }
45
46         public Dictionary<INode, Tuple<VariableDefinition, IList<string>>> Scopes { get; private set; }
47
48         public Dictionary<INode, TypeReference> TypeExtensions { get; }
49
50         public FieldDefinition ParentContextValues { get; private set; }
51
52         public object Root { get; set; } //FieldDefinition or VariableDefinition
53
54         public ILProcessor IL { get; private set; }
55
56         public MethodBody Body { get; private set; }
57
58         public List<Instruction> InsOfAddEvent { get; private set; }
59
60         public ModuleDefinition Module { get; private set; }
61     }
62 }
63