VCCodeStruct 接口

定义

一个对象,用于表示解决方案源代码中的结构代码元素。

public interface class VCCodeStruct
public interface class VCCodeStruct
__interface VCCodeStruct
[System.Runtime.InteropServices.Guid("EBA82D38-45C9-49E1-B85E-A10073BBB4E4")]
[System.Runtime.InteropServices.TypeLibType(System.Runtime.InteropServices.TypeLibTypeFlags.FDispatchable | System.Runtime.InteropServices.TypeLibTypeFlags.FDual)]
public interface VCCodeStruct
[<System.Runtime.InteropServices.Guid("EBA82D38-45C9-49E1-B85E-A10073BBB4E4")>]
[<System.Runtime.InteropServices.TypeLibType(System.Runtime.InteropServices.TypeLibTypeFlags.FDispatchable | System.Runtime.InteropServices.TypeLibTypeFlags.FDual)>]
type VCCodeStruct = interface
Public Interface VCCodeStruct
属性

示例

此示例检索当前解决方案的所有结构代码元素,并在消息框中显示每个名称。

[Visual Basic]

Sub GetAllStructs()  
    Dim vcCM As VCCodeModel  
    Dim vcStruct As VCCodeStruct  
    vcCM = DTE.Solution.Item(1).CodeModel  
    For Each vcStruct in vcCM.Structs  
        MsgBox(vcStruct.DisplayName)  
    Next  
End Sub  

注解

VCCodeStruct对象用于修改现有函数构造。

备注

对象提供此对象的大部分功能 Visual Studio CodeStruct 。 有关详细信息,请参阅 CodeStruct 对象。

属性

Access

定义此项的访问特性。

Attributes

获取父对象的所有特性的集合。

Bases

获取从其派生此项的类的集合。

BodyText

获取或设置对象的正文文本。

Children

获取此代码构造中包含的对象的集合。

Classes

获取父对象的类的集合。

CodeModel

返回 VCCodeModel 项目的对象。

Collection

获取包含某个对象的集合,该对象支持此属性或包含在此代码构造中。

Comment

获取或设置与代码元素关联的注释。

DataTypeKind
DeclarationText

获取或设置对象的声明。

DerivedTypes

获取从此对象派生的对象的集合。

DisplayName

获取对象的全名。

DocComment

获取或设置当前代码模型元素的文档注释。

DTE

获取顶级扩展性对象。

EndPoint

获取表示代码项结束位置的编辑点。

EndPointOf[vsCMPart, vsCMWhere]

获取对象的终结点。

Enums

获取对象的枚举集合。

Events

获取对象的事件集合。

Extender[String]

如果请求的扩展程序对象可用于此对象,则获取该扩展程序对象。

ExtenderCATID

获取对象的扩展程序类别 ID (CATID)。

ExtenderNames

获取对象的可用扩展程序的列表。

File

获取定义此对象的文件。

FullName

获取对象文件的完整路径和名称。

Functions

获取对象的函数集合。

ImplementedInterfaces

获取此对象实现的界面的集合。

InfoLocation

描述代码模型的功能。

IsAbstract

获取或设置一个值,该值指示项是否声明为抽象的。

IsCaseSensitive

获取一个值,该值指示代码元素是否区分大小写。

IsCodeType

获取一个值,该值指示是否可以从此对象中获取 CodeType 对象。

IsDerivedFrom[String]

获取一个值,该值指示一个对象是否将另一个对象作为基。

IsFinal
IsInjected

获取是否已通过特性或宏展开插入某个代码元素。

IsManaged

设置或获取对象是否被托管。

IsReadOnly

获取包含对象的文件是否为只读文件。

IsSealed

设置或获取 __sealed 关键字是否应用于父对象。

IsTemplate

获取对象是否是一个模板。

IsValue

设置或获取 __value 关键字是否应用于对象。

IsZombie

获取对象是否存在。

Kind

获取一个指示对象类型的枚举。

Language

获取用于创作代码的编程语言。

Location[vsCMWhere]

返回对象声明的位置。

Members

获取此元素包含的项的集合。

Name

获取或设置对象的名称。

Namespace

获取定义父命名空间的对象。

Parent

获取给定对象的直接父对象。

Parts
Picture

获取将用作用户界面中的图标的图片动画对象。

Project

获取与对象关联的 Project

ProjectItem

获取 ProjectItem 与给定对象关联的对象。

Properties

获取对象的属性的集合。

References

目前尚未实现。

StartPoint

获取一个 TextPoint 对象,该对象定义代码项的开头。

StartPointOf[vsCMPart, vsCMWhere]

获取对象的起点。

Structs

获取对象的结构元素的集合。

TemplateParameters

模板参数的集合。

Templatizations

仅限 Microsoft 内部使用。

Typedefs

获取对象的 Typedef 元素的集合。

Unions

获取对象的元素的集合 union

UsingAliases
Variables

获取对象的变量集合。

方法

AddAttribute(String, String, Object)

创建新的特性代码构造,并将代码插入正确的位置。

AddBase(Object, Object)

向继承对象列表中添加项。

AddClass(String, Object, Object, Object, vsCMAccess)

创建新的类代码构造,并将代码插入正确的位置。

AddDelegate(String, Object, Object, vsCMAccess)

创建新的委托代码构造,并将代码插入正确的位置。

AddEnum(String, Object, Object, vsCMAccess)

创建新的枚举代码构造,并将代码插入正确的位置。

AddEvent(String, Object, Object, vsCMAccess)

仅限 Microsoft 内部使用。

AddFunction(String, vsCMFunction, Object, Object, vsCMAccess, Object)

创建新的函数代码构造,并将代码插入正确的位置。

AddImplementedInterface(Object, Object)

向继承对象列表添加接口。

AddProperty(String, String, Object, Object, vsCMAccess, Object)

创建新的属性代码构造,并将代码插入正确的位置。

AddStruct(String, Object, Object, Object, vsCMAccess)

创建新的结构代码构造,并将代码插入正确的位置。

AddTemplateParameter(String, Object, Object)

将参数添加到模板定义。

AddTypedef(String, Object, Object, vsCMAccess)

typedef 语句添加到对象。

AddUnion(String, Object, vsCMAccess)

向对象中添加 联合 语句。

AddUsingAlias(String, Object, Object, vsCMAccess)
AddVariable(String, Object, Object, vsCMAccess, Object)

创建新的变量代码构造,并将代码插入正确的位置。

GetEndPoint(vsCMPart)

获取标记代码元素定义的末尾的 TextPoint 对象。

GetStartPoint(vsCMPart)

获取定义代码元素的开头的 TextPoint 对象。

IsSelf(Object)

确定指定的代码元素是否与父代码元素相同。

RemoveBase(Object)

从基列表中删除对象。

RemoveInterface(Object)

从实现的接口的列表中删除一个接口。

RemoveMember(Object)

删除成员代码构造。

RemoveTemplateParameter(Object)

从模板定义中删除一个参数。

ValidateMember(String, vsCMElement, String)

验证建议的名称是否是 Visual C++ 父对象的上下文中给定种类的有效名称。

ValidateMemberName(String, vsCMElement, vcCMNameValidationOption)

适用于