Exemple #1
0
        public static string GenerateMarkup(CodeReviewData codeReviewData)
        {
            string comment = string.Empty;

            foreach (var commentItem in SortComments(codeReviewData.Comments))
            {
                comment += $"\'\'\'{commentItem.Key}.cs\'\'\'\n";
                IList <Comment> comments = commentItem.Value.OrderBy(x => x.Type).ToList();

                foreach (var item in comments)
                {
                    switch (item.Type)
                    {
                    case CommentType.Refactor:
                        comment += $"{item.Text}\n";
                        comment += GenerateCode(item) + "\n";
                        break;

                    case CommentType.UnusedDirectives:
                        comment += "unused directive \n\n";
                        break;

                    case CommentType.Comment:
                        comment += $"{item.Text}\n\n";
                        break;
                    }
                }
            }

            return(comment);
        }
 public CodeReview(Action onChange)
 {
     m_Path         = $"{Directory.GetCurrentDirectory().Replace("bin\\", string.Empty).Replace("Debug", string.Empty).Replace("Release", string.Empty)}\\CodeReviews\\";
     m_Data         = new CodeReviewData();
     m_CommentCount = 0;
     CommentInds    = new BindingList <string> ();
     m_OnChange     = onChange;
 }
        public void LoadData(string fileName)
        {
            XmlSerializer xmlSerializer = new XmlSerializer(typeof(CodeReviewData));

            using (StreamReader reader = new StreamReader($"{m_Path}{fileName}"))
            {
                m_Data = (CodeReviewData)xmlSerializer.Deserialize(reader);
                m_Data.CreateDeserializeDic();
                ReloadCommentList();
                m_CommentCount = m_Data.CommentDic.Count;
                m_OnChange();
            }
        }