예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
            }
        }