private static Boolean IsMarkedAsEventHandler(MethodInfo target, out EventHandlerAttribute attribute)
{
Contract.Requires<ArgumentNullException>(target != null, "The target cannot be null.");
var attributeType = typeof(EventHandlerAttribute);
var attributes = target.GetCustomAttributes(attributeType, false);
if (attributes.Length > 0)
{
attribute = (EventHandlerAttribute)attributes[0];
return true;
}
attribute = null;
return false;
}