diff options
| author | Avi Levkovich <avi@twine-s.com> | 2017-12-28 15:16:27 +0200 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2017-12-28 15:16:27 +0200 |
| commit | c056f991c0168f6449fac16c3b0cb165518c5e01 (patch) | |
| tree | e5c69bb1f3e03029991efe15e930af80ff6712db /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs | |
| parent | 15799210aab388996f86808e000940093306ca41 (diff) | |
| parent | 2d3f4bfd4b265888933ad8a7e21e4dd80aa1eda2 (diff) | |
| download | Tango-c056f991c0168f6449fac16c3b0cb165518c5e01.tar.gz Tango-c056f991c0168f6449fac16c3b0cb165518c5e01.zip | |
MERGE.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs new file mode 100644 index 000000000..74a7e29eb --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs @@ -0,0 +1,41 @@ +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class CatsViewVM : DbTableViewModel<Cat> + { + public CatsViewVM(INotificationProvider notification) : base(notification) + { + SelectDataFileCommand = new RelayCommand(SelectDataFile); + } + + public RelayCommand SelectDataFileCommand { get; set; } + + private void SelectDataFile() + { + OpenFileDialog dlg = new OpenFileDialog(); + dlg.Filter = "Color Adjustment Files|*.CAT"; + dlg.Title = "Select Color Adjustment File"; + if (dlg.ShowDialog().Value) + { + try + { + EditEntity.Data = File.ReadAllBytes(dlg.FileName); + } + catch (Exception ex) + { + _notification.ShowError(ex.Message); + } + } + } + } +} |
