public static IObservable <AdsNotificationExEventArgs> WhenRegisteredNotificationEx(this IAdsNotifications client) => Observable.Select <EventPattern <AdsNotificationExEventArgs>, AdsNotificationExEventArgs>(Observable.FromEventPattern <AdsNotificationExEventHandler, AdsNotificationExEventArgs>(delegate(AdsNotificationExEventHandler h) { client.AdsNotificationEx += h; }, delegate(AdsNotificationExEventHandler h) { client.AdsNotificationEx -= h; }), ev => ev.get_EventArgs());
public static IObservable <Notification> WhenRegisteredNotification(this IAdsNotifications client, uint[] handles) => Observable.Select <EventPattern <AdsNotificationEventArgs>, Notification>(Observable.Where <EventPattern <AdsNotificationEventArgs> >(Observable.FromEventPattern <AdsNotificationEventHandler, AdsNotificationEventArgs>(delegate(AdsNotificationEventHandler h) { client.AdsNotification += h; }, delegate(AdsNotificationEventHandler h) { client.AdsNotification -= h; }), ev => Enumerable.Contains <uint>(handles, (uint)ev.get_EventArgs().NotificationHandle)), ev => new Notification(ev.get_EventArgs()));