MethodBuilder.GetCustomAttributes 方法    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回为此方法定义的自定义属性。
重载
| GetCustomAttributes(Boolean) | 返回为此方法定义的所有自定义属性。 | 
| GetCustomAttributes(Type, Boolean) | 返回由给定类型标识的自定义属性。 | 
GetCustomAttributes(Boolean)
- Source:
- MethodBuilder.cs
返回为此方法定义的所有自定义属性。
public:
 override cli::array <System::Object ^> ^ GetCustomAttributes(bool inherit);public override object[] GetCustomAttributes(bool inherit);override this.GetCustomAttributes : bool -> obj[]Public Overrides Function GetCustomAttributes (inherit As Boolean) As Object()参数
- inherit
- Boolean
指定是否搜索此成员的继承链以查找自定义属性。
返回
返回一个对象数组,其中的对象表示此方法的所有自定义属性。
例外
目前尚不支持此方法。 使用 GetMethod(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) 检索此方法,并在返回的 MethodInfo 上调用 GetCustomAttributes(Boolean)。
适用于
GetCustomAttributes(Type, Boolean)
- Source:
- MethodBuilder.cs
返回由给定类型标识的自定义属性。
public:
 override cli::array <System::Object ^> ^ GetCustomAttributes(Type ^ attributeType, bool inherit);public override object[] GetCustomAttributes(Type attributeType, bool inherit);override this.GetCustomAttributes : Type * bool -> obj[]Public Overrides Function GetCustomAttributes (attributeType As Type, inherit As Boolean) As Object()参数
- attributeType
- Type
自定义属性类型。
- inherit
- Boolean
指定是否搜索此成员的继承链以查找自定义属性。
返回
返回一个对象数组,表示此方法的属性属于类型 attributeType。
例外
目前尚不支持此方法。 使用 GetMethod(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) 检索此方法,并在返回的 MethodInfo 上调用 GetCustomAttributes(Boolean)。