Bagikan melalui


CodeSnippetCompileUnit Konstruktor

Definisi

Menginisialisasi instans baru kelas CodeSnippetCompileUnit.

Overload

CodeSnippetCompileUnit()

Menginisialisasi instans baru kelas CodeSnippetCompileUnit.

CodeSnippetCompileUnit(String)

Menginisialisasi instans baru kelas CodeSnippetCompileUnit.

CodeSnippetCompileUnit()

Sumber:
CodeSnippetCompileUnit.cs
Sumber:
CodeSnippetCompileUnit.cs
Sumber:
CodeSnippetCompileUnit.cs

Menginisialisasi instans baru kelas CodeSnippetCompileUnit.

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

Keterangan

Jika Anda menggunakan konstruktor ini, Anda juga harus mengatur Value properti .

Berlaku untuk

CodeSnippetCompileUnit(String)

Sumber:
CodeSnippetCompileUnit.cs
Sumber:
CodeSnippetCompileUnit.cs
Sumber:
CodeSnippetCompileUnit.cs

Menginisialisasi instans baru kelas CodeSnippetCompileUnit.

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

Parameter

value
String

Fragmen kode harfiah untuk diwakili.

Contoh

Contoh kode berikut menunjukkan cara membuat instans CodeSnippetCompileUnit baru kelas dengan menggunakan string yang mewakili kode harfiah.

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

Berlaku untuk