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