mirror of https://github.com/icsharpcode/ILSpy.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.0 KiB
41 lines
1.0 KiB
// <file> |
|
// <copyright name="David Srbecký" email="dsrbecky@gmail.com"/> |
|
// <license name="GPL"/> |
|
// </file> |
|
|
|
using System; |
|
using System.Windows.Forms; |
|
|
|
using Mono.Cecil; |
|
|
|
namespace Decompiler |
|
{ |
|
/// <summary> |
|
/// Class with program entry point. |
|
/// </summary> |
|
internal sealed class Program |
|
{ |
|
/// <summary> |
|
/// Program entry point. |
|
/// </summary> |
|
[STAThread] |
|
private static void Main(string[] args) |
|
{ |
|
string sourceCode = Decompile(@"..\..\tests\ClassStructure\bin\Debug\ClassStructure.dll"); |
|
|
|
Application.EnableVisualStyles(); |
|
Application.SetCompatibleTextRenderingDefault(false); |
|
MainForm mainForm = new MainForm(); |
|
mainForm.SourceCode = sourceCode; |
|
Application.Run(mainForm); |
|
} |
|
|
|
static string Decompile(string filename) |
|
{ |
|
AssemblyDefinition assembly = AssemblyFactory.GetAssembly(filename); |
|
CodeDomBuilder codeDomBuilder = new CodeDomBuilder(); |
|
codeDomBuilder.AddAssembly(assembly); |
|
return codeDomBuilder.GenerateCode(); |
|
} |
|
} |
|
}
|
|
|