public void Execute() { BackgroundModel background = backgroundCollection.Get(args.Value); string parentProfileNames = GetParentProfileNames(background); if (parentProfileNames != null) { MessageBoxView.Show("Can't delete this background", $"This background is used by one or more profiles ({parentProfileNames}), you can't delete it."); return; } backgroundCollection.Remove(background); if (screenModel.Background == background) { // Default background can't be deleted so there's always at least 1 item in the list. screenModel.SetBackground(backgroundCollection.Items[0]); } database.DeleteBackground(background); string dirPath = locationModel.GetGraphicBasePath(background.DirectoryType); File.Delete(Path.Combine(dirPath, background.FileName)); }
private static Task <DialogResult> ShowCore(Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options) { MessageBoxView window = new MessageBoxView(owner, options); window.DataContext = new MessageBoxViewModel(text, caption, buttons, window.GetIconDrawing(icon), defaultButton, options); return(owner != null?window.ShowDialog(owner) : window.Show()); }
/// <summary> /// Load event for MainFormView. /// </summary> /// <param name="sender">Object with send this event.</param> /// <param name="e">Event object.</param> private void MainFormView_Load(object sender, EventArgs e) { presenter = Bootstrapper.ServiceLocator.GetService <IMainFormViewPresenter>(); Settings.Click += (x, y) => { using ( SettingsView view = new SettingsView()) { view.ShowDialog(); } }; ShowInstruction.Click += (x, y) => { Presenter.OpenInstruction(); }; About.Click += (x, y) => { using ( AboutView view = new AboutView()) { view.ShowDialog(); } }; Close.Click += (x, y) => { if (MessageBoxView.Show("Zamknąć aplikację? Wszystkie wykonane obliczenia zostaną utracone.", "Zamknij", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { this.Close(); } }; SetDefaulfAlgorithm(); SetStartupValues(); SetStartupControlsState(); SetWeightsDataSource(null); }
public void Show() { _messageBoxView.Show(); }
public void NotifyAboutNotMarketAtLeastOneAttributeAsDecision() { MessageBoxView.Show("W systemie nie ustawiono ani jednego atrybutu decyzyjnego.", "Informacja", MessageBoxButtons.OK, MessageBoxIcon.Information); }
public void NotifyAboutMissingDefaultPdfReader() { MessageBoxView.Show("W systemie nie zdefiniowano domyślnego programu do odczyty plików pdf.", "Informacja", MessageBoxButtons.OK, MessageBoxIcon.Information); }
public void NotifyAboutZeroRulesInResponse() { MessageBoxView.Show("Dla wprowadzonych wartości parametrów algorytm nie zwrócił żadnego wyniku.", "Informacja", MessageBoxButtons.OK, MessageBoxIcon.Information); }
public void NotifyAboutMissingInstruction() { MessageBoxView.Show("Plik z instrukcją nie został znaleziony.", "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); }
public void NotifyAboutIncorrectArchive() { MessageBoxView.Show("Archiwum jest uszkodzone.", "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Error); }
public void NotifyAboutIncorrectNumberOfFilesInArchive() { MessageBoxView.Show("Nieprawidłowa liczba plików w archiwum. Poprawny opis zawartości archiwum można znaleźć w instrukcji.", "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Error); }
public void NotifyAboutRowsNotParsedCorrectly() { MessageBoxView.Show("Błąd przy parsowaniu wierszy z danymi. Poprawny format zapisu zbiorów danych dla poszczególnych formatów plików można znaleźć w instrukcji.", "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Error); }
public void NotifyAboutNoPermissionsToFile() { MessageBoxView.Show("Brak uprawnień do pliku lub jest on obecnie wykorzystywany przez inny proces.", "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Error); }
public void NotifyAboutArgumentCountIncorrect() { MessageBoxView.Show("Liczba atrybutów w poszczególnych wierszach musi być identyczna.", "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Error); }
public void NotifyAboutUnsupportedFileSelected() { MessageBoxView.Show("Załadowny format pliku nie jest obsługiwany. Listę wspieranych formatów można znaleźć w instrukcji obsługi.", "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Error); }