-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathILGenerationLanguage.cs
62 lines (51 loc) · 2.01 KB
/
ILGenerationLanguage.cs
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System.Collections.Generic;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Disassembler;
using Mono.Cecil;
using System.ComponentModel.Composition;
using ICSharpCode.ILSpy;
namespace ILGenerationLanguage.Plugin
{
[Export(typeof(Language))]
public class ILGenerationLanguage : Language
{
protected bool detectControlStructure = true;
public override string Name
{
get { return "IL Generation"; }
}
public override string FileExtension
{
get { return ".cs"; }
}
public override void DecompileMethod(MethodDefinition method, ITextOutput output, DecompilationOptions options)
{
var disassembler = new GeneratingDisassembler(output, options.CancellationToken);
disassembler.DisassembleMethod(method);
}
public override void DecompileField(FieldDefinition field, ITextOutput output, DecompilationOptions options)
{
output.WriteUnsupported();
}
public override void DecompileProperty(PropertyDefinition property, ITextOutput output, DecompilationOptions options)
{
output.WriteUnsupported();
}
public override void DecompileEvent(EventDefinition ev, ITextOutput output, DecompilationOptions options)
{
output.WriteUnsupported();
}
public override void DecompileType(TypeDefinition type, ITextOutput output, DecompilationOptions options)
{
output.WriteUnsupported();
}
public override void DecompileNamespace(string nameSpace, IEnumerable<TypeDefinition> types, ITextOutput output, DecompilationOptions options)
{
output.WriteUnsupported();
}
public override void DecompileAssembly(LoadedAssembly assembly, ITextOutput output, DecompilationOptions options)
{
output.WriteUnsupported();
}
}
}