Changeset 934


Ignore:
Timestamp:
5/1/2009 12:41:14 AM (5 years ago)
Author:
lowjoel
Message:

-Removed the no longer used Id property and backing variable
-Instead of passing a mask to FolderTarget?.GetFiles?, use the instance member instead

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/Manager/Task.cs

    r929 r934  
    4141        protected Task(SerializationInfo info, StreamingContext context) 
    4242        { 
    43             id = (uint)info.GetValue("ID", typeof(uint)); 
    4443            name = (string)info.GetValue("Name", typeof(string)); 
    4544            targets = (ErasureTargetsCollection)info.GetValue("Targets", typeof(ErasureTargetsCollection)); 
     
    6261        public virtual void GetObjectData(SerializationInfo info, StreamingContext context) 
    6362        { 
    64             info.AddValue("ID", id); 
    6563            info.AddValue("Name", name); 
    6664            info.AddValue("Schedule", schedule); 
     
    8886            Executor.UnqueueTask(this); 
    8987            Canceled = true; 
    90         } 
    91  
    92         /// <summary> 
    93         /// The unique identifier for this task. This ID will be persistent across 
    94         /// executions. 
    95         /// </summary> 
    96         public uint Id 
    97         { 
    98             get { return id; } 
    99             internal set { id = value; } 
    10088        } 
    10189 
     
    258246        #endregion 
    259247 
    260         private uint id; 
    261248        private Executor executor; 
    262249        private bool canceled; 
     
    605592 
    606593            //List recursively all the files which match the include pattern. 
    607             string includeMask = IncludeMask; 
    608             if (includeMask.Length == 0) 
    609                 includeMask = "*"; 
    610             FileInfo[] files = GetFiles(dir, includeMask); 
     594            FileInfo[] files = GetFiles(dir); 
    611595 
    612596            //Then exclude each file and finalize the list and total file size 
     
    645629        /// </summary> 
    646630        /// <param name="info">The directory to look files in.</param> 
    647         /// <param name="includeMask">The include mask all files must match.</param> 
    648         /// <returns>A list of files found in the directory.</returns> 
    649         private FileInfo[] GetFiles(DirectoryInfo info, string includeMask) 
     631        /// <returns>A list of files found in the directory matching the IncludeMask 
     632        /// property.</returns> 
     633        private FileInfo[] GetFiles(DirectoryInfo info) 
    650634        { 
    651635            List<FileInfo> result = new List<FileInfo>(); 
     
    653637                try 
    654638                { 
    655                     result.AddRange(GetFiles(dir, includeMask)); 
     639                    result.AddRange(GetFiles(dir)); 
    656640                } 
    657641                catch (Exception e) 
     
    662646                } 
    663647 
    664             result.AddRange(info.GetFiles(includeMask, SearchOption.TopDirectoryOnly)); 
     648            if (includeMask.Length == 0) 
     649                result.AddRange(info.GetFiles()); 
     650            else 
     651                result.AddRange(info.GetFiles(includeMask, SearchOption.TopDirectoryOnly)); 
    665652            return result.ToArray(); 
    666653        } 
Note: See TracChangeset for help on using the changeset viewer.