CodeSnippetCompileUnit Constructor (String)
Collapse the table of content
Expand the table of content

CodeSnippetCompileUnit Constructor (String)

 

Initializes a new instance of the CodeSnippetCompileUnit class.

Namespace:   System.CodeDom
Assembly:  System (in System.dll)

public CodeSnippetCompileUnit(
	string value
)

Parameters

value
Type: System.String

The literal code fragment to represent.

The following code example demonstrates how to create a new instance of the CodeSnippetCompileUnit class by using a string that represents literal code.

// Creates a compile unit using a literal sring;
string literalCode;
literalCode = "using System; namespace TestLiteralCode " + 
    "{ public class TestClass { public TestClass() {} } }";
CodeSnippetCompileUnit csu = new CodeSnippetCompileUnit( literalCode );            

.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft