コード例 #1
0
        public ActionResult Revision(int id)
        {
            var revision1 = _articleRevisionRepository.Find(id);
            var article   = revision1.Article;
            var revisions = article.ArticleRevisions.OrderBy(ar => ar.ChangedDate).ToList();
            var revision2 = revisions.LastOrDefault();

            HtmlDiff diffHelper = new HtmlDiff(revision1.ArticleContent, revision2.ArticleContent);
            string   diffOutput = diffHelper.Build();


            var viewModel = new RevisionCompareView();

            viewModel.Revision1       = AutoMapper.Mapper.Map <RevisionView>(revision1);
            viewModel.Revision1.Order = revisions.IndexOf(revision1) + 1;

            viewModel.Revision2       = AutoMapper.Mapper.Map <RevisionView>(revision2);
            viewModel.Revision2.Order = revisions.Count();

            viewModel.DiffOutput = diffOutput;
            viewModel.Title      = article.Title;
            viewModel.Count      = revisions.Count();
            viewModel.ArticleId  = article.Id;

            return(View(viewModel));
        }
コード例 #2
0
ファイル: ChannelWikiController.cs プロジェクト: x1987624/SNS
        public ActionResult ShowPageVersionDifferent(IEnumerable <long> VersionId)
        {
            bool IsSpeech = Request.Form.Get <bool>("IsSpeech", false);

            ViewData["IsSpeech"] = IsSpeech;
            if (VersionId != null && VersionId.Count() == 2)
            {
                WikiPageVersion v1   = wikiService.GetPageVersion(VersionId.ToList()[1]);
                WikiPageVersion v2   = wikiService.GetPageVersion(VersionId.ToList()[0]);
                string          str1 = v1.ResolvedBody;
                string          str2 = v2.ResolvedBody;
                //IEnumerable<int> versionnums = Request.Form.Get<IEnumerable<int>>("versionnum");
                string        nums  = Request.Form.Get <string>("saveNums");
                List <string> _nums = nums.Split(',').ToList();
                if (_nums != null && _nums.Count() >= 2)
                {
                    v1.VersionNum = int.Parse(_nums[1]);
                    v2.VersionNum = int.Parse(_nums[0]);
                }
                HtmlDiff diffHelper = new HtmlDiff(v1.ResolvedBody, v2.ResolvedBody);
                ViewData["diffString"]       = diffHelper.Build();
                ViewData["WikiPageVersion1"] = v1;
                ViewData["WikiPageVersion2"] = v2;
                pageResourceManager.InsertTitlePart("词条历史版本比较");
                return(View());
            }
            return(View());
        }
コード例 #3
0
        private void ShowVsHistory()
        {
            HtmlContent    html    = repository.Fetch(moduleId);
            ContentHistory history = new ContentHistory(historyGuid);

            if (history.ContentGuid != html.ModuleGuid)
            {
                return;
            }

            litCurrentHeading.Text = string.Format(Resource.CurrentVersionHeadingFormat,
                                                   DateTimeHelper.Format(html.LastModUtc, timeZone, "g", timeOffset));

            if ((HtmlConfiguration.UseHtmlDiff) && (highlightDiff))
            {
                HtmlDiff diffHelper = new HtmlDiff(history.ContentText, html.Body);
                litCurrentVersion.Text = diffHelper.Build();
            }
            else
            {
                litCurrentVersion.Text = html.Body;
            }

            litHistoryHead.Text = string.Format(Resource.VersionAsOfHeadingFormat,
                                                DateTimeHelper.Format(history.CreatedUtc, timeZone, "g", timeOffset));



            litHistoryVersion.Text = history.ContentText;

            string onClick = "top.window.LoadHistoryInEditor('" + historyGuid.ToString() + "');  return false;";

            btnRestore.Attributes.Add("onclick", onClick);
        }
