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