CodeProperty2 接口
定义源文件中属性构造的对象。
命名空间: EnvDTE80
程序集: EnvDTE80(在 EnvDTE80.dll 中)
语法
声明
<GuidAttribute("33770C02-21B7-4224-A577-6877BDBA60EA")> _
Public Interface CodeProperty2 _
Inherits CodeProperty
[GuidAttribute("33770C02-21B7-4224-A577-6877BDBA60EA")]
public interface CodeProperty2 : CodeProperty
[GuidAttribute(L"33770C02-21B7-4224-A577-6877BDBA60EA")]
public interface class CodeProperty2 : CodeProperty
[<GuidAttribute("33770C02-21B7-4224-A577-6877BDBA60EA")>]
type CodeProperty2 =
interface
interface CodeProperty
end
public interface CodeProperty2 extends CodeProperty
CodeProperty2 类型公开以下成员。
属性
名称 | 说明 | |
---|---|---|
Access | (继承自 CodeProperty。) | |
Access | 获取或设置此项的访问特性。 | |
Attributes | (继承自 CodeProperty。) | |
Attributes | 获取父对象的所有特性的集合。 | |
Children | (继承自 CodeProperty。) | |
Children | 获取此 CodeProperty2 对象中包含的对象的集合。 | |
Collection | (继承自 CodeProperty。) | |
Collection | 获取包含支持此属性的 CodeProperty 对象的集合。 | |
Comment | (继承自 CodeProperty。) | |
Comment | 获取或设置与代码元素关联的注释。 | |
DocComment | (继承自 CodeProperty。) | |
DocComment | 获取或设置当前代码模型元素的文档注释。 | |
DTE | (继承自 CodeProperty。) | |
DTE | 获取顶级扩展性对象。 | |
EndPoint | (继承自 CodeProperty。) | |
EndPoint | 获取表示代码项的结束位置的编辑点。 | |
Extender[String] | (继承自 CodeProperty。) | |
Extender[String] | 如果请求的 Extender 可用于此对象,则获取该 Extender。 | |
ExtenderCATID | (继承自 CodeProperty。) | |
ExtenderCATID | 获取对象的 Extender 类别 ID (CATID)。 | |
ExtenderNames | (继承自 CodeProperty。) | |
ExtenderNames | 获取此对象的可用 Extender 的列表。 | |
FullName | (继承自 CodeProperty。) | |
FullName | 获取对象文件的完整路径和名称。 | |
Getter | (继承自 CodeProperty。) | |
Getter | 获取或设置一个对象,该对象定义返回属性的代码。 | |
InfoLocation | (继承自 CodeProperty。) | |
InfoLocation | 获取代码模型的功能。 | |
IsCodeType | (继承自 CodeProperty。) | |
IsCodeType | 获取一个值,该值指示是否可以从此对象中获取 CodeType 对象。 | |
IsDefault | 设置或获取一个值,该值指示此属性是否为默认属性。 | |
IsGeneric | 获取一个值,该值指示属性是否为泛型。 | |
IsShared | 获取或设置属性的共享状态。 | |
Kind | (继承自 CodeProperty。) | |
Kind | 获取一个指示对象类型的枚举。 | |
Language | (继承自 CodeProperty。) | |
Language | 获取用于创作代码的编程语言。 | |
Name | (继承自 CodeProperty。) | |
Name | 获取或设置对象的名称。 | |
OverrideKind | 获取或设置属性上的重写修饰符。 | |
Parameters | 为属性的任何参数获取 CodeParameter2 对象。 | |
Parent | (继承自 CodeProperty。) | |
Parent | 获取 CodeProperty 对象的直接父对象。 | |
Parent2 | 获取元素的父级。 | |
ProjectItem | (继承自 CodeProperty。) | |
ProjectItem | 获取与给定对象关联的 ProjectItem。 | |
Prototype[Int32] | (继承自 CodeProperty。) | |
Prototype[Int32] | 返回一个字符串,它包含此对象的存根 (stub) 定义。 | |
ReadWrite | 返回指示属性是可读、可写还是两者皆可的值。 | |
Setter | (继承自 CodeProperty。) | |
Setter | 获取或设置一个对象,该对象定义设置属性的代码。 | |
StartPoint | (继承自 CodeProperty。) | |
StartPoint | 获取一个 TextPoint 对象,该对象定义代码项的开始位置。 | |
Type | (继承自 CodeProperty。) | |
Type | 获取或设置表示编程类型的对象。 |
页首
方法
名称 | 说明 | |
---|---|---|
AddAttribute(String, String, Object) | (继承自 CodeProperty。) | |
AddAttribute(String, String, Object) | 创建新的特性代码构造,并将代码插入正确的位置。 | |
AddParameter | 向属性定义添加一个参数。 | |
GetEndPoint(vsCMPart) | (继承自 CodeProperty。) | |
GetEndPoint(vsCMPart) | 获取一个 TextPoint 对象,该对象标记代码元素定义的结束位置。 | |
GetStartPoint(vsCMPart) | (继承自 CodeProperty。) | |
GetStartPoint(vsCMPart) | 获取一个 TextPoint 对象,该对象定义代码元素定义的开始位置。 | |
RemoveParameter | 从属性的签名中移除参数。 |
页首
备注
CodeProperty2 对象表示一个属性,并确定如何在各种语言中定义属性。 例如,Visual Basic 具有两个独立的函数,一个获取值,另一个放置值。 它们一起构成一个属性。 但是,在 Visual C# 中,一种声明形式声明一个属性并指示它是否有 getter 和 setter。
提示
在进行某些类型的编辑之后,代码模型元素(如类、结构、函数、特性、委托等)的值可能是非确定性的,这意味着不能指望它们的值总是保持不变。 有关更多信息,请参见 使用代码模型查找代码 (Visual Basic) 中的“代码模型元素的值可能会更改”一节。