/// <summary> /// Main Process. /// </summary> private void Process() { if (Identical) { moLog.WriteLn(); moLog.WriteLn("***********************"); moLog.WriteLn("* Files are identical *"); moLog.WriteLn("***********************"); moLog.WriteLn(); } //Check if user has chosen to cancel run. if (Interrupt.Reason == "Cancel") { return; } //Header. moLog.WriteMsg("010", "I", "New File : " + NewFile); moLog.WriteMsg("020", "I", "Old File : " + OldFile); moLog.WriteMsg("030", "I", "Character Limit : " + LimitCharacters); moLog.WriteMsg("040", "I", "Line Limit : " + LimitLines); moLog.WriteMsg("050", "I", "Sub Line Limit : " + SubLineMatchLimit); moLog.WriteLn(); moLog.WriteLn("Delta"); moLog.WriteLn("-----"); //Report. SignalBeginReport(Sections.Count); string handoverType = string.Empty; bool bCharacterMode = false; for (int nCount = 0; nCount < Sections.Count; nCount++) { if (nCount > 1006) { string temp = string.Empty; } Section oSection = (Section)Sections[nCount]; if (oSection is SectionOfLines) { if (bCharacterMode) { bCharacterMode = false; //moLog.WriteLn("<<<"); } SectionOfLines oSectionOfLines = (SectionOfLines)oSection; ReporterOfTextLines oReporter = new ReporterOfTextLines(oSectionOfLines, moLog); oReporter.HandoverType = handoverType; oReporter.Display(); handoverType = oReporter.Type; } else if (oSection is SectionOfCharacters) { if (!bCharacterMode) { bCharacterMode = true; //moLog.WriteLn(">>>"); } SectionOfCharacters oSectionOfCharacters = (SectionOfCharacters)oSection; ReporterOfTextCharacters oReporter = new ReporterOfTextCharacters(oSectionOfCharacters, moLog); oReporter.HandoverType = handoverType; oReporter.Display(oSectionOfCharacters.Indentation); handoverType = oReporter.Type; } else { Console.WriteLine("Unknown kind of section."); } SignalUpdateReport(1); } SignalEndOfReport(); }
/// <summary> /// Construct a text reporter to report the specified section of lines. /// </summary> public ReporterOfTextLines(SectionOfLines poSection, Logger poLog) : base(poSection, poLog) { moSection = poSection; moBlock = (BlockOfLines)moSection.Data; }
/// <summary> /// Main Process. /// </summary> private void Process() { if (Identical) { moLog.WriteLn("<br/>"); moLog.WriteLn("***********************<br/>"); moLog.WriteLn("* Files are identical *<br/>"); moLog.WriteLn("***********************<br/>"); moLog.WriteLn("<br/>"); } //Check if user has chosen to cancel run. if (Interrupt.Reason == "Cancel") { return; } //Header. moLog.WriteLn("New File : " + NewFile + "<br/>"); moLog.WriteLn("Old File : " + OldFile + "<br/>"); moLog.WriteLn("Character Limit : " + LimitCharacters + "<br/>"); moLog.WriteLn("Line Limit : " + LimitLines + "<br/>"); moLog.WriteLn("Sub Line Limit : " + SubLineMatchLimit + "<br/>"); moLog.WriteLn("<br/>"); moLog.WriteLn("Delta<br/>"); moLog.WriteLn("-----<br/>"); //Report. SignalBeginReport(Sections.Count); string handoverType = string.Empty; bool bCharacterMode = false; for (int nCount = 0; nCount < Sections.Count; nCount++) { string identity = nCount.ToString().Trim(); if (nCount > 1006) { string temp = string.Empty; } Section oSection = (Section)Sections[nCount]; if (oSection is SectionOfLines) { if (bCharacterMode) { bCharacterMode = false; //moLog.WriteLn("<<<"); } SectionOfLines oSectionOfLines = (SectionOfLines)oSection; ReporterOfHtmlLines oReporter = new ReporterOfHtmlLines(oSectionOfLines, moLog); oReporter.HandoverType = handoverType; oReporter.Display(identity); handoverType = oReporter.Type; } else if (oSection is SectionOfCharacters) { if (!bCharacterMode) { bCharacterMode = true; //moLog.WriteLn(">>>"); } SectionOfCharacters oSectionOfCharacters = (SectionOfCharacters)oSection; ReporterOfHtmlCharacters oReporter = new ReporterOfHtmlCharacters(oSectionOfCharacters, moLog); oReporter.HandoverType = handoverType; oReporter.Display(oSectionOfCharacters.Indentation, identity); handoverType = oReporter.Type; } else { Console.WriteLine("Unknown kind of section."); } SignalUpdateReport(1); } //Padding at the bottom to allow full scrolling. for (int blankLine = 1; blankLine <= 5; blankLine++) { moLog.WriteLn("<br/>"); } SignalEndOfReport(); }