[Mono-list] Lamespec for System.Attribute?

Nick Drochak ndrochak@gol.com
Sat, 11 Aug 2001 01:51:12 +0900


Hi all,

I am trying to implement the overloaded method
System.Attribute.GetCustomAttribute(ParameterInfo element, Type
attributeType).

The docs say
1) attributeType must be derived from System.Attribute which I think makes
sense.
2) element must be of type attributeType.

I don't understand how #2 above can ever be true if #1 is true.  After all
the type of element is ParameterInfo. Am I missing something obvious here?

The code I am using to do the test is this:

if (!attributeType.Equals(element.GetType()))
{
	throw new ArgumentException("The type of <element> (" +
element.GetType().ToString()+ ") is not equal to <attributeType> (" +
attributeType.ToString() + ")", "attributeType");
}

Thanks,
Nick