VCCodeFunction.BodyText 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置父对象的正文文本。
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(583)]
public string BodyText { [System.Runtime.InteropServices.DispId(583)] [System.Runtime.InteropServices.TypeLibFunc(System.Runtime.InteropServices.TypeLibFuncFlags.FNonBrowsable)] get; [System.Runtime.InteropServices.DispId(583)] [System.Runtime.InteropServices.TypeLibFunc(System.Runtime.InteropServices.TypeLibFuncFlags.FNonBrowsable)] set; }
[<System.Runtime.InteropServices.DispId(583)>]
[<get: System.Runtime.InteropServices.DispId(583)>]
[<get: System.Runtime.InteropServices.TypeLibFunc(System.Runtime.InteropServices.TypeLibFuncFlags.FNonBrowsable)>]
[<set: System.Runtime.InteropServices.DispId(583)>]
[<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++ 代码模型扩展性的示例代码 。