void Backup( CtrlFolder folder ) { if( string.IsNullOrEmpty( folder.Name ) || string.IsNullOrEmpty( folder.Path ) ) { LogInfo( " incomplete folder definition" ); return; } this.curr = PathCombine( current, folder.Name ); this.hist = (history == null) ? null : PathCombine( history, folder.Name ); this.fold = folder.Path; MatchSet.MatchDelegate md = new MatchSet.MatchDelegate( LogMatch ); this.inc = new MatchSet( MatchSet.SetType.Include, folder.Include, md ); this.exc = new MatchSet( MatchSet.SetType.Exclude, folder.Exclude, md ); this.his = new MatchSet( MatchSet.SetType.History, folder.History, md ); BackupCompareFolder( "", false, true ); }
void LogMatch( MatchSet.SetType type, MatchPath pattern, string path ) { if( pattern.Debug ) { path += " (" + pattern.Pattern + ")"; } Log( Status( 0, type, path ) ); }
string Status( Reason reason, MatchSet.SetType type, string filename ) { StringBuilder sb = new StringBuilder(); sb.Append( " " ); for( int i = 0; i < ReasonValues.Length; ++i ) { Reason r = (Reason)ReasonValues.GetValue( i ); sb.Append( (reason == r) ? ReasonNames[i][0] : BLANK ); } sb.Append( " " ); for( int i = 0; i < MatchValues.Length; ++i ) { MatchSet.SetType t = (MatchSet.SetType)MatchValues.GetValue( i ); sb.Append( (type == t) ? MatchNames[i][0] : BLANK ); } return Status( sb.ToString(), filename ); }
public FolderInfo( CtrlFolder f, bool isCaseSensitive ) : this( f.Name, f.Path ) { filters = new MatchSet( f.Filters, isCaseSensitive ); }