aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Integration/Printing/Segment.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-02-18 18:48:16 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-02-18 18:48:16 +0200
commit95b4e14bc4e06ffb94199f5ec4e0d2d9bebceeff (patch)
treede29ed87bd7c7b966d35b6f6bc8b13d65313c88c /Software/Visual_Studio/Tango.Integration/Printing/Segment.cs
parent99136fc92c8b75c3783f543051c065c28961d393 (diff)
downloadTango-95b4e14bc4e06ffb94199f5ec4e0d2d9bebceeff.tar.gz
Tango-95b4e14bc4e06ffb94199f5ec4e0d2d9bebceeff.zip
Working on new developer module.
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();
+ }
}
}