Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,19 @@ class Program
static string sourceFileName = "test.cs";
static void Main(string[] args)
{
CodeDomProvider provider =
CodeDomProvider.CreateProvider(providerName);
CodeDomProvider provider = CodeDomProvider.CreateProvider(providerName);

LogMessage("Building CodeDOM graph...");

CodeCompileUnit cu = new CodeCompileUnit();

cu = BuildHelloWorldGraph();

//<Snippet5>
//<Snippet5>
StreamWriter sourceFile = new StreamWriter(sourceFileName);
provider.GenerateCodeFromCompileUnit(cu, sourceFile, null);
sourceFile.Close();
//</Snippet5>
//</Snippet5>

//<Snippet6>
CompilerParameters opt = new CompilerParameters(new string[]{
Expand Down Expand Up @@ -59,8 +58,7 @@ static void Main(string[] args)
}

//<Snippet2>
// Build a Hello World program graph using
// System.CodeDom types.
// Build a Hello World program graph using System.CodeDom types.
public static CodeCompileUnit BuildHelloWorldGraph()
{
// Create a new CodeCompileUnit to contain
Expand All @@ -82,9 +80,9 @@ public static CodeCompileUnit BuildHelloWorldGraph()
class1.Comments.Add(new CodeCommentStatement("<summary>", true));
class1.Comments.Add(new CodeCommentStatement(
"Create a Hello World application.", true));
class1.Comments.Add(new CodeCommentStatement("</summary>", true));
class1.Comments.Add(new CodeCommentStatement(
@"<seealso cref=" + '"' + "Class1.Main" + '"' + "/>", true));
class1.Comments.Add(new CodeCommentStatement("</summary>", true));

// Add the new type to the namespace type collection.
samples.Types.Add(class1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ Imports System.CodeDom.Compiler
Imports System.IO
Imports System.Text.RegularExpressions



Class Program
Private Shared providerName As String = "vb"
Private Shared sourceFileName As String = "test.vb"
Expand All @@ -21,7 +19,6 @@ Class Program
cu = BuildHelloWorldGraph()

'<Snippet5>

Dim sourceFile As New StreamWriter(sourceFileName)

LogMessage("Generating code...")
Expand Down Expand Up @@ -56,7 +53,6 @@ Class Program

End Sub


'<Snippet2>
' Build a Hello World program graph using
' System.CodeDom types.
Expand All @@ -80,10 +76,10 @@ Class Program
class1.Comments.Add(New CodeCommentStatement("<summary>", True))
class1.Comments.Add(New CodeCommentStatement( _
"Create a Hello World application.", True))
class1.Comments.Add(New CodeCommentStatement("</summary>", True))
class1.Comments.Add(New CodeCommentStatement( _
"<seealso cref=" & ControlChars.Quote & "Class1.Main" & _
ControlChars.Quote & "/>", True))
class1.Comments.Add(New CodeCommentStatement("</summary>", True))

' Add the new type to the namespace type collection.
samples.Types.Add(class1)
Expand Down Expand Up @@ -139,7 +135,6 @@ Class Program

End Sub


Shared Sub OutputResults(ByVal results As CompilerResults)
LogMessage(("NativeCompilerReturnValue=" & _
results.NativeCompilerReturnValue.ToString()))
Expand All @@ -150,4 +145,4 @@ Class Program

End Sub
End Class
'</Snippet1>
'</Snippet1>