Bewerken

Share via


CodeSnippetCompileUnit Constructors

Definition

Initializes a new instance of the CodeSnippetCompileUnit class.

Overloads

CodeSnippetCompileUnit()

Initializes a new instance of the CodeSnippetCompileUnit class.

CodeSnippetCompileUnit(String)

Initializes a new instance of the CodeSnippetCompileUnit class.

CodeSnippetCompileUnit()

Source:
CodeSnippetCompileUnit.cs
Source:
CodeSnippetCompileUnit.cs
Source:
CodeSnippetCompileUnit.cs
Source:
CodeSnippetCompileUnit.cs

Initializes a new instance of the CodeSnippetCompileUnit class.

public:
 CodeSnippetCompileUnit();
public CodeSnippetCompileUnit ();
Public Sub New ()

Remarks

If you use this constructor you should also set the Value property.

Applies to

CodeSnippetCompileUnit(String)

Source:
CodeSnippetCompileUnit.cs
Source:
CodeSnippetCompileUnit.cs
Source:
CodeSnippetCompileUnit.cs
Source:
CodeSnippetCompileUnit.cs

Initializes a new instance of the CodeSnippetCompileUnit class.

public:
 CodeSnippetCompileUnit(System::String ^ value);
public CodeSnippetCompileUnit (string value);
new System.CodeDom.CodeSnippetCompileUnit : string -> System.CodeDom.CodeSnippetCompileUnit
Public Sub New (value As String)

Parameters

value
String

The literal code fragment to represent.

Examples

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 );
// 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 );
' 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)

Applies to