コード例 #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_ ) );
        }