1212using System . Collections . Concurrent ;
1313using System . Runtime . InteropServices ;
1414using System . Text . RegularExpressions ;
15+ using System . Threading . Tasks ;
1516
1617namespace Chizl . FileComparer
1718{
@@ -318,8 +319,8 @@ private void CompareFiles()
318319 // this.OldAsciiContent.Font = new Font("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
319320 // this.NewAsciiContent.Font = new Font("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
320321
321- SplitContainer1 . Panel1Collapsed = false ;
322- SplitContainer1 . Panel2Collapsed = false ;
322+ this . SplitContainer1 . Panel1Collapsed = false ;
323+ this . SplitContainer1 . Panel2Collapsed = false ;
323324
324325 ClearRichText ( ) ;
325326
@@ -331,19 +332,24 @@ private void CompareFiles()
331332 score_threshold = .30 ;
332333 }
333334
334- // Add OLD_DROPDOWN as the value, to represent Old File downdown component. If Key already exists, check existing
335- // value and if New File dropdown (2), make it 3, to represent both Old and New should have it.
336- // If existing value isn't 2, leave it as it, because 1 or 3 already exists.
337- _fileHistory . AddOrUpdate ( this . OldAsciiFile . Text . Trim ( ) , OLD_DROPDOWN ,
335+ // remove any quotes
336+ var oldFile = this . OldAsciiFile . Text . Replace ( "\" " , "" ) . Replace ( "'" , "" ) ;
337+ var newFile = this . NewAsciiFile . Text . Replace ( "\" " , "" ) . Replace ( "'" , "" ) ;
338+
339+ Task . Run ( ( ) => { _lastFileComparison = DiffTool . CompareFiles ( oldFile , newFile , score_threshold , 3 ) ; } ) . Wait ( ) ;
340+
341+ // Add OLD_DROPDOWN as the value, to represent Old File downdown component. If Key already exists,
342+ // check existingvalue and if New File dropdown (2), make it 3, to represent both Old and New
343+ // should have it. If existing value isn't 2, leave it as it, because 1 or 3 already exists.
344+ _fileHistory . AddOrUpdate ( oldFile . Trim ( ) , OLD_DROPDOWN ,
338345 ( key , existingValue ) => { return existingValue == NEW_DROPDOWN ? OLD_NEW_DROPDOWN : existingValue ; } ) ;
339346
340347 // Add 2 as the value, to represent New File downdown component. If Key already exists, check existing
341348 // value and if Old File dropdown (1), make it 3, to represent both Old and New should have it.
342349 // If existing value isn't 1, leave it as it, because 2 or 3 already exists.
343- _fileHistory . AddOrUpdate ( this . NewAsciiFile . Text . Trim ( ) , NEW_DROPDOWN ,
350+ _fileHistory . AddOrUpdate ( newFile . Trim ( ) , NEW_DROPDOWN ,
344351 ( key , existingValue ) => { return existingValue == OLD_DROPDOWN ? OLD_NEW_DROPDOWN : existingValue ; } ) ;
345352
346- _lastFileComparison = DiffTool . CompareFiles ( this . OldAsciiFile . Text , this . NewAsciiFile . Text , score_threshold , 3 ) ;
347353 this . ViewAsBinaryButtonToollbar . Visible = ! _lastFileComparison . IsBinary ;
348354
349355 if ( _lastFileComparison . HasException )
0 commit comments