Никита
6 years ago
4 changed files with 127 additions and 28 deletions
@ -0,0 +1,14 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace fileFinder |
|||
{ |
|||
class ProgressReportModel |
|||
{ |
|||
public int progress { get; set; } |
|||
public string currentFileUrl { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,51 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace fileFinder |
|||
{ |
|||
class TaskController |
|||
{ |
|||
public bool isPaused { get; private set; } |
|||
public bool isFinished { get; private set; } |
|||
|
|||
public TaskController () |
|||
{ |
|||
isPaused = false; |
|||
isFinished = false; |
|||
} |
|||
|
|||
public bool pauseTask() |
|||
{ |
|||
if (!isPaused && !isFinished) |
|||
{ |
|||
isPaused = true; |
|||
return true; |
|||
} else |
|||
return false; |
|||
} |
|||
|
|||
public bool resumeTask () |
|||
{ |
|||
if (isPaused && !isFinished) |
|||
{ |
|||
isPaused = false; |
|||
return true; |
|||
} else |
|||
return false; |
|||
} |
|||
|
|||
public bool stopTask () |
|||
{ |
|||
if (!isFinished) |
|||
{ |
|||
isFinished = true; |
|||
return true; |
|||
} else |
|||
return false; |
|||
} |
|||
|
|||
} |
|||
} |
Loading…
Reference in new issue