Example #1
0
 public FolderPattern( CtrlFolder folder, CtrlFilter filter )
 {
     this.folder  = folder;
     this.filter  = filter;
 }
Example #2
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 #3
0
 //--- method ----------------------------
 public CtrlFolder FolderAdd()
 {
     CtrlFolder f = new CtrlFolder();
     List<CtrlFolder> list = (folders == null) ? new List<CtrlFolder>() : new List<CtrlFolder>( folders );
     list.Add( f );
     folders = list.ToArray();
     return f;
 }
Example #4
0
 public void FolderDelete( CtrlFolder folder )
 {
     if( folders != null )
     {
         List<CtrlFolder> list = new List<CtrlFolder>( folders );
         list.Remove( folder );
         folders = (list.Count > 0) ? list.ToArray() : null;
     }
 }
Example #5
0
			public FolderInfo( CtrlFolder f, bool isCaseSensitive ) : this( f.Name, f.Path )
			{
				filters = new MatchSet( f.Filters, isCaseSensitive );
			}
Example #6
0
		void Scan( CtrlFolder folder )
		{
			try
			{
				FolderInfo	f = new FolderInfo( folder, ctrl.IsCaseSensitive );
				Log( string.Empty );
				Msg( "Folder: {0} : {1}", f.Name, f.Root );
				if( string.IsNullOrEmpty( f.Name ) )
				{
					throw new Exception( "Folder name is empty." );
				}
				if( f.Name.IndexOfAny( InvalidFilenameCharacters ) >= 0 )
				{
					throw new Exception( "Folder name contains invalid characters." );
				}
				if( string.IsNullOrEmpty( f.Root ) )
				{
					throw new Exception( "Folder path is empty." );
				}
				if( f.Root.IndexOfAny( InvalidPathCharacters ) >= 0 )
				{
					throw new Exception( "Folder path contains invalid characters." );
				}
				ScanFolder( f, string.Empty );
			}
			catch( Exception ex )
			{
				ex.Data[ExArchiveRoot]    = ctrl.Path;
				ex.Data[ExCurrentRoot]    = current;
				ex.Data[ExHistoryRoot]    = history;
				ex.Data[ExFolderName]     = folder.Name;
				ex.Data[ExFolderRoot]     = folder.Path;
				throw;
			}
		}