/// <summary> /// /// </summary> protected virtual void onSearchStart(SearchEvent e) { if ( !this.current_dir_.Exists ) { this.current_dir_.Create(); } if ( searchStart != null ) { searchStart( e ); } }
/// <summary> /// /// </summary> /// <param name="e"></param> protected virtual void onSearchCompleted(SearchEvent e) { if ( searchCompleted != null ) { searchCompleted( e ); } }
/// <summary> /// /// </summary> /// <param name="e"></param> protected virtual void onNotFound(SearchEvent e) { if ( notFound != null ) { notFound( e ); } }
protected virtual void onFolderChanging(SearchEvent e) { if ( folderChanging != null ) { folderChanging( e ); } }
/// <summary> /// /// </summary> /// <param name="e"></param> protected virtual void onFinded(SearchEvent e) { if ( finded != null ) { finded( e ); } }
/// <summary> /// /// </summary> public void do_search() { onSearchStart( new SearchEvent( this, this.writer_, this.current_dir_ ) ); foreach ( DirectoryInfo dir in this.current_dir_.GetDirectories() ) { SearchEvent dir_se = new SearchEvent( this, this.writer_, dir ); onFolderChanging( dir_se ); FileInfo[] files = dir.GetFiles(); if ( files.Length > 0 ) { foreach ( FileInfo file in files ) { onFinded( new SearchEvent( this, this.writer_, file ) ); } } else { onNotFound( dir_se ); } } onSearchCompleted( new SearchEvent( this, this.writer_, this.current_dir_ ) ); }