Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,12 @@ public class FileOrFolderInformation
[DataMember(Name = "FileSize")]
public long SizeInBytes { get; private set; }

/// <summary>
/// Gets whether the current item is a folder by checking for FILE_ATTRIBUTE_DIRECTORY
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/gg258117(v=vs.85).aspx
/// </summary>
public bool IsFolder { get { return (this.Type & 0x10) == 0x10; } }

/// <summary>
/// Overridden ToString method providing a user readable
/// display of a file or folder. Tries to match the formatting
Expand All @@ -321,7 +327,7 @@ public override string ToString()
DateTime timestamp = DateTime.FromFileTime(this.DateCreated);

// Check if this is a folder.
if (!string.Equals(this.SubPath, this.CurrentDir))
if (this.IsFolder)
{
return string.Format("{0,-24:MM/dd/yyyy HH:mm tt}{1,-14} {2}\n", timestamp, "<DIR>", this.Name);
}
Expand Down