protected BUCommon.Account _getAcct(BUCommon.AccountList accts, string account) { BUCommon.Account acct = null; if (!string.IsNullOrWhiteSpace(account)) { acct = accts.Where(x => x.name == account).FirstOrDefault(); } return(acct); }
public BUCommon.Container containerCreate(BUCommon.Account account, string name) { var bo = new B2Net.Models.B2BucketOptions(); var res = _client.Buckets.Create(name, bo).Result; return(new BUCommon.Container { accountID = account.id, account = account , id = res.BucketId, name = res.BucketName, type = res.BucketType }); }
public static void Load(BUCommon.AccountList accounts, BUCommon.Account account) { Func <BUCommon.IFileSvc> svc = null; if (_SvcMapping.TryGetValue(account.svcName, out svc)) { account.service = svc(); account.service.account = account; account.service.fileCache = accounts.filecache; account.service.setParams(account.connStr); } else { account.service = null; } }
protected BUCommon.AccountList _makeSvc() { var acct = new BUCommon.Account(); acct.connStr = @"c:\tmp\b2test"; acct.svcName = "BackupLib.LocalService"; acct.id = 1; acct.name = "localtest"; var acctlst = new BUCommon.AccountList(); acctlst.filecache = BUCommon.FileCache.Load(@"c:\tmp\b2test\cache_sync.json"); System.IO.Directory.CreateDirectory(@"c:\tmp\b2test\cont1"); BackupLib.AccountBuilder.Load(acctlst, acct); acctlst.Add(acct); return(acctlst); }