Example #1
0
        // Group: Functions
        // __________________________________________________________________________


        /* Function: FileSource
         */
        public FileSource(Files.Manager manager)
        {
            this.manager = manager;

            addAllFilesStatus = new AddAllFilesStatus();
            claimed           = false;
        }
Example #2
0
        /* Function: CopyFrom
         * Copies all the variables from the passed one.
         */
        public void CopyFrom(AddAllFilesStatus other)
        {
            Completed = other.Completed;

            SourceFilesFound   = other.SourceFilesFound;
            SourceFoldersFound = other.SourceFoldersFound;
        }
Example #3
0
        /* 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;
        }
Example #4
0
        /* 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);
                }
            }
        }
Example #5
0
 /* Function: CombineAddAllFilesStatus
  * Adds the current status numbers to the passed object.
  */
 public void CombineAddAllFilesStatus(ref AddAllFilesStatus statusTarget)
 {
     statusTarget.Add(addAllFilesStatus);
 }
Example #6
0
 /* 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);
 }