This documentation is archived and is not being maintained.

CodeSnippetCompileUnit Constructor

.NET Framework 1.1

Initializes a new instance of the CodeSnippetCompileUnit class.

[Visual Basic]
Public Sub New( _
   ByVal value As String _
)
[C#]
public CodeSnippetCompileUnit(
   string value
);
[C++]
public: CodeSnippetCompileUnit(
   String* value
);
[JScript]
public function CodeSnippetCompileUnit(
   value : String
);

Parameters

value
The literal code fragment to represent.

Example

[Visual Basic] 
' Creates a compile unit using a literal sring.
Dim literalCode As String
literalCode = "using System; namespace TestLiteralCode " & _
    "{ public class TestClass { public TestClass() {} } }"
Dim csu As New CodeSnippetCompileUnit(literalCode)

[C#] 
// 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 );            

[C++] 
// Creates a compile unit using a literal sring;
String* literalCode;
literalCode = S"using System; namespace TestLiteralCode "  
    S"{ public class TestClass { public TestClass() {} } }";
CodeSnippetCompileUnit* csu = new CodeSnippetCompileUnit( literalCode );            

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

CodeSnippetCompileUnit Class | CodeSnippetCompileUnit Members | System.CodeDom Namespace

Show: