-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathInjectContext.cs
More file actions
44 lines (39 loc) · 1.39 KB
/
InjectContext.cs
File metadata and controls
44 lines (39 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using dnlib.DotNet;
using System.Collections.Generic;
namespace kov.NET.Utils
{
/// <summary>
/// The context of an injection process.
/// </summary>
public class InjectContext
{
/// <summary>
/// The mapping of origin definitions to injected definitions.
/// </summary>
public readonly Dictionary<IDnlibDef, IDnlibDef> Map = new Dictionary<IDnlibDef, IDnlibDef>();
/// <summary>
/// The module which source type originated from.
/// </summary>
public readonly ModuleDef OriginModule;
/// <summary>
/// The module which source type is being injected to.
/// </summary>
public readonly ModuleDef TargetModule;
/// <summary>
/// Initializes a new instance of the <see cref="InjectContext" /> class.
/// </summary>
/// <param name="module">The origin module.</param>
/// <param name="target">The target module.</param>
public InjectContext(ModuleDef module, ModuleDef target)
{
OriginModule = module;
TargetModule = target;
Importer = new Importer(target, ImporterOptions.TryToUseTypeDefs);
}
/// <summary>
/// Gets the importer.
/// </summary>
/// <value>The importer.</value>
public Importer Importer { get; }
}
}