예제 #1
0
        /// <summary>
        /// 対応する文字列を補間
        /// </summary>
        /// <param name="comment"></param>
        /// <returns></returns>
        private string DataFormat(CommentData comment)
        {
            var format = setting.Format;
            var regex  = format.RegexStrings(@"\$\{(?<value>.*?)\}", "value");

            foreach (var item in regex)
            {
                foreach (var info in comment.GetType().GetProperties())
                {
                    if (info.Name.Equals(item))
                    {
                        format = format.Replace("${" + item + "}", info.GetValue(comment)?.ToString());
                    }
                }
            }

            return(format);
        }