VCCodeEnum.BodyText Свойство
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Получает или задает текст тела родительского объекта.
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(579)]
public string BodyText { [System.Runtime.InteropServices.DispId(579)] [System.Runtime.InteropServices.TypeLibFunc(System.Runtime.InteropServices.TypeLibFuncFlags.FNonBrowsable)] get; [System.Runtime.InteropServices.DispId(579)] [System.Runtime.InteropServices.TypeLibFunc(System.Runtime.InteropServices.TypeLibFuncFlags.FNonBrowsable)] set; }
[<System.Runtime.InteropServices.DispId(579)>]
[<get: System.Runtime.InteropServices.DispId(579)>]
[<get: System.Runtime.InteropServices.TypeLibFunc(System.Runtime.InteropServices.TypeLibFuncFlags.FNonBrowsable)>]
[<set: System.Runtime.InteropServices.DispId(579)>]
[<set: System.Runtime.InteropServices.TypeLibFunc(System.Runtime.InteropServices.TypeLibFuncFlags.FNonBrowsable)>]
member this.BodyText : string with get, set
Public Property BodyText As String
Значение свойства
Текст тела родительского объекта.
- Атрибуты
Примеры
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
Комментарии
Основной текст определяется как текст между фигурными скобками объявления ("{" и "}") элемента кода, представленного родительским объектом.
Сведения о том, как скомпилировать и запустить этот пример, см. в разделе как скомпилировать пример кода для Visual C++ расширяемости модели кода .