コード例 #4
0
        private void PopulateControls()
        {
            if (moduleId == -1)
            {
                return;
            }
            if (itemId == -1)
            {
                return;
            }
            //if (module == null) { return; }
            if (historyGuid == Guid.Empty)
            {
                return;
            }

            Blog blog = new Blog(itemId);

            if (blog.ModuleId != moduleId)
            {
                SiteUtils.RedirectToAccessDeniedPage(this);
                return;
            }

            ContentHistory history = new ContentHistory(historyGuid);

            if (history.ContentGuid != blog.BlogGuid)
            {
                return;
            }

            litCurrentHeading.Text = string.Format(BlogResources.CurrentVersionHeadingFormat,
                                                   DateTimeHelper.Format(blog.LastModUtc, timeZone, "g", timeOffset));

            if (BlogConfiguration.UseHtmlDiff)
            {
                HtmlDiff diffHelper = new HtmlDiff(history.ContentText, blog.Description);
                litCurrentVersion.Text = diffHelper.Build();
            }
            else
            {
                litCurrentVersion.Text = blog.Description;
            }

            litHistoryHead.Text = string.Format(BlogResources.VersionAsOfHeadingFormat,
                                                DateTimeHelper.Format(history.CreatedUtc, timeZone, "g", timeOffset));

            litHistoryVersion.Text = history.ContentText;

            string onClick = "top.window.LoadHistoryInEditor('" + historyGuid.ToString() + "');  return false;";

            btnRestore.Attributes.Add("onclick", onClick);
        }
コード例 #5
0
        public ActionResult CompareRevision(int articleid, int order1, int order2)
        {
            var article   = _articleRepository.Find(articleid);
            var revisions = article.ArticleRevisions.OrderBy(ar => ar.ChangedDate).ToList();
            var revision1 = revisions[order1 - 1];
            var revision2 = revisions[order2 - 1];

            HtmlDiff diffHelper = new HtmlDiff(revision1.ArticleContent, revision2.ArticleContent);
            string   diffOutput = diffHelper.Build();

            var viewModel = new RevisionCompareView();

            viewModel.Revision1       = AutoMapper.Mapper.Map <RevisionView>(revision1);
            viewModel.Revision1.Order = revisions.IndexOf(revision1) + 1;

            viewModel.Revision2       = AutoMapper.Mapper.Map <RevisionView>(revision2);
            viewModel.Revision2.Order = revisions.Count();

            return(Json(new { source = new { content = revision1.ArticleContent, time = revision1.ChangedDate.ToString("dd/MM/yyyy hh:mm:ss") }, result = new { content = diffOutput, time = revision2.ChangedDate.ToString("dd/MM/yyyy hh:mm:ss") } }));
        }
コード例 #6
0
        private void ShowVsDraft()
        {
            HtmlContent html = repository.Fetch(moduleId);

            if (html == null)
            {
                return;
            }

            ContentWorkflow draftContent = ContentWorkflow.GetWorkInProgress(html.ModuleGuid);

            if (draftContent.Guid != workflowGuid)
            {
                return;
            }

            if ((HtmlConfiguration.UseHtmlDiff) && (highlightDiff))
            {
                HtmlDiff diffHelper = new HtmlDiff(html.Body, draftContent.ContentText);
                litCurrentVersion.Text = diffHelper.Build();
            }
            else
            {
                litCurrentVersion.Text = draftContent.ContentText;
            }

            litCurrentHeading.Text = string.Format(Resource.CurrentDraftHeadingFormat,
                                                   DateTimeHelper.Format(draftContent.RecentActionOn, timeZone, "g", timeOffset));

            litHistoryHead.Text = string.Format(Resource.CurrentVersionHeadingFormat,
                                                DateTimeHelper.Format(html.LastModUtc, timeZone, "g", timeOffset));

            litHistoryVersion.Text = html.Body;

            //string onClick = "top.window.LoadHistoryInEditor('" + historyGuid.ToString() + "');  return false;";
            //btnRestore.Attributes.Add("onclick", onClick);
            btnRestore.Visible = false;
        }
コード例 #7
0
        /// <summary>
        /// Gets a particular version of a page.
        /// </summary>
        /// <param name="id">The Guid ID for the version.</param>
        /// <returns>A <see cref="PageViewModel"/> as the model, which contains the HTML diff
        /// output inside the <see cref="PageViewModel.Content"/> property.</returns>
        public ActionResult Version(Guid id)
        {
            MarkupConverter       converter    = _pageService.GetMarkupConverter();
            IList <PageViewModel> bothVersions = _historyService.CompareVersions(id).ToList();
            string diffHtml = "";

            if (bothVersions[1] != null)
            {
                string   oldVersion = converter.ToHtml(bothVersions[1].Content).Html;
                string   newVersion = converter.ToHtml(bothVersions[0].Content).Html;
                HtmlDiff diff       = new HtmlDiff(oldVersion, newVersion);
                diffHtml = diff.Build();
            }
            else
            {
                diffHtml = converter.ToHtml(bothVersions[0].Content).Html;
            }

            PageViewModel model = bothVersions[0];

            model.Content = diffHtml;
            return(View(model));
        }
