Exemplo n.º 1
0
        private void menuDeleteScriptRun_Click(object sender, RoutedEventArgs e)
        {
            DisplayScriptResult resultFile = listViewResultFiles.SelectedItem as DisplayScriptResult;

            if (resultFile != null)
            {
                bool deleteScriptRun = true;

                if (!UserSettings.Settings.IsMessageSuppressed(UserSettings.SuppressCabDetailsDeleteScriptRun))
                {
                    bool suppress = false;

                    if (StackHashMessageBox.Show(Window.GetWindow(this),
                                                 string.Format(CultureInfo.CurrentCulture,
                                                               Properties.Resources.CabDetails_DeleteScriptRunMBMessage,
                                                               resultFile.ScriptName,
                                                               _clientLogic.CurrentCab.Id),
                                                 Properties.Resources.CabDetails_DeleteScriptRunMBTitle,
                                                 StackHashMessageBoxType.YesNo,
                                                 StackHashMessageBoxIcon.Question,
                                                 true,
                                                 out suppress) != StackHashDialogResult.Yes)
                    {
                        deleteScriptRun = false;
                    }

                    if (suppress)
                    {
                        UserSettings.Settings.SuppressMessage(UserSettings.SuppressCabDetailsDeleteScriptRun);
                    }
                }

                if (deleteScriptRun)
                {
                    _clientLogic.AdminRemoveResult(resultFile.ScriptName);
                }
            }
        }