public static IObservable<IEvent<MouseEventArgs>> GetMouseDown(this Control control)
return Observable.FromEvent<MouseEventHandler, MouseEventArgs>(
h => new MouseEventHandler(h),
h => control.MouseDown += h,
h => control.MouseDown -= h
CS1911: "Access to member 'System.EventHandler<TEventArgs>.Invoke(object, TEventArgs)' through a 'base' keyword from an anonymous method or iterator results in unverifiable code. Consider moving the access into a helper method on the containing type."
I know this is fixed in the C#4.0 compiler, but I'm playing in 3.5 and VS2008.
Anyone know if this slipped through the net? Or if I'm doing something wrong? Or if there is a workaround?