Example #1
0
		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 );
		}
Example #2
0
		void LogMatch( MatchSet.SetType type, MatchPath pattern, string path )
		{
			if( pattern.Debug )
			{
				path += "   (" + pattern.Pattern + ")";
			}
			Log( Status( 0, type, path ) );
		}
Example #3
0
		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 );
		}
Example #4
0
			public FolderInfo( CtrlFolder f, bool isCaseSensitive ) : this( f.Name, f.Path )
			{
				filters = new MatchSet( f.Filters, isCaseSensitive );
			}