Example #1
0
 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;
     }
 }
Example #2
0
 private void OnLoadDataCompleted(LoadMediasJob loadMediasJob)
 {
     if (loadMediasJob.IsNull())
     {
         return;
     }
     this.ContentString = string.Format("Included {0} files", loadMediasJob.Files.Count);
 }
Example #3
0
 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);
 }
Example #4
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
 private void OnLoadDataCompleted(LoadMediasJob obj)
 {
     //ViewModel.LoadExplorerByFolderPaths(DataManager.Instance.DBCache.MonitoredFileStrings);
 }
Example #7
0
 private void OnLoadDataCompleted(LoadMediasJob obj)
 {
     throw new NotImplementedException();
 }