-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathState.cs
57 lines (49 loc) · 1.85 KB
/
State.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright (c) 2015, Dijji, and released under Ms-PL. This can be found in the root of this distribution.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
namespace RepairTasks
{
public enum Source
{
Recycle,
Zip,
Other
}
class State : INotifyPropertyChanged
{
private ObservableCollection<Report> reports = new ObservableCollection<Report>();
private List<Target> targets = new List<Target>();
private bool canScan = true;
private bool canRepair = false;
private bool canUnplug = false;
private string status;
public ObservableCollection<Report> Reports { get { return reports; } }
public List<Target> Targets { get { return targets; } }
public string Status { get { return status; } set { status = value; OnPropertyChanged("Status"); } }
public bool CanScan { get { return canScan; } set { canScan = value; OnPropertyChanged("CanScan"); } }
public bool CanRepair { get { return canRepair; } set { canRepair = value; OnPropertyChanged("CanRepair"); } }
public bool CanUnplug { get { return canUnplug; } set { canUnplug = value; OnPropertyChanged("CanUnplug"); } }
public Source Source { get; set; }
public string SourcePath { get; set; }
public string BackupPath { get; set; }
public void Reset()
{
targets.Clear();
reports.Clear();
Status = "";
}
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(String info)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(info));
}
}
}
}