internal async Task<bool> Load(ID7Client client, CancellationToken token) { if (IsLoaded) return true; Terms = await client.Get<List<D7Term>>(URL.Json_TaxoTerms, token); if (Terms == null) return false; return IsLoaded = true; }
internal D7FileDownloader(string targetDir, string subUrlPattern, IFileSystemShim fsShim, ID7Client d7Client) { _client = ForwardLogs(d7Client); _fs = ForwardLogs(fsShim); _foldr = _fs.Folder(targetDir); _urlPattern = subUrlPattern; _suffix = "_" + DateTime.Now.TimeOfDay.TotalMinutes; DeleteOldReplacements(); }
internal async Task <bool> Load(ID7Client client, CancellationToken token) { if (IsLoaded) { return(true); } Terms = await client.Get <List <D7Term> >(URL.Json_TaxoTerms, token); if (Terms == null) { return(false); } return(IsLoaded = true); }
public FilesTabVM2(IRepository<SyncableFileRemote> filesRepo, AppFileGrouper fileGrouper, IFileSynchronizer fileSynchronizer, ID7Client d7Client, BinUploaderCfgFile cfgFile) { _grouper = ForwardLogs(fileGrouper); _synchronizer = ForwardLogs(fileSynchronizer); _remotes = ForwardLogs(filesRepo); //_cfgFile = ForwardLogs(cfgFile); //_d7Client = ForwardLogs(d7Client); MainList = new VmList<RemoteVsLocalFile>(); UploadChangesCmd = AsyncCommand.Create(token => UploadChanges(token)); _remotes.SetClient(d7Client, cfgFile); _synchronizer.SetClient(d7Client); SetEventHandlers(); }
public BinUpdaterVM(IRepository<SyncableFileRemote> filesRepo, AppFileGrouper fileGrouper, IFileSynchronizer fileSynchronizer, BinUpdaterCfgFile cfgFile, UpdaterSessionVM usrSessionVm, ID7Client d7Client, LogScrollerVM logScroller) { DisplayName = "Bin Updater"; _d7Client = ForwardLogs(d7Client); _grouper = ForwardLogs(fileGrouper); _synchronizer = ForwardLogs(fileSynchronizer); _remotes = ForwardLogs(filesRepo); _cfgFile = ForwardLogs(cfgFile); UserSession = ForwardLogs(usrSessionVm); UpdateNowCmd = AsyncCommand.Create(tkn => UpdateNow(tkn)); LogScroller = logScroller.ListenTo(this); }
public BinUpdaterVM(IRepository <SyncableFileRemote> filesRepo, AppFileGrouper fileGrouper, IFileSynchronizer fileSynchronizer, BinUpdaterCfgFile cfgFile, UpdaterSessionVM usrSessionVm, ID7Client d7Client, LogScrollerVM logScroller) { DisplayName = "Bin Updater"; _d7Client = ForwardLogs(d7Client); _grouper = ForwardLogs(fileGrouper); _synchronizer = ForwardLogs(fileSynchronizer); _remotes = ForwardLogs(filesRepo); _cfgFile = ForwardLogs(cfgFile); UserSession = ForwardLogs(usrSessionVm); UpdateNowCmd = AsyncCommand.Create(tkn => UpdateNow(tkn)); LogScroller = logScroller.ListenTo(this); }
private async Task <bool> Query(ID7Client client, string subUrl, CancellationToken tkn) { Debug_n($"Querying repository of ‹{ClsTyp}›...", subUrl); List <TNodeDto> dtos; try { dtos = await client.Get <List <TNodeDto> >(subUrl, tkn); } catch (Exception ex) { return(Error_n("Query error:", ex.Details(false, false))); } if (dtos == null) { return(false); } var tmp = dtos.Select(x => FromDto(x)); if (!AreKeysUnique(tmp)) { return(Warn_n($"‹{ClsTyp}› Keys are not unique.", GetKey.ToString())); } _list = tmp.ToList(); if (_list.Count == 1 && _list[0] == null) { _list.Clear(); } StartTrackingChanges(); return(true); }
public void SetClient(ID7Client d7Client) => _client = ForwardLogs(d7Client);
public override void SetClient(ISessionClient sessionClient, IBasicAuthenticationKey credentials) { _client = sessionClient.As <ID7Client>(); _credentials = credentials; }
public D7Daily1KeyReaderBase(ID7Client d7Client , ISerializer serializer ) : base(d7Client, serializer) { }
public FilesTabVM2(IRepository <SyncableFileRemote> filesRepo, AppFileGrouper fileGrouper, IFileSynchronizer fileSynchronizer, ID7Client d7Client, BinUploaderCfgFile cfgFile) { _grouper = ForwardLogs(fileGrouper); _synchronizer = ForwardLogs(fileSynchronizer); _remotes = ForwardLogs(filesRepo); //_cfgFile = ForwardLogs(cfgFile); //_d7Client = ForwardLogs(d7Client); MainList = new VmList <RemoteVsLocalFile>(); UploadChangesCmd = AsyncCommand.Create(token => UploadChanges(token)); _remotes.SetClient(d7Client, cfgFile); _synchronizer.SetClient(d7Client); SetEventHandlers(); }
public DailyReaderBase(ID7Client d7Client , ISerializer serializer) { _client = d7Client; _serialr = serializer; }