Example #1
0
        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));
        }
Example #2
0
        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;
            }
        }
Example #3
0
 public LoginTask(CloudDataStore store, LoginRecord record) : base(store)
 {
     _record = record;
 }
Example #4
0
 public async Task <bool> LoginAsync(LoginRecord record)
 {
     return(await Task.FromResult(false));
 }