Please see my comment to the question. This is how you can get an attribute for a type:
https://msdn.microsoft.com/en-us/library/dwc6ew1d%28v=vs.110%29.aspx[
^].
As you can see, there is a number of other ways to get attributes (see
https://msdn.microsoft.com/en-us/library/system.type%28v=vs.110%29.aspx[
^]), but you need exactly this method, because you only need the attribute of one attribute type. The method will return you the attribute array, and, if there are elements in this arrays, you will have to type-case (use "regular" type cast, not dynamic) them to the specified attribute type.
Exact same thing goes for attributes of the type members: you need the method of the same name, with the same signature, doing the same:
https://msdn.microsoft.com/en-us/library/dwc6ew1d%28v=vs.110%29.aspx[
^].
How you find the instance of
System.Reflection.MethodInfo
is up to you, but you will always start with its declaring type (
System.Type
). I only want to warn you from getting a method by name. Not only you can have different members with this name, but this is generally unsupportable: if you, by any reason, change the member name, compiler won't warn you about name mismatch. It's much better, say, to make methods implementing the methods of some interface, then finding anything by name won't be involved.
—SA