Exemplo n.º 1
0
        public void Add(PicasaAccount account)
        {
            var list = storageHelper.GetList <PicasaAccount>();

            list.Add(account);
            storageHelper.SaveList <PicasaAccount>(list);
        }
Exemplo n.º 2
0
        public AccountCreateViewModel(IStorage <PicasaAccount> accountStorage,
                                      INavigationService navigationService)
        {
            _accountStorage    = accountStorage;
            _navigationService = navigationService;

            Account = new PicasaAccount();
        }
Exemplo n.º 3
0
 /// <summary>
 /// Navigate to picasa albums list
 /// </summary>
 public void Navigation_PicasaAlbumListView(PicasaAccount account)
 {
     if (account != null)
     {
         //TODO: error handler. Handle auth error
         _photoService.Login(account.User, account.Password,
                             (auth) => _navigationService.Navigate(UrlHelper.PicasaAlbumList()));
     }
 }
Exemplo n.º 4
0
        public void Delete(PicasaAccount account)
        {
            var list = storageHelper.GetList <PicasaAccount>();

            var storageAccount = list.SingleOrDefault(a => a.User == account.User);

            if (storageAccount != null)
            {
                list.Remove(storageAccount);
            }
            storageHelper.SaveList <PicasaAccount>(list);
        }
Exemplo n.º 5
0
        public void DeleteAccount(PicasaAccount account)
        {
            var message = String.Format("Are you sure want to delete \"{0}\"?", account.User);
            var result  = MessageBox.Show(message, "Confirmation", MessageBoxButton.OKCancel);

            if (result == MessageBoxResult.OK)
            {
                AccountList.Remove(account);
                _accountStorage.SaveList(AccountList);
                AccountList = new List <PicasaAccount>(AccountList);
                NotifyOfPropertyChange(() => AccountList);
            }
        }