Example #1
0
        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.ShowDialog();
                dlg.Dispose();
            }
            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;
        }
Example #2
0
		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;
		}