aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Integration/Printing/Segment.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/Printing/Segment.cs')
-rw-r--r--Software/Visual_Studio/Tango.Integration/Printing/Segment.cs32
1 files changed, 31 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/Printing/Segment.cs b/Software/Visual_Studio/Tango.Integration/Printing/Segment.cs
index 9d0edc092..6213240ed 100644
--- a/Software/Visual_Studio/Tango.Integration/Printing/Segment.cs
+++ b/Software/Visual_Studio/Tango.Integration/Printing/Segment.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
@@ -21,6 +22,7 @@ namespace Tango.Integration.Observables
private TimeSpan _remainingTime;
[NotMapped]
+ [JsonIgnore]
public TimeSpan RemainingTime
{
get { return _remainingTime; }
@@ -29,6 +31,7 @@ namespace Tango.Integration.Observables
private bool _started;
[NotMapped]
+ [JsonIgnore]
public bool Started
{
get { return _started; }
@@ -37,12 +40,39 @@ namespace Tango.Integration.Observables
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();
+ }
}
}