Counters
This commit is contained in:
parent
40f25a4f4c
commit
a2dca4b750
3 changed files with 36 additions and 13 deletions
|
|
@ -139,7 +139,10 @@ namespace WPFCatalog
|
|||
var tasks = new List<Task>();
|
||||
// todo folder mode
|
||||
MaddoLogger.Log("Starting elaboration");
|
||||
foreach (var file in Directory.EnumerateFiles(PicSettings.DirectorySorgente))
|
||||
var files = Directory.EnumerateFiles(PicSettings.DirectorySorgente).ToArray();
|
||||
|
||||
TotalPictures = files.Count();
|
||||
foreach (var file in files)
|
||||
{
|
||||
//Task t = new Task(() =>
|
||||
//{
|
||||
|
|
@ -147,14 +150,9 @@ namespace WPFCatalog
|
|||
// //CompleteFile(file);
|
||||
//});
|
||||
var t = FileTask(file);
|
||||
if (t != null)
|
||||
{
|
||||
tasks.Add(t);
|
||||
}
|
||||
else
|
||||
{
|
||||
MaddoLogger.LogError("Task was null for file: {0}", file);
|
||||
}
|
||||
|
||||
tasks.Add(t);
|
||||
|
||||
//_tasks.Add(new ImageTask() { ImageName = file, TaskImage = t, Completed = false });
|
||||
//t.Start();
|
||||
|
||||
|
|
@ -178,8 +176,8 @@ namespace WPFCatalog
|
|||
MaddoLogger.Log("Starting task for image {0}", file);
|
||||
IImageProcessor i = new ImgSharpCreator();
|
||||
await Task.Run(() => i.Start(new FileInfo(file)));
|
||||
|
||||
|
||||
CurrentImage = file;
|
||||
TotalPictures--;
|
||||
}
|
||||
|
||||
private void CompleteFile(string file)
|
||||
|
|
@ -260,6 +258,23 @@ namespace WPFCatalog
|
|||
|
||||
#region Proprietà
|
||||
|
||||
private string _currentImage;
|
||||
|
||||
public string CurrentImage
|
||||
{
|
||||
get => _currentImage;
|
||||
set { _currentImage = value; RaisePropertyChanged("CurrentImage"); }
|
||||
}
|
||||
|
||||
private int _totalPictures;
|
||||
|
||||
public int TotalPictures
|
||||
{
|
||||
get => _totalPictures;
|
||||
set { _totalPictures = value; RaisePropertyChanged("TotalPictures"); }
|
||||
}
|
||||
|
||||
|
||||
public PicSettings SettingsString
|
||||
{
|
||||
get { return PicSettings; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue