private void ReportReplacement(string ofendedType, string originalItem, string replacementItem, int counter) { if (!_reportReplacementCounterRememberAnswer) { var msg = string.Format(@"Replaced {0} occurences of '{1}' by '{2}' of '{3}' type.", counter, originalItem, replacementItem, ofendedType); using (var messageBox = new MessageBoxEx(msg, @"Fixing project file", MessageBoxIcon.Information)) { messageBox.SetButtons(new[] { DialogResult.OK }); messageBox.SetCheckbox("Do not show again."); messageBox.ShowDialog(); _reportReplacementCounterRememberAnswer = messageBox.CheckboxChecked; } } }
private bool ConfirmReplacement(string ofendedType, string originalItem, string replacementItem) { if (!_confirmReplacementRememberAnswer) { var msg = string.Format(@"Do you want to replace all occurences of '{0}' by '{1}' of '{2}' type?", originalItem, replacementItem, ofendedType); using (var messageBox = new MessageBoxEx(msg, @"Fixing project file", MessageBoxIcon.Question)) { messageBox.SetButtons(new[] { DialogResult.No, DialogResult.Yes }, 2); messageBox.SetCheckbox(@"Do not ask again if ""Yes""."); messageBox.ShowDialog(); _confirmReplacementDialogResult = messageBox.DialogResult == DialogResult.Yes; _confirmReplacementRememberAnswer = messageBox.CheckboxChecked && _confirmReplacementDialogResult; } } return(_confirmReplacementDialogResult); }