Properties 接口

包含属性的一般集合中给定对象的所有属性。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

声明
<GuidAttribute("4CC8CCF5-A926-4646-B17F-B4940CAED472")> _
Public Interface Properties _
    Inherits IEnumerable
[GuidAttribute("4CC8CCF5-A926-4646-B17F-B4940CAED472")]
public interface Properties : IEnumerable
[GuidAttribute(L"4CC8CCF5-A926-4646-B17F-B4940CAED472")]
public interface class Properties : IEnumerable
[<GuidAttribute("4CC8CCF5-A926-4646-B17F-B4940CAED472")>]
type Properties =  
    interface 
        interface IEnumerable 
    end
public interface Properties extends IEnumerable

Properties 类型公开以下成员。

属性

  名称 说明
公共属性 Application 基础结构。 仅由 Microsoft 内部使用。
公共属性 Count 获取一个值,该值指示集合中对象的数目。
公共属性 DTE 获取顶级扩展性对象。
公共属性 Parent 获取 Properties 集合的直接父对象。

页首

方法

  名称 说明
公共方法 GetEnumerator 获取集合中项的枚举。
公共方法 Item 返回 Properties 集合的一个索引成员。

页首

备注

Properties 包含各种类型的属性。 它可以容纳项目属性、项属性、解决方案属性,等等。 它用在其他接口的属性(如 Properties)中,用来容纳它们的属性列表。

对于 Properties,Properties 表示**“工具”菜单上“选项”**对话框中包含的所有可用的类别和子类别。 有关更多信息,请参见 Properties

Properties 还可用于表示其他信息,例如项目的属性、项目中项的属性、项目配置的属性,等等。 有关详细信息,请参阅访问特定于项目类型的项目、项目项和配置属性

Properties 集合不支持语句结束功能,例如对对象的属性成员的语句结束。 不过,通过该集合确实可以便捷地公开许多属性并循环访问这些属性。

示例

Sub PropertiesExample()
   ' Demonstrates how to programmatically access Tools Options 
   ' properties using the Properties collection.
   Dim Props As Properties
   Dim PropObj As [Property]
   Dim NameValPair As String
        
   Props = DTE.Properties("Environment", "General")
   MsgBox("Tools – Options – Environment – General Properties Count = _
     & Props.Count())
   For Each PropObj In Props
     NameValPair = NameValPair & (PropObj.Name & "Value = " & _
       PropObj.Value & microsoft.VisualBasic.ControlChars.CrLf)
   Next
   MsgBox(NameValPair)
End Sub

请参阅

参考

EnvDTE 命名空间