public async Task <bool> LoginAsync(LoginRecord record) { var task = new LoginTask(this, record); if (Certificate == null) { Queuly.Add(task); Init(); } else { await task.Exec(); } var result = await task.Task; return(await Task.FromResult(result != null && !JsonConvert.DeserializeObject <LoginResponceRecord>(result).Error)); }
private async Task Login(LoginRecord login) { if (IsBusy) { return; } IsBusy = true; try { LoginViewModelExtension.ExtendLogin(await DataStore.LoginAsync(login), () => { DataStore.RemoveCertificate(); }); } catch (Exception e) { Console.WriteLine(e); } finally { IsBusy = false; } }
public LoginTask(CloudDataStore store, LoginRecord record) : base(store) { _record = record; }
public async Task <bool> LoginAsync(LoginRecord record) { return(await Task.FromResult(false)); }