diff --git a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/AppFileExplorer.cs b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/AppFileExplorer.cs
index 0b155fc9..e4b31f3e 100644
--- a/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/AppFileExplorer.cs
+++ b/WindowsDevicePortalWrapper/WindowsDevicePortalWrapper.Shared/Core/AppFileExplorer.cs
@@ -310,6 +310,12 @@ public class FileOrFolderInformation
[DataMember(Name = "FileSize")]
public long SizeInBytes { get; private set; }
+ ///
+ /// 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
+ ///
+ public bool IsFolder { get { return (this.Type & 0x10) == 0x10; } }
+
///
/// Overridden ToString method providing a user readable
/// display of a file or folder. Tries to match the formatting
@@ -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, "", this.Name);
}