/// <summary> /// Compares file to another on name, size, last write time, attributes and hash of the contents. /// </summary> /// <param name="file">Comparison file.</param> /// <returns> <code>true</code> if files are identical, <code>false</code> otherise. </returns> /// <remarks> /// This method does not compare actual file contents but rather it compares the hash values of the contents using SHA1 algorithm. /// </remarks> public override bool IsIdenticalTo(IFileSystemInfo file) { if (file == null) { throw new ArgumentNullException("file", "File is null."); } IFileInfo fileInfo = file as IFileInfo; if (fileInfo == null) { return(false); } if (!base.IsIdenticalTo(file) || Length != fileInfo.Length || this.ComputeSHA1() != fileInfo.ComputeSHA1()) { return(false); } return(true); }