From 95b4e14bc4e06ffb94199f5ec4e0d2d9bebceeff Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 18 Feb 2018 18:48:16 +0200 Subject: Working on new developer module. --- .../Tango.Integration/Printing/Segment.cs | 32 +++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/Tango.Integration/Printing/Segment.cs') 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(); + } } } -- cgit v1.3.1