private static IEnumerable<PropertySubscriptionScanResult> ScanForSubscriptions(object instance)
{
var methodInfos = new List<MethodInfo>();
methodInfos.AddRange(instance.GetType().GetMethods());
foreach (Type interfaceType in instance.GetType().GetInterfaces())
{
methodInfos.AddRange(interfaceType.GetMethods());
}
var subscriptions = from methodInfo in methodInfos
from EventSubscriptionAttribute attr in
methodInfo.GetCustomAttributes(typeof(EventSubscriptionAttribute), true)
select new PropertySubscriptionScanResult(attr.Topic, methodInfo, attr.HandlerType, attr.MatcherTypes);
return subscriptions.ToList();
}