コード例 #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string oldText = @"<p><i>This is</i> some sample text to <strong>demonstrate</strong> the capability of the <strong>HTML diff tool</strong>.</p>
                                <p>It is based on the <b>Ruby</b> implementation found <a href='http://github.com/myobie/htmldiff'>here</a>. Note how the link has no tooltip</p>
                                <table cellpadding='0' cellspacing='0'>
                                <tr><td>Some sample text</td><td>Some sample value</td></tr>
                                <tr><td>Data 1 (this row will be removed)</td><td>Data 2</td></tr>
                                </table>
                                Here is a number 2 32";

            string newText = @"<p>This is some sample <strong>text to</strong> demonstrate the awesome capabilities of the <strong>HTML <u>diff</u> tool</strong>.</p><br/><br/>Extra spacing here that was not here before.
                                <p>It is <i>based</i> on the Ruby implementation found <a title='Cool tooltip' href='http://github.com/myobie/htmldiff'>here</a>. Note how the link has a tooltip now and the HTML diff algorithm has preserved formatting.</p>
                                <table cellpadding='0' cellspacing='0'>
                                <tr><td>Some sample <strong>bold text</strong></td><td>Some sample value</td></tr>
                                </table>
                                Here is a number 2 <sup>32</sup>";

            HtmlDiff diffHelper = new HtmlDiff(oldText, newText);

            litOldText.Text  = oldText;
            litNewText.Text  = newText;
            litDiffText.Text = diffHelper.Build();
        }
