blob: 88b78ec3b97d75b2b64e0d8064813eaf2b3862a8 (
plain)
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
|
using Mono.Cecil;
using System.Collections.Generic;
namespace Mono.Linker.Tests.TestCasesRunner
{
public class TestReflectionPatternRecorder : IReflectionPatternRecorder
{
public struct ReflectionAccessPattern
{
public MethodDefinition SourceMethod;
public MethodDefinition ReflectionMethod;
public IMemberDefinition AccessedItem;
public string Message;
}
public List<ReflectionAccessPattern> RecognizedPatterns = new List<ReflectionAccessPattern> ();
public List<ReflectionAccessPattern> UnrecognizedPatterns = new List<ReflectionAccessPattern> ();
public void RecognizedReflectionAccessPattern (MethodDefinition sourceMethod, MethodDefinition reflectionMethod, IMemberDefinition accessedItem)
{
RecognizedPatterns.Add (new ReflectionAccessPattern {
SourceMethod = sourceMethod,
ReflectionMethod = reflectionMethod,
AccessedItem = accessedItem
});
}
public void UnrecognizedReflectionAccessPattern (MethodDefinition sourceMethod, MethodDefinition reflectionMethod, string message)
{
UnrecognizedPatterns.Add (new ReflectionAccessPattern {
SourceMethod = sourceMethod,
ReflectionMethod = reflectionMethod,
Message = message
});
}
}
}
|