Example #1
0
        public static BUCommon.AccountList BuildAccounts()
        {
            string file = "b2app.accounts.xml";

            file = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), file);

            var acctlst = new BUCommon.AccountList();

            acctlst.load(file);

            file = "b2app.filecache.xml";
            file = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), file);
            BUCommon.FileCache fc = new BUCommon.FileCache();

            if (File.Exists(file))
            {
                fc.load(file);
            }

            acctlst.filecache = fc;

            foreach (var a in acctlst)
            {
                Load(acctlst, a);
            }

            return(acctlst);
        }
Example #2
0
        public void UploadCacheTest()
        {
            BUCommon.FileCache uc = new BUCommon.FileCache();
            uc.load("C:\\tmp\\photos.cache");

            var files = uc.getdir("2016");

            Assert.IsNotNull(files);
            Assert.IsTrue(files.Any());
        }
Example #3
0
        public static BUCommon.AccountList BuildAccounts()
        {
            string file = "b2app.accounts.xml";

            file = System.IO.Path.Combine(BUCommon.ConfigPaths.Prefix, file);

            var acctlst = new BUCommon.AccountList();

            acctlst.load(file);

            file = "b2app.filecache";
            file = System.IO.Path.Combine(BUCommon.ConfigPaths.Prefix, file);
            BUCommon.FileCache fc = null;
            if (System.IO.File.Exists(file + ".json"))
            {
                fc = BUCommon.FileCache.Load(file + ".json");
            }
            else
            {
                if (System.IO.File.Exists(file + ".xml"))
                {
                    fc = BUCommon.FileCache.Load(file + ".xml");
                    fc.save(file + ".json");
                }
                else
                {
                    fc = BUCommon.FileCache.Load(file + ".json");
                }
            }

            acctlst.filecache = fc;

            foreach (var a in acctlst)
            {
                Load(acctlst, a);
            }

            return(acctlst);
        }