-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathProgram.cs
executable file
·82 lines (73 loc) · 2.38 KB
/
Program.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using System.Diagnostics;
using System.IO;
using System.Xml.Xsl;
using System.Text;
namespace XmlDocToMD
{
/// <summary>
/// The unique class of the application
/// </summary>
class Program
{
/// <summary>
/// The entry point of the application
/// </summary>
/// <remarks>This is the unique functional method. All others are dummies</remarks>
/// <param name="args">The argument list. Not used</param>
static void Main(string[] args)
{
var sourceFile = "xmldoc2md.xml";
var stylesheet = "xmldoc2md.xsl";
var outputMD = "sample.md";
// Load stylesheet
var xslt = new XslCompiledTransform(true);
xslt.Load(stylesheet);
// Creates the output buffer
var sb = new StringBuilder();
// Performs the transformation
using (var sw = new StringWriter(sb))
{
xslt.Transform(sourceFile, null, sw);
}
var md = sb.ToString();
File.WriteAllText(outputMD, md);
Process.Start(outputMD);
}
/// <summary>
/// A dummy method
/// </summary>
/// <param name="arg1">An integer argument</param>
/// <returns>A string representation of the argument</returns>
/// <exception cref="IOException">Whenever a file error occurs</exception>
/// <example>
/// <code>
/// int x = 1;
/// string s = DummyMethod(x);
/// </code>
/// </example>
public string DummyMethod(int arg1)
{
this.DummyProperty = arg1.ToString();
return this.DummyProperty;
}
/// <summary>
/// A private method
/// </summary>
private void PrivateMethod() { }
/// <summary>
/// A dummy property
/// </summary>
/// <seealso cref="DummyField"/>
/// <value>A string value</value>
public string DummyProperty
{
get { return this.DummyField; }
set { this.DummyField = value; }
}
/// <summary>
/// A dummy field
/// </summary>
/// <remarks>Backend for <see cref="DummyProperty"/>.</remarks>
public string DummyField;
}
}