/// <summary> /// The get difference report. /// </summary> /// <param name="filePath"> /// The file Path. /// </param> /// <param name="sourceInServer"> /// The in server source. /// </param> /// <param name="displayWindow"> /// The display Window. /// </param> /// <returns> /// The <see cref="ArrayList"/>. /// </returns> public static ArrayList GetDifferenceReport(string filePath, string sourceInServer, bool displayWindow) { var sLf = new DiffListTextFile(filePath); var dLf = new DiffListTextFile(sourceInServer, "\r\n"); var de = new DiffEngine(); de.ProcessDiff(dLf, sLf, DiffEngineLevel.SlowPerfect); if (!displayWindow) { return de.DiffReport(); } using (var win = new Results(sLf, dLf, de.DiffReport(), 0)) { win.ShowDialog(); } return de.DiffReport(); }
private void TextDiff(string sFile, string dFile) { this.Cursor = Cursors.WaitCursor; DiffList_TextFile sLF = null; DiffList_TextFile dLF = null; try { sLF = new DiffList_TextFile(sFile); dLF = new DiffList_TextFile(dFile); } catch (Exception ex) { this.Cursor = Cursors.Default; MessageBox.Show(ex.Message,"File Error"); return; } try { double time = 0; DiffEngine de = new DiffEngine(); time = de.ProcessDiff(sLF,dLF,_level); ArrayList rep = de.DiffReport(); Results dlg = new Results(sLF,dLF,rep,time); dlg.TopMost = true; dlg.ShowDialog(); dlg.Dispose(); dlg.TopMost = false; } catch (Exception ex) { this.Cursor = Cursors.Default; string tmp = string.Format("{0}{1}{1}***STACK***{1}{2}", ex.Message, Environment.NewLine, ex.StackTrace); MessageBox.Show(tmp,"Compare Error"); return; } this.Cursor = Cursors.Default; }