CustomReflectionContext.GetCustomAttributes 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
當在衍生類別中覆寫時,會提供一組修改過的自訂屬性集合,適用於指定物件,這在本反射上下文中有所呈現。
多載
| 名稱 | Description |
|---|---|
| GetCustomAttributes(MemberInfo, IEnumerable<Object>) |
當在衍生類別中覆寫時,會提供指定成員的自訂屬性清單,如本反射上下文所示。 |
| GetCustomAttributes(ParameterInfo, IEnumerable<Object>) |
當在衍生類別中覆寫時,會提供指定參數的自訂屬性清單,如同此反思上下文所示。 |
GetCustomAttributes(MemberInfo, IEnumerable<Object>)
當在衍生類別中覆寫時,會提供指定成員的自訂屬性清單,如本反射上下文所示。
protected:
virtual System::Collections::Generic::IEnumerable<System::Object ^> ^ GetCustomAttributes(System::Reflection::MemberInfo ^ member, System::Collections::Generic::IEnumerable<System::Object ^> ^ declaredAttributes);
protected virtual System.Collections.Generic.IEnumerable<object> GetCustomAttributes(System.Reflection.MemberInfo member, System.Collections.Generic.IEnumerable<object> declaredAttributes);
abstract member GetCustomAttributes : System.Reflection.MemberInfo * seq<obj> -> seq<obj>
override this.GetCustomAttributes : System.Reflection.MemberInfo * seq<obj> -> seq<obj>
Protected Overridable Function GetCustomAttributes (member As MemberInfo, declaredAttributes As IEnumerable(Of Object)) As IEnumerable(Of Object)
參數
- member
- MemberInfo
該成員的自訂屬性會被回傳。
- declaredAttributes
- IEnumerable<Object>
成員屬性在當前情境下的集合。
傳回
一個集合,代表該成員在此反射上下文中的自訂屬性。
適用於
GetCustomAttributes(ParameterInfo, IEnumerable<Object>)
當在衍生類別中覆寫時,會提供指定參數的自訂屬性清單,如同此反思上下文所示。
protected:
virtual System::Collections::Generic::IEnumerable<System::Object ^> ^ GetCustomAttributes(System::Reflection::ParameterInfo ^ parameter, System::Collections::Generic::IEnumerable<System::Object ^> ^ declaredAttributes);
protected virtual System.Collections.Generic.IEnumerable<object> GetCustomAttributes(System.Reflection.ParameterInfo parameter, System.Collections.Generic.IEnumerable<object> declaredAttributes);
abstract member GetCustomAttributes : System.Reflection.ParameterInfo * seq<obj> -> seq<obj>
override this.GetCustomAttributes : System.Reflection.ParameterInfo * seq<obj> -> seq<obj>
Protected Overridable Function GetCustomAttributes (parameter As ParameterInfo, declaredAttributes As IEnumerable(Of Object)) As IEnumerable(Of Object)
參數
- parameter
- ParameterInfo
這個參數的自訂屬性會被回傳。
- declaredAttributes
- IEnumerable<Object>
參數在當前上下文中的屬性集合。
傳回
一個集合,代表該參數在此反射上下文中的自訂屬性。