diff options
| author | Roy <Roy.mail.net@gmail.com> | 2022-08-22 11:25:28 +0300 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2022-08-22 11:25:28 +0300 |
| commit | 44fb561bfbf73b950cdcb3c59b5ff74172d1ebcb (patch) | |
| tree | f2751343696118fd743efc7349b253a802b601d0 /Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels | |
| parent | dc84d4dd42ce66902e6256f11c9412aa7d309f17 (diff) | |
| parent | c97019debd77e918f2c6c2eaef8a51ec8cba2127 (diff) | |
| download | Tango-44fb561bfbf73b950cdcb3c59b5ff74172d1ebcb.tar.gz Tango-44fb561bfbf73b950cdcb3c59b5ff74172d1ebcb.zip | |
Merge branch 'software' of https://twinetfs.visualstudio.com/Tango/_git/Tango into software
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs index dac84bc7b..1cc98bede 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs @@ -1415,12 +1415,14 @@ namespace Tango.PPC.Jobs.ViewModels dbSegment.SegmentIndex = segment.SegmentIndex; dbSegment.Length = segment.Length; _db.Segments.Add(dbSegment); + List<BrushStop> brushStopList = new List<BrushStop>();//to prevent collection changed event and override offset in timer foreach (var stop in innerSegment.BrushStops.OrderBy(x => x.StopIndex).ToList()) { var dbStop = new BrushStop(); dbStop.Guid = stop.Guid; dbStop.Segment = dbSegment; - _db.BrushStops.Add(dbStop); + //_db.BrushStops.Add(dbStop); + brushStopList.Add(dbStop); dbStop.ColorSpace = colorSpaces.FirstOrDefault(x => x.Code == (int)stop.ColorSpace); dbStop.Red = stop.Red; @@ -1449,6 +1451,7 @@ namespace Tango.PPC.Jobs.ViewModels dbStop.ColorCatalog = stop.ColorCatalog; dbStop.ColorCatalogsItem = stop.ColorCatalogsItem; } + _db.BrushStops.AddRange(brushStopList); } else if( segment is SegmentsGroupModel group) { @@ -1469,11 +1472,13 @@ namespace Tango.PPC.Jobs.ViewModels dbSegment.Length = segm_group.Length; dbSegment.SegmentsGroupGuid = dbSegmentsGroup.Guid; _db.Segments.Add(dbSegment); + List<BrushStop> brushStopList = new List<BrushStop>();//to prevent collection changed event and override offset in timer foreach (var stop in segm_group.BrushStops.OrderBy(x => x.StopIndex).ToList()) { var dbStop = new BrushStop(); dbStop.Segment = dbSegment; - _db.BrushStops.Add(dbStop); + //_db.BrushStops.Add(dbStop); + brushStopList.Add(dbStop); dbStop.ColorSpace = colorSpaces.FirstOrDefault(x => x.Code == (int)stop.ColorSpace); dbStop.Red = stop.Red; @@ -1502,6 +1507,7 @@ namespace Tango.PPC.Jobs.ViewModels dbStop.ColorCatalog = stop.ColorCatalog; dbStop.ColorCatalogsItem = stop.ColorCatalogsItem; } + _db.BrushStops.AddRange(brushStopList); } } } |