コード例 #9
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("<tr>\r\n\t<td class=\"td_main\"><b>");

            #line 10 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SharedDataObject.TestDescription));

            #line default
            #line hidden
            this.Write("</b><br/>\r\n\t\t<a id=\"");

            #line 11 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SharedDataObject.OldId));

            #line default
            #line hidden
            this.Write("\">");

            #line 11 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SharedDataObject.TestName));

            #line default
            #line hidden
            this.Write("</a>\r\n\t</td>\r\n\t");

            #line 13 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
            switch (SharedDataObject.Result)
            {
            case EnumResultSeverityType.FALSE_POSITIVE:

            #line default
            #line hidden
                this.Write("\t\t<td class=\"td_main false_positive\">\r\n\t\t");

            #line 16 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                break;

            case EnumResultSeverityType.WARNING:
            case EnumResultSeverityType.WARNING_ONLY_NEW:

            #line default
            #line hidden
                this.Write("\t\t<td class=\"td_main warning\">\r\n\t\t");

            #line 20 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                break;

            case EnumResultSeverityType.WARNING_NO_DATA:

            #line default
            #line hidden
                this.Write("\t\t<td class=\"td_main warning_no_data\">\r\n\t\t");

            #line 23 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                break;

            case EnumResultSeverityType.ERROR_WITH_EXPLANATION:
            case EnumResultSeverityType.ERROR_ONLY_OLD:

            #line default
            #line hidden
                this.Write("\t\t<td class=\"td_main error_with_explanation\">\r\n\t\t");

            #line 27 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                break;

            case EnumResultSeverityType.ERROR:

            #line default
            #line hidden
                this.Write("\t\t<td class=\"td_main error\">\r\n\t\t");

            #line 30 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                break;

            default:

            #line default
            #line hidden
                this.Write("\t\t<td class=\"td_main success\">\r\n\t\t");

            #line 33 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                break;
            }

            #line default
            #line hidden
            this.Write("\t");

            #line 35 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SharedDataObject.Result));

            #line default
            #line hidden
            this.Write("</td>\r\n\t<td class=\"td_main\">\r\n\t\t<a href=\"");

            #line 37 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SharedDataObject.OldUrl));

            #line default
            #line hidden
            this.Write("\">Profile data of OldId ");

            #line 37 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SharedDataObject.OldId));

            #line default
            #line hidden
            this.Write("</a><br/>\r\n\t\t<a href=\"");

            #line 38 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SharedDataObject.NewUrl));

            #line default
            #line hidden
            this.Write("\">User data of ID is ");

            #line 38 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SharedDataObject.UserId));

            #line default
            #line hidden
            this.Write("</a>\r\n\t</td>\r\n\t<td class=\"td_main\">\r\n\t\t");

            #line 41 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SharedDataObject.ErrorMessage));

            #line default
            #line hidden
            this.Write("\r\n\t\t<br/><br/>\r\n\t\t<table class=\"table_main\">\r\n\t\t<tr>\r\n\t\t\t<td class=\"th_main\">OLD " +
                       "SERVICE DATA <span class=\"error_color\">[COUNT ELEMENTS: ");

            #line 45 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SharedDataObject.UnstructuredOldValues.Count()));

            #line default
            #line hidden
            this.Write("]</span></td>\r\n\t\t\t<td class=\"th_main\">NEW SERVICE DATA <span class=\"error_color\">" +
                       "[COUNT ELEMENTS: ");

            #line 46 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SharedDataObject.UnstructuredNewValues.Count()));

            #line default
            #line hidden
            this.Write("]</span></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td class=\"td_main\">\r\n\t\t\t\t<ul>\r\n\t\t\t\t\t");

            #line 51 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
            if (SharedDataObject.UnstructuredOldValues.Count() > 0)
            {
                foreach (StringDescriptor oldValue in SharedDataObject.UnstructuredOldValues)
                {
            #line default
            #line hidden
                    this.Write("\t\t\t\t\t<li>");

            #line 53 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                    if (!string.IsNullOrEmpty(oldValue.Value))
                    {
            #line default
            #line hidden

            #line 53 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(oldValue.Value));

            #line default
            #line hidden
                        this.Write("\r\n\t\t\t\t\t");

            #line 54 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        if (!oldValue.HasBeenMatched)
                        {
            #line default
            #line hidden
                            this.Write("<span class=\"missing\">[MISSING IN NEW SERVICE]</span>");

            #line 54 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        }

            #line default
            #line hidden
                        this.Write("\t\t\t\t\t");

            #line 55 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        if (oldValue.IsDuplicate)
                        {
            #line default
            #line hidden
                            this.Write("<span class=\"IsDuplicate\">[IsDuplicate]</span>");

            #line 55 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        }

            #line default
            #line hidden
                        this.Write("\t\t\t\t\t");

            #line 56 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        if (oldValue.MatchedOnceTrailingSpacesRemoved)
                        {
            #line default
            #line hidden
                            this.Write("<span class=\"missing\">[TRAILING WHITE SPACES]</span>");

            #line 56 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        }

            #line default
            #line hidden
                        this.Write("\t\t\t\t\t");

            #line 57 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        if (oldValue.MatchedOnceCaseCorrected)
                        {
            #line default
            #line hidden
                            this.Write("<span class=\"missing\">[CASE]</span>");

            #line 57 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        }

            #line default
            #line hidden
                        this.Write("\t\t\t\t\t");

            #line 58 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        if (oldValue.PartialMatchOnly)
                        {
            #line default
            #line hidden
                            this.Write("<span class=\"missing\">[PARTIAL MATCH]</span>");

            #line 58 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        }

            #line default
            #line hidden
                        this.Write("\t\t\t\t\t");

            #line 59 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        if (oldValue.MatchedOnceShifted)
                        {
            #line default
            #line hidden
                            this.Write("<span class=\"missing\">[NAME REORGANIZED]</span>");

            #line 59 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        }

            #line default
            #line hidden
                        this.Write("\t\t\t\t\t");

            #line 60 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                    }
                    else
                    {
            #line default
            #line hidden
                        this.Write("NULL");

            #line 60 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                    }

            #line default
            #line hidden
                    this.Write("</li>\r\n\t\t\t\t\t");

            #line 61 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                }
            }

            #line default
            #line hidden
            this.Write("\t\t\t\t</ul>\r\n\t\t\t</td>\r\n\t\t\t<td class=\"td_main\">\r\n\t\t\t\t<ul>\r\n\t\t\t\t\t");

            #line 66 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
            if (SharedDataObject.UnstructuredNewValues.Count > 0)
            {
                foreach (StringDescriptor newValue in SharedDataObject.UnstructuredNewValues)
                {
            #line default
            #line hidden
                    this.Write("\t\t\t\t\t<li>");

            #line 68 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                    if (!string.IsNullOrEmpty(newValue.Value))
                    {
            #line default
            #line hidden
                        this.Write("\t\t\t\t\t");

            #line 69 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        string newValueToDisplay = newValue.Value;
                        if (SharedDataObject.UnstructuredOldValues.Count <= 1 && SharedDataObject.UnstructuredNewValues.Count <= 1)
                        {
                            string oldValue = string.Empty;
                            if (SharedDataObject.UnstructuredOldValues.Count() > 0)
                            {
                                oldValue = SharedDataObject.UnstructuredOldValues.First().Value; if (oldValue == null)
                                {
                                    oldValue = string.Empty;
                                }
                            }
                            HtmlDiff diffHelper = new HtmlDiff(oldValue, newValue.Value);
                            newValueToDisplay = diffHelper.Build();
                        }

            #line default
            #line hidden
                        this.Write("\t\t\t\t\t");

            #line 76 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(newValueToDisplay));

            #line default
            #line hidden
                        this.Write("\r\n\t\t\t\t\t");

            #line 77 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        if (!newValue.HasBeenMatched)
                        {
            #line default
            #line hidden
                            this.Write("<span class=\"missing\">[MISSING IN OLD SERVICE]</span>");

            #line 77 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        }

            #line default
            #line hidden
                        this.Write("\t\t\t\t\t");

            #line 78 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        if (newValue.IsDuplicate)
                        {
            #line default
            #line hidden
                            this.Write("<span class=\"IsDuplicate\">[IsDuplicate]</span>");

            #line 78 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        }

            #line default
            #line hidden
                        this.Write("\t\t\t\t\t");

            #line 79 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        if (newValue.MatchedOnceTrailingSpacesRemoved)
                        {
            #line default
            #line hidden
                            this.Write("<span class=\"missing\">[TRAILING WHITE SPACES]</span>");

            #line 79 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        }

            #line default
            #line hidden
                        this.Write("\t\t\t\t\t");

            #line 80 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        if (newValue.MatchedOnceCaseCorrected)
                        {
            #line default
            #line hidden
                            this.Write("<span class=\"missing\">[CASE]</span>");

            #line 80 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        }

            #line default
            #line hidden
                        this.Write("\t\t\t\t\t");

            #line 81 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        if (newValue.PartialMatchOnly)
                        {
            #line default
            #line hidden
                            this.Write("<span class=\"missing\">[PARTIAL MATCH]</span>");

            #line 81 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        }

            #line default
            #line hidden
                        this.Write("\t\t\t\t\t");

            #line 82 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        if (newValue.MatchedOnceShifted)
                        {
            #line default
            #line hidden
                            this.Write("<span class=\"missing\">[NAME REORGANIZED]</span>");

            #line 82 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                        }

            #line default
            #line hidden
                        this.Write("\t\t\t\t\t");

            #line 83 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                    }
                    else
                    {
            #line default
            #line hidden
                        this.Write("NULL");

            #line 83 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                    }

            #line default
            #line hidden
                    this.Write("</li>\r\n\t\t\t\t\t");

            #line 84 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                }
            }

            #line default
            #line hidden
            this.Write("\t\t\t\t</ul>\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t\t</table>\r\n\t</td>\r\n\t<td class=\"td_main\">\r\n\t<p>Dura" +
                       "tion : ");

            #line 91 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(SharedDataObject.Duration.ToString("mm'mn:'ss's:'FFFFFFF")));

            #line default
            #line hidden
            this.Write("</p>\r\n\t<br/>\r\n\t<ul>\r\n\t");

            #line 94 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
            if (SharedDataObject.IdentifiedDataBehaviors != null)
            {
                foreach (var observation in SharedDataObject.IdentifiedDataBehaviors)
                {
            #line default
            #line hidden
                    this.Write("\t\t\t<li>");

            #line 96 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(observation));

            #line default
            #line hidden
                    this.Write("</li><br/>\r\n\t");

            #line 97 "\\psf\Home\Desktop\TestMVC4App\Profile-System-Testing\TestMVC4ConsoleApp\Templates\DetailedReportUnstructuredLists.tt"
                }
            }

            #line default
            #line hidden
            this.Write("\t\t</ul>\r\n\t</td>\r\n</tr>");
            return(this.GenerationEnvironment.ToString());
        }
コード例 #10
0
ファイル: Diff.cs プロジェクト: wangdaguo68/FYKJ.Framework
        public static string Build(string oldText, string newText, bool toWord = false)
        {
            var diff = new HtmlDiff(oldText ?? string.Empty, newText ?? string.Empty, toWord);

            return(diff.Build());
        }