Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string text1 = GetFileContent("file1.txt");
            string text2 = GetFileContent("file2.txt");

            this.text1Literal.Text  = text1;
            this.text2Literal.Text  = text2;
            this.resultLiteral.Text = HtmlDiff.Execute(text1, text2);
        }
Exemplo n.º 2
0
        public static List <StoriesHistoryModel> GetModels(string tag)
        {
            List <StoriesHistoryModel> ret = new List <StoriesHistoryModel>();

            using (var ctx = new Entities())
            {
                var    list = ctx.GetRequirementHistory(tag, null).ToList();
                string previous = string.Empty, text;

                foreach (var i in list)
                {
                    text = String.Format("<p><strong>{0}</strong></p>{1}", i.Title, i.Text);
                    ret.Add(new StoriesHistoryModel(i, HtmlDiff.Execute(previous, text)));
                    previous = text;
                }
            }

            return((from i in ret orderby i.RevisionNumber descending select i).ToList());
        }