public AttachedEventHandler(object model, Action <Event> handler) { if (!(model is IDomainEventSource)) { return; } _model = (IDomainEventSource)model; _handler = handler; _model.EventRaised += handler; }
public SubscribeEvent(IDomainEventSource source) { Source = Observable.FromEvent <Action <IDomainEvent>, IDomainEvent>(d => source.RaiseEvent += d, d => source.RaiseEvent -= d); Key = new Tuple <Type, string>(source.GetType(), "RaiseEvent"); }
public IDisposable PublishFromEventSource(IDomainEventSource source) { return(ListenFromSource(new SubscribeEvent(source))); }