public void On(Publish x) { var notifications = x.Events .Select(e => new Notification(e, DateTime.Now, HubGateway.LocalHubId())) .ToArray(); observers.Notify(notifications); }
protected override void Define() { On((InitHub x) => {}); On((Subscribe x) => observers.Add(x.Observer)); On((PublishEvents x) => { var notifications = x.Events .Select(e => new Notification(e, DateTime.Now, HubGateway.LocalHubId())) .ToArray(); observers.Notify(notifications); }); }