diff options
Diffstat (limited to 'Software/Visual_Studio')
3 files changed, 48 insertions, 2 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs index 43759f1c2..2a8040f36 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Dialogs/ColorSelectionViewVM.cs @@ -739,7 +739,47 @@ namespace Tango.PPC.Jobs.Dialogs private void SaveMyColors() { - SaveMyColorMode = !SaveMyColorMode; + if(IsBusy) + return; + IsBusy = true; + + if(SaveMyColorMode == false && IsSelectedColorInLibrary) + { + try { + List<FavoriteColor> colors; + if (_colorSpaceToFavoriteColorDictionary != null && SelectedBrushStop != null && _colorSpaceToFavoriteColorDictionary.TryGetValue(SelectedBrushStop.ColorSpace, out colors) && colors != null) + { + var favoriteColor = colors.FirstOrDefault(item => item.Color == SelectedBrushStop.Color); + if (favoriteColor != null) + { + foreach (var library in Libraries) + { + if(library.IsColorExist(favoriteColor)) + { + library.RemoveFromLibrary(favoriteColor); + LoadLibraryDictionary(); + IsSelectedColorInLibrary = false; + break; + } + } + } + } + } + catch( Exception ex) + { + LogManager.Log(ex, "An error occurred while trying to delete My Colors."); + } + finally + { + IsBusy = false; + } + } + else + { + SaveMyColorMode = !SaveMyColorMode; + } + + IsBusy = false; } private void OnSaveMyColorModeChanged() diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/ColorLibrary.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/ColorLibrary.cs index 77b9c26ea..62dc7ec1b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/ColorLibrary.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Models/ColorLibrary.cs @@ -125,5 +125,11 @@ namespace Tango.PPC.Jobs.Models { return ColorList.Where(x=>x.ColorSpace == colorSpase && x.RmlGuid == rmlGuid && x.BestMatchR == color.R && x.BestMatchG == color.G && x.BestMatchB == color.B).Count() > 0; } + + [BsonIgnore] + public bool IsColorExist(FavoriteColor color) + { + return ColorList.FirstOrDefault(x => x == color) != null; + } } } diff --git a/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerCMYKControl.cs b/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerCMYKControl.cs index 39eab1984..20eb8b4e7 100644 --- a/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerCMYKControl.cs +++ b/Software/Visual_Studio/Tango.Touch/TouchColorPickerControls/TouchColorPickerCMYKControl.cs @@ -257,7 +257,7 @@ namespace Tango.Touch.Controls //_keyColorSlider.MaxValue = 100; CreateKeyBrush(cmyk.C / 100, cmyk.M / 100, cmyk.Y / 100); _keyColorSlider.ColorValue = cmyk.K; - _keyColorSlider.ColorPickerText = "KEY"; + _keyColorSlider.ColorPickerText = "BLACK"; _keyColorSlider.PickerSliderValueChanged += OnKeyChanged; } } |
