private void Instance_JobRunningStateChanged(object sender, Job job) { if (sender.IsNull() || job.IsNull() || currentJob.IsNull()) { return; } if (0 != string.Compare(job.JobID, currentJob.JobID)) { return; } switch (job.Type) { case JobType.LoadDBMedias: { LoadMediasJob loadMediasJob = job as LoadMediasJob; this.eventAggregator.GetEvent <LoadDataCompletedEvent>().Publish(loadMediasJob); RunOnUIThread(() => { foreach (IDAL.Model.DBFileInfo file in loadMediasJob.Files) { Files.Add(new UIFile(file)); } ContentView.Refresh(); }); } break; } }
private void OnLoadDataCompleted(LoadMediasJob loadMediasJob) { if (loadMediasJob.IsNull()) { return; } this.ContentString = string.Format("Included {0} files", loadMediasJob.Files.Count); }
private void OnTagSelected(DBTagInfo tag) { Files.Clear(); if (!currentJob.IsNull()) { JobManager.Instance.ForceStop(currentJob); currentJob = null; } currentJob = LoadMediasJob.Create(new LoadMediasJob.LoadPattern() { Category = LoadMediasJob.Category.Tag, keyword = tag.ID.ToString() }); JobManager.Instance.AddJob(currentJob); JobManager.Instance.ForceStart(currentJob); }
private void MonitoredFoldersSelected(IFolder iFolder) { Files.Clear(); //StartBackgroundWork(iFolder); if (!currentJob.IsNull()) { JobManager.Instance.ForceStop(currentJob); currentJob = null; } currentJob = LoadMediasJob.Create(new LoadMediasJob.LoadPattern() { Category = LoadMediasJob.Category.Folder, keyword = iFolder.FullPath }); JobManager.Instance.AddJob(currentJob); JobManager.Instance.ForceStart(currentJob); }
protected override bool JobRunning_DoWork() { LoadMediasJob loadMediaJob = this.Job as LoadMediasJob; //DataManager.Instance.DBCache.MonitoredFiles = loadMediaJob.Files = DBHelper.GetFilesUnderFolder(string.Empty); switch (loadMediaJob.Pattern.Category) { case LoadMediasJob.Category.Folder: loadMediaJob.Files = DBHelper.GetFilesUnderFolder(loadMediaJob.Pattern.keyword); break; case LoadMediasJob.Category.Tag: loadMediaJob.Files = DBHelper.GetFilesByTags(loadMediaJob.Pattern.keyword); break; } return(true); }
private void OnLoadDataCompleted(LoadMediasJob obj) { //ViewModel.LoadExplorerByFolderPaths(DataManager.Instance.DBCache.MonitoredFileStrings); }
private void OnLoadDataCompleted(LoadMediasJob obj) { throw new NotImplementedException(); }