Files
crysome/Crysome.Common/Crysome.Common.Model/FileSystemEntry.cs
T
2026-08-27 11:22:54 -06:00

53 lines
1008 B
C#

using System;
namespace Crysome.Common.Model;
public class FileSystemEntry
{
public string Name { get; set; }
public string Path { get; set; }
public long Size { get; set; }
public FileType Type { get; set; }
public long LastWriteUtcTicks { get; set; }
public byte[] IconPng { get; set; }
public DateTime LastWriteUtc
{
get
{
if (LastWriteUtcTicks <= 0)
{
return DateTime.MinValue;
}
return new DateTime(LastWriteUtcTicks, DateTimeKind.Utc);
}
}
public string ModifiedDisplay
{
get
{
if (LastWriteUtcTicks <= 0)
{
return "";
}
return new DateTime(LastWriteUtcTicks, DateTimeKind.Utc).ToLocalTime().ToString("yyyy-MM-dd HH:mm");
}
}
public FileSystemEntry(string name, string path, long size, FileType type, long lastWriteUtcTicks = 0L, byte[] iconPng = null)
{
Name = name;
Path = path;
Size = size;
Type = type;
LastWriteUtcTicks = lastWriteUtcTicks;
IconPng = iconPng;
}
}