コード例 #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
ファイル: MainForm.cs プロジェクト: tigerhu67/monobuildtools
        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);
            }
        }