예제 #1
0
 /// <summary>
 /// 
 /// </summary>
 protected virtual void onSearchStart(SearchEvent e)
 {
     if ( !this.current_dir_.Exists ) {
         this.current_dir_.Create();
     }
     if ( searchStart != null ) {
         searchStart( e );
     }
 }
예제 #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="e"></param>
 protected virtual void onSearchCompleted(SearchEvent e)
 {
     if ( searchCompleted != null ) {
         searchCompleted( e );
     }
 }
예제 #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="e"></param>
 protected virtual void onNotFound(SearchEvent e)
 {
     if ( notFound != null ) {
         notFound( e );
     }
 }
예제 #4
0
 protected virtual void onFolderChanging(SearchEvent e)
 {
     if ( folderChanging != null ) {
         folderChanging( e );
     }
 }
예제 #5
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="e"></param>
 protected virtual void onFinded(SearchEvent e)
 {
     if ( finded != null ) {
         finded( e );
     }
 }
예제 #6
0
        /// <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_ ) );
        }