protected override void OnClick(EventArgs e) { base.OnClick(e); if (Enabled) { if (_storage.IsChanged) { var userAction = new SaveMessageBox().Show(_storage.FileName + AppConstants.FileExtension); if (userAction == UserAction.Yes) { new SaveCommand(_storage).PerformClick(); _storage.New(_adapter.GetDefaultDeviceName, _adapter.GetDefaultBaudrate); } if (userAction == UserAction.No) { _storage.New(_adapter.GetDefaultDeviceName, _adapter.GetDefaultBaudrate); } } else { _storage.New(_adapter.GetDefaultDeviceName, _adapter.GetDefaultBaudrate); } } }
protected override void OnClick(EventArgs e) { base.OnClick(e); if (_storage.IsChanged) { var userAction = new SaveMessageBox().Show(_storage.FileName + AppConstants.FileExtension); if (userAction == UserAction.Yes) { /*A régi változásit menttete, nyitja az újat...*/ new SaveCommand(_storage).PerformClick(); } else if (userAction == UserAction.No) { /*A régi változásit eldobta, nyitja az újat...*/ _storage.DropChanged(); if (_openView.Show() == UserAction.OK) { } } } else { /*Csask simán nyitja a workspacen kersztül*/ if (_openView.Show() == UserAction.OK) { } } }
public void Open(string path) { _path = path; if (_storage.IsChanged) { var userAction = new SaveMessageBox().Show(_storage.FileName + AppConstants.FileExtension); if (userAction == UserAction.Yes) { new Main.Commands.SaveCommand(_storage).PerformClick(); } } else { _storage.Load(path); } }