private void AddLocation(MediaLocation mediaLocation) { var addLocationResult = _collectionManager.AddMediaLocation(mediaLocation); if (addLocationResult.IsSuccessful) { Locations.Add(addLocationResult.Value); } else { _messengerService.ShowMessageBox("Error adding media location!", GetErrorString(addLocationResult.FailureReason), MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void Bootstrapper_BootFailed(object sender, AssociatableEventArgs <StartupFailureReason> e) { string message; switch (e.AssociatedObject) { case StartupFailureReason.DatabaseConnectionError: message = "Connection with the database failed."; break; case StartupFailureReason.SqlConnectionStringRetrivalError: message = "Error retrieving sql connection string"; break; case StartupFailureReason.IncompleteAccountSetup: message = "Account setup is incomplete"; break; case StartupFailureReason.ErrorSettingSqlConnectionString: message = "Error in setting sql connection string"; break; default: throw new ArgumentOutOfRangeException(); } if (e.AssociatedObject == StartupFailureReason.DatabaseConnectionError) { _messengerService.ShowMessageBox("Error", message, MessageBoxButtons.OK, MessageBoxIcon.Error); } _application.Shutdown(); }
private static void loginManagerVM_Closed(ILoginVM sender, ViewModelCloseResult e) { var choice = _messengerService.ShowMessageBox("Warning", "Application will close, do you want to close application?", MessageBoxButtons.OKCancel); if (choice == DialogResult.OK) { _messengerService.ShutDownApplication(); } }