|
|
|
@ -1,5 +1,6 @@ |
|
|
|
|
using System ; |
|
|
|
|
using System.IO ; |
|
|
|
|
using System.Threading ; |
|
|
|
|
using System.Drawing ; |
|
|
|
|
using System.Collections.Generic ; |
|
|
|
|
using System.Windows.Forms ; |
|
|
|
@ -46,6 +47,8 @@ public partial class MainForm : Form |
|
|
|
|
dataDir, "*.*", SearchOption.AllDirectories |
|
|
|
|
) ; |
|
|
|
|
foreach( string fname in files ) { |
|
|
|
|
|
|
|
|
|
// load the next image |
|
|
|
|
string extn = Path.GetExtension( fname ).ToLower() ; |
|
|
|
|
if ( ! mValidImageExtensions.Contains( extn ) ) |
|
|
|
|
continue ; |
|
|
|
@ -61,8 +64,20 @@ public partial class MainForm : Form |
|
|
|
|
key = fullPath ; |
|
|
|
|
} |
|
|
|
|
logger.Debug( $"Loading image: {key}" ) ; |
|
|
|
|
mChartImages[ key ] = new ChartImage( key, fullPath ) ; |
|
|
|
|
ChartImage chartImage = new ChartImage( key, fullPath ) ; |
|
|
|
|
mChartImages[ key ] = chartImage ; |
|
|
|
|
|
|
|
|
|
// add the image to the list |
|
|
|
|
ImageListViewItem item = chartImage.imageListViewItem ; |
|
|
|
|
mSearchResults.Invoke( (MethodInvoker) ( () => mSearchResults.Items.Add( item ) ) ) ; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// everything has been loaded, allow searches |
|
|
|
|
mSearchQuery.Invoke( (MethodInvoker) ( () => { |
|
|
|
|
mSearchLabel.Enabled = true ; |
|
|
|
|
mSearchQuery.Enabled = true ; |
|
|
|
|
mSearchQuery.Focus() ; |
|
|
|
|
} ) ) ; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void updateSearchResults( string searchQuery ) |
|
|
|
|