示例#1
0
文件: Ctrl.cs 项目: cccapon/KeepBack
 public static void MoveLogFiles( KeepBack.Ctrl ctrl )
 {
     try
     {
         string src = ctrl.Path;
         string dst = ctrl.CreateLogFolder();
         foreach( string x in KeepBack.Ctrl.ListFiles( src ) )
         {
             if( (Path.GetExtension( x ).ToLower() == ".log") && KeepBack.Ctrl.IsDateFolder( x ) )
             {
                 File.Move( Path.Combine( src, x ), Path.Combine( dst, x ) );
             }
         }
     }
     catch( Exception )
     {
     }
 }
示例#2
0
 //--- method ----------------------------
 public void Upgrade( KeepBack.CtrlFilter filter, KeepBack.CtrlFilter.ActionType action )
 {
     filter.Action  = action;
     filter.Pattern = Pattern;
 }
示例#3
0
 //--- method ----------------------------
 public void Upgrade( KeepBack.CtrlArchive archive )
 {
     archive.Month   = Month;
     archive.Day     = Day;
     archive.Hour    = Hour;
     archive.Minute  = Minute;
     foreach( CtrlFolder f in folders )
     {
         f.Upgrade( archive.FolderAdd() );
     }
 }
示例#4
0
 //--- method ----------------------------
 public void Upgrade( KeepBack.CtrlFolder folder )
 {
     folder.Name    = Name;
     folder.Path    = Path;
     if( exclude != null )
     {
         foreach( CtrlPattern p in exclude )
         {
             p.Upgrade( folder.FilterAdd(), KeepBack.CtrlFilter.ActionType.Exclude );
         }
     }
     if( include != null )
     {
         foreach( CtrlPattern p in include )
         {
             p.Upgrade( folder.FilterAdd(), KeepBack.CtrlFilter.ActionType.Include );
         }
     }
     if( history != null )
     {
         foreach( CtrlPattern p in history )
         {
             p.Upgrade( folder.FilterAdd(), KeepBack.CtrlFilter.ActionType.History );
         }
     }
 }