Esempio n. 1
0
        /// <summary>
        /// Compare two SledFileSystemFileStats classes and find
        /// out what's different between the two
        /// </summary>
        /// <param name="stat1">SledFileSystemFileStats to compare</param>
        /// <param name="stat2">SledFileSystemFileStats to compare</param>
        /// <returns>SledFileSystemFileStatsChange describing differences</returns>
        public static SledFileSystemFileStatsChange Compare(SledFileSystemFileStats stat1, SledFileSystemFileStats stat2)
        {
            // If either is invalid then ignore
            if (!stat1.Valid || !stat2.Valid)
                return SledFileSystemFileStatsChange.Nothing;

            // Check LastWrite and if it differs check attributes
            return
                !stat1.LastWrite.Equals(stat2.LastWrite)
                    ? SledFileSystemFileStatsChange.LastWrite
                    : CompareAttributes(stat1.Attributes, stat2.Attributes);
        }
Esempio n. 2
0
        /// <summary>
        /// Compare two SledFileSystemFileStats classes and find
        /// out what's different between the two
        /// </summary>
        /// <param name="stat1">SledFileSystemFileStats to compare</param>
        /// <param name="stat2">SledFileSystemFileStats to compare</param>
        /// <returns>SledFileSystemFileStatsChange describing differences</returns>
        public static SledFileSystemFileStatsChange Compare(SledFileSystemFileStats stat1, SledFileSystemFileStats stat2)
        {
            // If either is invalid then ignore
            if (!stat1.Valid || !stat2.Valid)
            {
                return(SledFileSystemFileStatsChange.Nothing);
            }

            // Check LastWrite and if it differs check attributes
            return
                (!stat1.LastWrite.Equals(stat2.LastWrite)
                    ? SledFileSystemFileStatsChange.LastWrite
                    : CompareAttributes(stat1.Attributes, stat2.Attributes));
        }