2016-12-30 19:58:48 +03:00
|
|
|
using System;
|
2016-03-22 23:02:25 +03:00
|
|
|
using System.Collections.Generic;
|
2016-12-30 19:58:48 +03:00
|
|
|
|
2016-03-22 23:02:25 +03:00
|
|
|
using Mono.Cecil;
|
|
|
|
using Mono.Cecil.Cil;
|
2016-12-30 19:58:48 +03:00
|
|
|
|
2016-03-22 23:02:25 +03:00
|
|
|
using Xamarin.Forms.Xaml;
|
|
|
|
|
|
|
|
namespace Xamarin.Forms.Build.Tasks
|
|
|
|
{
|
|
|
|
class ILContext
|
|
|
|
{
|
2016-11-15 22:39:48 +03:00
|
|
|
public ILContext(ILProcessor il, MethodBody body, ModuleDefinition module, FieldDefinition parentContextValues = null)
|
2016-03-22 23:02:25 +03:00
|
|
|
{
|
|
|
|
IL = il;
|
|
|
|
Body = body;
|
|
|
|
Values = new Dictionary<IValueNode, object>();
|
|
|
|
Variables = new Dictionary<IElementNode, VariableDefinition>();
|
2016-12-30 19:58:48 +03:00
|
|
|
Scopes = new Dictionary<INode, Tuple<VariableDefinition, IList<string>>>();
|
2016-03-22 23:02:25 +03:00
|
|
|
TypeExtensions = new Dictionary<INode, TypeReference>();
|
|
|
|
ParentContextValues = parentContextValues;
|
2016-11-15 22:39:48 +03:00
|
|
|
Module = module;
|
2016-03-22 23:02:25 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
public Dictionary<IValueNode, object> Values { get; private set; }
|
|
|
|
|
|
|
|
public Dictionary<IElementNode, VariableDefinition> Variables { get; private set; }
|
|
|
|
|
2016-12-30 19:58:48 +03:00
|
|
|
public Dictionary<INode, Tuple<VariableDefinition, IList<string>>> Scopes { get; private set; }
|
2016-03-22 23:02:25 +03:00
|
|
|
|
|
|
|
public Dictionary<INode, TypeReference> TypeExtensions { get; }
|
|
|
|
|
|
|
|
public FieldDefinition ParentContextValues { get; private set; }
|
|
|
|
|
|
|
|
public object Root { get; set; } //FieldDefinition or VariableDefinition
|
|
|
|
|
|
|
|
public ILProcessor IL { get; private set; }
|
|
|
|
|
|
|
|
public MethodBody Body { get; private set; }
|
2016-11-15 22:39:48 +03:00
|
|
|
|
|
|
|
public ModuleDefinition Module { get; private set; }
|
2016-03-22 23:02:25 +03:00
|
|
|
}
|
|
|
|
}
|