private void AppendLineToFileWithComment(string prompt, string file, string line) { using (var commentDialog = new CommentDialog()) { commentDialog.Text = line; commentDialog.Prompt = prompt; if (commentDialog.ShowDialog() != DialogResult.OK) { return; } var comment = commentDialog.Comment; var formattedLine = comment.Trim().Length > 0 ? PrefixLineWithComment(line, comment) : line; AppendLineToFile(file, formattedLine); } }
private void AppendLineToFileWithComment(string prompt, string file, string line) { using (var commentDialog = new CommentDialog()) { commentDialog.Text = line; commentDialog.Prompt = prompt; if (commentDialog.ShowDialog() != DialogResult.OK) return; var comment = commentDialog.Comment; var formattedLine = comment.Trim().Length > 0 ? PrefixLineWithComment(line, comment) : line; AppendLineToFile(file, formattedLine); } }