示例#1
0
        public void InsertTestData()
        {
            var repo = new UStoreRepository();

            var droidrrcAccount = new GoogleAccount();

            droidrrcAccount.DisplayName = "DroidRRc";

            var acc = repo.GetAll <GoogleAccount>(a => a.DisplayName == droidrrcAccount.DisplayName);

            if (acc.Count() == 0)
            {
                repo.Store(droidrrcAccount);
            }

            var rino13Acc = new GoogleAccount {
                DisplayName = "rinorc13"
            };

            acc = repo.GetAll <GoogleAccount>(a => a.DisplayName == rino13Acc.DisplayName);
            if (acc.Count() == 0)
            {
                repo.Store(rino13Acc);
            }
        }
示例#2
0
        public void TestMethod1()
        {
            var account = new GoogleAccount();

            account.DisplayName = "droidrrc";

            var repo = new UStoreRepository();
            //var result = repo.Store(account);
            //var result3 = repo.Store(account);
            //var result2 = repo.Store(result);


            var re = repo.GetAll <GoogleAccount>();
        }
示例#3
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            var init = new Initilize();

            init.InsertTestData();

            var repo     = new UStoreRepository();
            var accounts = repo.GetAll <GoogleAccount>();

            foreach (var acc in accounts)
            {
                acc.AuthorizeAsync().ContinueWith(c => {
                    acc.GetFilesAsync().ContinueWith(fs =>
                    {
                        foreach (var file in fs.Result)
                        {
                            logger.Info("{0} - {1}", acc.DisplayName, file.FileName);
                        }
                    });
                });
            }
        }