Пример #1
0
        private void OnSave()
        {
            var saveSucceeded = _favouriteServerStore.SaveToStore(_addresses);

            var messageBoxText = saveSucceeded ? "Favourite servers saved" : "Failed to save favourite servers. Please check logs for details.";
            var icon           = saveSucceeded ? MessageBoxImage.Information : MessageBoxImage.Error;

            MessageBox.Show(Application.Current.MainWindow, messageBoxText, "Save result", MessageBoxButton.OK, icon);
        }
        private void Save()
        {
            var saveSucceeded = _favouriteServerStore.SaveToStore(_addresses);

            if (!saveSucceeded)
            {
                MessageBox.Show(Application.Current.MainWindow,
                                "Failed to save favourite servers. Please check logs for details.",
                                "Favourite server save failure",
                                MessageBoxButton.OK,
                                MessageBoxImage.Error);
            }
        }