Esempio n. 1
0
        /* Function: Copy
         * Copies the passed status to this one.
         */
        public void Copy(AdderStatus other)
        {
            // We'll take a temporary copy of the other status so we never hold two locks at the same time.

            int otherSourceFilesFound, otherSourceFoldersFound;
            int otherImageFilesFound, otherImageFoldersFound;
            int otherStyleFilesFound, otherStyleFoldersFound;

            lock (other.accessLock)
            {
                otherSourceFilesFound   = other.sourceFilesFound;
                otherSourceFoldersFound = other.sourceFoldersFound;

                otherImageFilesFound   = other.imageFilesFound;
                otherImageFoldersFound = other.imageFoldersFound;

                otherStyleFilesFound   = other.styleFilesFound;
                otherStyleFoldersFound = other.styleFoldersFound;
            }

            lock (accessLock)
            {
                sourceFilesFound   = otherSourceFilesFound;
                sourceFoldersFound = otherSourceFoldersFound;

                imageFilesFound   = otherImageFilesFound;
                imageFoldersFound = otherImageFoldersFound;

                styleFilesFound   = otherStyleFilesFound;
                styleFoldersFound = otherStyleFoldersFound;
            }
        }
Esempio n. 2
0
        /* Function: GetStatus
         * Fills the passed object with the status of <WorkOnAddingAllFiles()>.
         */
        public void GetStatus(ref AdderStatus status)
        {
            status.Reset();

            for (int i = 0; i < fileSourceAdders.Length; i++)
            {
                if (fileSourceAdders[i] != null)
                {
                    fileSourceAdders[i].AddStatusTo(ref status);
                }
            }
        }
Esempio n. 3
0
 /* Function: AddStatusTo
  * Adds the status of <AddAllFiles()> to the passed one.
  */
 public void AddStatusTo(ref AdderStatus statusTarget)
 {
     statusTarget.Add(status);
 }
Esempio n. 4
0
 /* Function: GetStatus
  * Fills the passed object with the status of <AddAllFiles()>.
  */
 public void GetStatus(ref AdderStatus statusTarget)
 {
     statusTarget.Copy(status);
 }