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); }
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()); }
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); }