// Group: Functions // __________________________________________________________________________ /* Function: FileSource */ public FileSource(Files.Manager manager) { this.manager = manager; addAllFilesStatus = new AddAllFilesStatus(); claimed = false; }
/* Function: CopyFrom * Copies all the variables from the passed one. */ public void CopyFrom(AddAllFilesStatus other) { Completed = other.Completed; SourceFilesFound = other.SourceFilesFound; SourceFoldersFound = other.SourceFoldersFound; }
/* Function: Add * Adds the statistics of the passed status to this one. */ public void Add(AddAllFilesStatus other) { if (other.Completed == false) { Completed = false; } SourceFilesFound += other.SourceFilesFound; SourceFoldersFound += other.SourceFoldersFound; }
/* Function: GetAddAllFilesStatus * Fills the passed object with the status of <WorkOnAddingAllFiles()>. The object will be a snapshot of the values, not * a live monitor, so the values will not change out from under you. */ public void GetAddAllFilesStatus(ref AddAllFilesStatus statusTarget) { statusTarget.Reset(); lock (accessLock) { for (int i = 0; i < fileSources.Count; i++) { fileSources[i].CombineAddAllFilesStatus(ref statusTarget); } } }
/* Function: CombineAddAllFilesStatus * Adds the current status numbers to the passed object. */ public void CombineAddAllFilesStatus(ref AddAllFilesStatus statusTarget) { statusTarget.Add(addAllFilesStatus); }
/* Function: GetAddAllFilesStatus * Fills the passed object with the current status of <AddAllFiles()>. The passed object will contain a snapshot of the status, * not a continuously updating object, so the values won't change out from under you. */ public void GetAddAllFilesStatus(ref AddAllFilesStatus statusTarget) { statusTarget.CopyFrom(addAllFilesStatus); }