private void AuthenticatedLogin(string username, string password) { ThreadAssist.Spawn(delegate { try { client.Login(username, password); } catch (DAAP.AuthenticationException) { ThreadAssist.ProxyToMain(delegate { ShowErrorView(DaapErrorType.InvalidAuthentication); }); } }); }
public override void Activate() { if (client != null || is_activating) { return; } ClearErrorView(); is_activating = true; base.Activate(); SetStatus(String.Format(Catalog.GetString("Connecting to {0}"), service.Name), false); ThreadAssist.Spawn(delegate { try { client = new DAAP.Client(service); client.Updated += OnClientUpdated; if (client.AuthenticationMethod == DAAP.AuthenticationMethod.None) { client.Login(); } else { ThreadAssist.ProxyToMain(PromptLogin); } } catch (Exception e) { ThreadAssist.ProxyToMain(delegate { ShowErrorView(DaapErrorType.BrokenAuthentication); }); Hyena.Log.Exception(e); } is_activating = false; }); }
public override void Activate() { if (client != null || is_activating) { return; } ClearErrorView (); is_activating = true; base.Activate (); SetStatus (String.Format (Catalog.GetString ("Connecting to {0}"), service.Name), false); ThreadAssist.Spawn (delegate { try { client = new DAAP.Client (service); client.Updated += OnClientUpdated; if (client.AuthenticationMethod == DAAP.AuthenticationMethod.None) { client.Login (); } else { ThreadAssist.ProxyToMain (PromptLogin); } } catch(Exception e) { ThreadAssist.ProxyToMain (delegate { ShowErrorView (DaapErrorType.BrokenAuthentication); }); Log.Error (e); } is_activating = false; }); }