-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFrontend.cs
52 lines (43 loc) · 2.27 KB
/
Frontend.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
using System;
using System.Reflection;
using System.IO;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
namespace CSToMD {
public static class CSToMD {
internal const bool DEBUG = false;
public static void gen() {
FileStream markdown_file = File.Open("./output.md", FileMode.Create);
StreamWriter markdown_out = new StreamWriter(markdown_file);
markdown_out.WriteLine("| Parent Object | Signature | Datatype | Member Type | Description | Pseudocode |");
markdown_out.WriteLine("|:-:|:--|:-:|:-:|:--|:--|");
Assembly calling_assembly = Assembly.GetCallingAssembly();
foreach ( Type t in calling_assembly.GetTypes() ) {
if (Attribute.GetCustomAttribute(t, typeof(CompilerGeneratedAttribute)) != null) continue;
if (t.IsNested) continue;
string nextline = new DocClass(t).ToString().Replace("<", "\\<").Replace(">", "\\>").Replace("&", "");
markdown_out.WriteLine(nextline);
if (DEBUG) Console.WriteLine(nextline + "\n");
}
markdown_out.Close();
markdown_file.Close();
}
public static void gen_per_type() {
FileStream markdown_file = File.Open("./output.md", FileMode.Create);
StreamWriter markdown_out = new StreamWriter(markdown_file);
Assembly calling_assembly = Assembly.GetCallingAssembly();
foreach ( Type t in calling_assembly.GetTypes() ) {
if (Attribute.GetCustomAttribute(t, typeof(CompilerGeneratedAttribute)) != null) continue;
if (t.IsNested) continue;
string nextline = new DocClass(t).ToString().Replace("<", "\\<").Replace(">", "\\>").Replace("&", "");
markdown_out.WriteLine("| Parent Object | Signature | Datatype | Member Type | Description | Pseudocode |");
markdown_out.WriteLine("|:-:|:--|:-:|:-:|:--|:--|");
markdown_out.WriteLine(nextline);
markdown_out.WriteLine();
if (DEBUG) Console.WriteLine(nextline + "\n");
}
markdown_out.Close();
markdown_file.Close();
}
}
}