/// <summary> /// Creates a new instance of FileData. /// </summary> /// <param name="fullFilePath">The full path of the file name.</param> public FileData(string fullFilePath) { FullFilePath = fullFilePath; ListingType = ListingTypeOption.File; var fileInfo = new FileInfo(FullFilePath); Name = fileInfo.Name; Size = new FileSize(fileInfo.Length); Created = fileInfo.CreationTimeUtc; Modified = fileInfo.LastAccessTimeUtc; Directory = fileInfo.DirectoryName; Extension = fileInfo.Extension; }
/// <summary> /// Compare an object to see if they are equal. Used for test plans. /// </summary> /// <param name="compareFileSize">Parse in an instance of FileSize to see if it equals this instance.</param> /// <returns>True if the File Size property matches. False if not.</returns> public bool IsEqual(FileSize compareFileSize) { return(this.Bytes == compareFileSize.Bytes && this.Kilobytes == compareFileSize.Kilobytes && this.Megabytes == compareFileSize.Megabytes && this.Gigabytes == compareFileSize.Gigabytes && this.Terabytes == compareFileSize.Terabytes); }