There appears to be no overload of the FromEvent
or FromEventPattern
methods that will convert into an IObservable<T>
an event with the type TDelegate
only where there is more than one parameter and there is no EventArgs
.
For e.g. it appears that we cannot convert the following into observables.
public event Action<int, int> SomethingHappened;
public event Func<string, int> SomethingElseHappened;
We either have to have an EventArgs
in there somewhere or have a TDelegate
with just a single parameter in its signature. So, the following are convertible because they have an EventArgs
in their implicit delegate.
public event NameChangedHandler NameChanged;
public event EventHandler RollNumberChanged;
public event EventHandler<AgeChangedEventArgs> AgeChanged;
public delegate void NameChangedHandler(
object sender,
NameChangedEventArgs e);
And this one also can be converted because it has a single T
in its parameter.
public event Action<Tuple<string, string>> ClassChanged;
What do I do if I have an event like so:
public event Action<T1, T2...> ItHappened;