共用方式為


AttributeTableContainer.GetAttributes 方法 (Assembly, Type, Func<Object, Object>)

列舉指定組件的屬性。

命名空間:  Microsoft.Windows.Design.Metadata
組件:  Microsoft.Windows.Design.Extensibility (在 Microsoft.Windows.Design.Extensibility.dll 中)

語法

'宣告
Public Function GetAttributes ( _
    assembly As Assembly, _
    attributeType As Type, _
    reflectionMapper As Func(Of Object, Object) _
) As IEnumerable(Of Object)
public IEnumerable<Object> GetAttributes(
    Assembly assembly,
    Type attributeType,
    Func<Object, Object> reflectionMapper
)
public:
IEnumerable<Object^>^ GetAttributes(
    Assembly^ assembly, 
    Type^ attributeType, 
    Func<Object^, Object^>^ reflectionMapper
)
member GetAttributes : 
        assembly:Assembly * 
        attributeType:Type * 
        reflectionMapper:Func<Object, Object> -> IEnumerable<Object> 
public function GetAttributes(
    assembly : Assembly, 
    attributeType : Type, 
    reflectionMapper : Func<Object, Object>
) : IEnumerable<Object>

參數

  • attributeType
    型別:System.Type
    要列舉的屬性型別,或是 nullNull 參照 (即 Visual Basic 中的 Nothing) 以列舉所有屬性。
  • reflectionMapper
    型別:System.Func<Object, Object>
    選擇性對應函式,用來將傳入的反映中繼資料對應至執行階段中繼資料。

傳回值

型別:System.Collections.Generic.IEnumerable<Object>
屬性 (Attribute) 的列舉型別。

例外狀況

例外狀況 條件
ArgumentNullException

assembly 為 nullNull 參照 (即 Visual Basic 中的 Nothing)。

備註

傳回的屬性包括實際組件中所定義的屬性,也包括已新增至此容器的屬性資料表中定義的屬性。 在屬性資料表中所定義的屬性會優先於組件中所定義的屬性。

.NET Framework 安全性

請參閱

參考

AttributeTableContainer 類別

GetAttributes 多載

Microsoft.Windows.Design.Metadata 命名空間