예제 #1
0
 public static bool ReadonlyDenied(FileIndexItem statusModel,
                                   FileIndexItem.ExifStatus statusResults, List <FileIndexItem> fileIndexResultsList)
 {
     switch (statusResults)
     {
     case FileIndexItem.ExifStatus.ReadOnly:
         statusModel.Status = FileIndexItem.ExifStatus.ReadOnly;
         fileIndexResultsList.Add(statusModel);
         return(true);
     }
     return(false);
 }
예제 #2
0
        public static void ReadonlyAllowed(FileIndexItem statusModel,
                                           FileIndexItem.ExifStatus statusResults, List <FileIndexItem> fileIndexResultsList)
        {
            // Readonly is allowed
            if (statusResults != FileIndexItem.ExifStatus.ReadOnly)
            {
                return;
            }

            statusModel.Status = FileIndexItem.ExifStatus.ReadOnly;
            fileIndexResultsList.Add(statusModel);
        }
예제 #3
0
 internal FileIndexItem AddDeleteStatus(FileIndexItem dbItem,
                                        FileIndexItem.ExifStatus exifStatus = FileIndexItem.ExifStatus.Deleted)
 {
     if (dbItem == null)
     {
         return(null);
     }
     if (dbItem.Tags.Contains("!delete!"))
     {
         dbItem.Status = exifStatus;
     }
     return(dbItem);
 }
예제 #4
0
        /// <summary>
        /// Does deside if the loop should be stopped, true = stop
        /// Uses FileCollectionsCheck
        /// Add for all types exept for OK/Readonly!
        /// </summary>
        /// <param name="statusModel">the main object to return later</param>
        /// <param name="statusResults">the status by FileCollectionsCheck</param>
        /// <param name="fileIndexResultsList">list of object that will be returned</param>
        /// <returns>If true skip the next code</returns>
        public static bool ReturnExifStatusError(FileIndexItem statusModel,
                                                 FileIndexItem.ExifStatus statusResults, List <FileIndexItem> fileIndexResultsList)
        {
            switch (statusResults)
            {
            case FileIndexItem.ExifStatus.DirReadOnly:
                statusModel.IsDirectory = true;
                statusModel.Status      = FileIndexItem.ExifStatus.DirReadOnly;
                fileIndexResultsList.Add(statusModel);
                return(true);

            case FileIndexItem.ExifStatus.NotFoundNotInIndex:
                statusModel.Status = FileIndexItem.ExifStatus.NotFoundNotInIndex;
                fileIndexResultsList.Add(statusModel);
                return(true);

            case FileIndexItem.ExifStatus.NotFoundSourceMissing:
                statusModel.Status = FileIndexItem.ExifStatus.NotFoundSourceMissing;
                fileIndexResultsList.Add(statusModel);
                return(true);

            case FileIndexItem.ExifStatus.ReadOnly:
                statusModel.Status = FileIndexItem.ExifStatus.ReadOnly;
                fileIndexResultsList.Add(statusModel);
                return(true);

            case FileIndexItem.ExifStatus.OperationNotSupported:
                statusModel.Status = FileIndexItem.ExifStatus.OperationNotSupported;
                fileIndexResultsList.Add(statusModel);
                return(true);

            case FileIndexItem.ExifStatus.ExifWriteNotSupported:
                statusModel.Status = FileIndexItem.ExifStatus.ExifWriteNotSupported;
                fileIndexResultsList.Add(statusModel);
                return(true);
            }
            return(false);
        }