AttributeTableContainer.GetAttributes 方法 (Assembly, Type)

[本文档仅供预览,在以后的发行版中可能会发生更改。包含的空白主题用作占位符。]

枚举指定程序集的特性。

命名空间:  Microsoft.Windows.Design.Metadata
程序集:  Microsoft.Windows.Design.Extensibility(在 Microsoft.Windows.Design.Extensibility.dll 中)

语法

声明
Public Function GetAttributes ( _
    assembly As Assembly, _
    attributeType As Type _
) As IEnumerable(Of Object)
public IEnumerable<Object> GetAttributes(
    Assembly assembly,
    Type attributeType
)
public:
IEnumerable<Object^>^ GetAttributes(
    Assembly^ assembly, 
    Type^ attributeType
)
member GetAttributes : 
        assembly:Assembly * 
        attributeType:Type -> IEnumerable<Object> 
public function GetAttributes(
    assembly : Assembly, 
    attributeType : Type
) : IEnumerable<Object>

参数

  • attributeType
    类型:System.Type
    要枚举的特性类型,或为 nulla null reference (Nothing in Visual Basic) 以枚举所有特性。

返回值

类型:System.Collections.Generic.IEnumerable<Object>
特性的枚举。

异常

异常 条件
ArgumentNullException

assembly 为 nulla null reference (Nothing in Visual Basic)。

备注

返回的特性包括实际程序集中定义的特性,以及添加到当前容器的特性表中定义的特性。 特性表中定义的特性优先于程序集中定义的特性。

.NET Framework 安全性

请参见

参考

AttributeTableContainer 类

GetAttributes 重载

Microsoft.Windows.Design.Metadata 命名空间