private static IEnumerable<PropertyPublicationScanResult> ScanForPublications(object instance)
{
var eventInfos = new List<EventInfo>();
eventInfos.AddRange(instance.GetType().GetEvents());
foreach (Type interfaceType in instance.GetType().GetInterfaces())
{
eventInfos.AddRange(interfaceType.GetEvents());
}
var publications = from eventInfo in eventInfos
from EventPublicationAttribute attr in
eventInfo.GetCustomAttributes(typeof(EventPublicationAttribute), true)
select new PropertyPublicationScanResult(attr.Topic, eventInfo, attr.HandlerRestriction, attr.MatcherTypes);
return publications.ToList();
}