Exemplo n.º 1
0
 public FileStatus DirectoryDifference(FileMetadata other)
 {
     if (!(Attributes == other.Attributes && DateAccessedUTC.Equals(other.DateAccessedUTC) &&
           DateModifiedUTC.Equals(other.DateModifiedUTC) && DateCreatedUTC.Equals(other.DateCreatedUTC)))
     {
         return(FileStatus.MetadataChange);
     }
     return(FileStatus.Unchanged);
 }
Exemplo n.º 2
0
        /*
         * public FileStatus FileDifference(FileMetadata other)
         * {
         *  if (FileSize != other.FileSize)
         *  {
         *      return FileStatus.DataModified;
         *  }
         *  if (!(Attributes == other.Attributes && DateAccessedUTC.Equals(other.DateAccessedUTC) &&
         *      DateModifiedUTC.Equals(other.DateModifiedUTC) && DateCreatedUTC.Equals(other.DateCreatedUTC)))
         *  {
         *      return FileStatus.MetadataChange;
         *  }
         *  return FileStatus.Unchanged;
         * }*/

        public bool FileDifference(FileMetadata other)
        {
            bool[] test = { Attributes == other.Attributes,                DateAccessedUTC.Equals(other.DateAccessedUTC),
                            DateModifiedUTC.Equals(other.DateModifiedUTC), DateCreatedUTC.Equals(other.DateCreatedUTC),
                            FileSize == other.FileSize };

            return(!(Attributes == other.Attributes && DateAccessedUTC.Equals(other.DateAccessedUTC) &&
                     DateModifiedUTC.Equals(other.DateModifiedUTC) && DateCreatedUTC.Equals(other.DateCreatedUTC) &&
                     FileSize == other.FileSize));
        }