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 = gcnew CodeSnippetCompileUnit( literalCode );

.NET Framework
Available since 1.1
Return to top
Show: