blob: 6213240ed6bb9cf88273f3bc7844e29ae569d0d5 (
plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tango.Integration.Observables
{
public partial class Segment
{
protected override void RaisePropertyChanged(string propName)
{
base.RaisePropertyChanged(propName);
if (propName == nameof(Length))
{
BrushStops.ToList().ForEach(x => x.RaiseOffsetChanged());
}
}
private TimeSpan _remainingTime;
[NotMapped]
[JsonIgnore]
public TimeSpan RemainingTime
{
get { return _remainingTime; }
set { _remainingTime = value; RaisePropertyChangedAuto(); }
}
private bool _started;
[NotMapped]
[JsonIgnore]
public bool Started
{
get { return _started; }
set { _started = value; RaisePropertyChangedAuto(); }
}
private bool _completed;
[NotMapped]
[JsonIgnore]
public bool Completed
{
get { return _completed; }
set { _completed = value; RaisePropertyChangedAuto(); }
}
public override Segment Clone()
{
Segment cloned = base.Clone();
cloned.BrushStops = BrushStops.Select(x => x.Clone()).ToObservableCollection();
return cloned;
}
public Segment Clone(Job job)
{
Segment cloned = base.Clone();
cloned.BrushStops = BrushStops.Select(x => x.Clone(cloned)).ToObservableCollection();
cloned.Job = job;
cloned.JobGuid = job.Guid;
return cloned;
}
public override void DefferedDelete()
{
BrushStops.ToList().ForEach(x => x.DefferedDelete());
BrushStops.Clear();
base.DefferedDelete();
}
}
}
|