/// /// Refreshs the thumb table view. /// /// private void RefreshThumbTables( object state ) { // path string path = ( string )state; // if we not have a path.. if( String.IsNullOrEmpty( path ) ) { // first we reset the current set Invoke( new ClearThumbList( ClearThumbList ) ); // here we store the gathered file paths string[] images = new string[ 0 ]; // short sleep Thread.Sleep( 500 ); // go through the image locations for( int i = 0; i < Configuration.GetReference().ImageLocations.Count; i++ ) { // get the current path string location = Configuration.GetReference().ImageLocations[ i ]; // information about what we scanning Invoke( new SetProgressLabel( SetProgressLabel ), "Scanning " + location ); // dirs string[] dirs = new string[ 0 ]; // check that the dir really exist if( Directory.Exists( location ) ) { // get all image files images = Directory.GetFiles( location, "*.jpg" ); // if we should scan recursive do that if( Configuration.GetReference().ScanRecursive ) { // get the dirs dirs = Directory.GetDirectories( location ); // and make a sub scan for( int z = 0; z < dirs.Length; z++ ) { RefreshThumbTables( dirs[ z ] ); } } // if we got images.. if( images.Length > 0 ) { // reset the progressbar Invoke( new ResetProgressBar( ResetProgressBar ) ); // setup progressbar steps Invoke( new SetProgressStep( SetProgressStep ), ( 100 / images.Length + 1 + dirs.Length ) ); // and merge them to images for( int n = 0; n < images.Length; n++ ) { // add a thumb in main thread Invoke( new AddThumb( AddThumb ), images[ n ] ); // <------- // perform a step Invoke( new ProgressBarPerform( ProgressBarPerform ) ); } } } }