I get you have a particular usage in mind when using this library.
In particular you whould like us to subscribe to OnLogin before requesting user data and you want us to unsubcribe as soon as we get the results; maybe using only an instance of GoogleClient throughout the entire app, by the way this could not be possible or may not be the programming style we are using.
In those different scenarios a static backfield causes problems. Ranging from the same handlers being called multiple times to memory leaks.
I'd suggest to remove the static keyword and turn to a simple event.
Currently OnLogin, OnLogout and OnError events are defined as follows:
I get you have a particular usage in mind when using this library.
In particular you whould like us to subscribe to OnLogin before requesting user data and you want us to unsubcribe as soon as we get the results; maybe using only an instance of GoogleClient throughout the entire app, by the way this could not be possible or may not be the programming style we are using.
In those different scenarios a static backfield causes problems. Ranging from the same handlers being called multiple times to memory leaks.
I'd suggest to remove the static keyword and turn to a simple event.
which leads to this
public event EventHandler<...> OnLogin;