VCCodeIDLCoClass.BodyText Özellik
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Nesnenin gövde metnini alır veya ayarlar.
public:
property System::String ^ BodyText { System::String ^ get(); void set(System::String ^ value); };
public:
property Platform::String ^ BodyText { Platform::String ^ get(); void set(Platform::String ^ value); };
[System.Runtime.InteropServices.DispId(580)]
public string BodyText { [System.Runtime.InteropServices.DispId(580)] [System.Runtime.InteropServices.TypeLibFunc(System.Runtime.InteropServices.TypeLibFuncFlags.FNonBrowsable)] get; [System.Runtime.InteropServices.DispId(580)] [System.Runtime.InteropServices.TypeLibFunc(System.Runtime.InteropServices.TypeLibFuncFlags.FNonBrowsable)] set; }
[<System.Runtime.InteropServices.DispId(580)>]
[<get: System.Runtime.InteropServices.DispId(580)>]
[<get: System.Runtime.InteropServices.TypeLibFunc(System.Runtime.InteropServices.TypeLibFuncFlags.FNonBrowsable)>]
[<set: System.Runtime.InteropServices.DispId(580)>]
[<set: System.Runtime.InteropServices.TypeLibFunc(System.Runtime.InteropServices.TypeLibFuncFlags.FNonBrowsable)>]
member this.BodyText : string with get, set
Public Property BodyText As String
Özellik Değeri
Nesnenin gövde metni.
- Öznitelikler
Örnekler
Imports EnvDTE
Imports System.Diagnostics
Imports VisualStudio.VCCodeModel
Public Module MyMacro
' Adds a function to MyClass.
Sub AddFunctionCode()
Dim cm As VCCodeModel
cm = DTE.Solution.Item(1).CodeModel
Dim cl As VCCodeClass
cl = cm.Classes.Item("MyClass")
Dim strBody As String
strBody = "return 0;"
Dim func1 As VCCodeFunction
func1 = cl.AddFunction("MyFunction", vsCMFunction.vsCMFunctionFunction, "int")
'Sets the property BodyText to strBody
func1.BodyText = strBody
End Sub
End Module
Açıklamalar
Gövde metni, nesne tarafından temsil edilen kod öğesinin bildirim ayraçları (' {' ve '} ') arasında metin olarak tanımlanır.
Bu örneği derlemek ve çalıştırmak hakkında bilgi için bkz. nasıl yapılır: Visual C++ Code Model genişletilebilirliği Için örnek kod derleme .