Files
Aaru/Aaru.Gui/Models/FileModel.cs

82 lines
2.7 KiB
C#
Raw Normal View History

2020-04-17 21:45:50 +01:00
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : FileModel.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : GUI data models.
//
// --[ Description ] ----------------------------------------------------------
//
// Contains information about files.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General public License for more details.
//
// You should have received a copy of the GNU General public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
2024-12-19 10:45:18 +00:00
// Copyright © 2011-2025 Natalia Portillo
2020-04-17 21:45:50 +01:00
// ****************************************************************************/
using System;
using Aaru.CommonTypes.Structs;
using Avalonia.Media;
2020-07-22 13:20:25 +01:00
using JetBrains.Annotations;
namespace Aaru.Gui.Models;
2022-03-06 13:29:38 +00:00
public sealed class FileModel
{
2022-03-06 13:29:38 +00:00
public string Name { get; set; }
2023-10-03 23:27:57 +01:00
2022-03-06 13:29:38 +00:00
[NotNull]
public string Size => $"{Stat.Length}";
2023-10-03 23:27:57 +01:00
2022-03-06 13:29:38 +00:00
[NotNull]
public string CreationTime => Stat.CreationTime == default(DateTime) ? "" : $"{Stat.CreationTime:G}";
2023-10-03 23:27:57 +01:00
2022-03-06 13:29:38 +00:00
[NotNull]
public string LastAccessTime => Stat.AccessTime == default(DateTime) ? "" : $"{Stat.AccessTime:G}";
2023-10-03 23:27:57 +01:00
2022-03-06 13:29:38 +00:00
[NotNull]
public string ChangedTime => Stat.StatusChangeTime == default(DateTime) ? "" : $"{Stat.StatusChangeTime:G}";
2023-10-03 23:27:57 +01:00
2022-03-06 13:29:38 +00:00
[NotNull]
public string LastBackupTime => Stat.BackupTime == default(DateTime) ? "" : $"{Stat.BackupTime:G}";
2023-10-03 23:27:57 +01:00
2022-03-06 13:29:38 +00:00
[NotNull]
public string LastWriteTime => Stat.LastWriteTime == default(DateTime) ? "" : $"{Stat.LastWriteTime:G}";
2023-10-03 23:27:57 +01:00
2022-03-06 13:29:38 +00:00
[NotNull]
public string Attributes => $"{Stat.Attributes}";
2023-10-03 23:27:57 +01:00
2022-03-06 13:29:38 +00:00
[NotNull]
public string Gid => $"{Stat.GID}";
2023-10-03 23:27:57 +01:00
2022-03-06 13:29:38 +00:00
[NotNull]
public string Uid => $"{Stat.UID}";
2023-10-03 23:27:57 +01:00
2022-03-06 13:29:38 +00:00
[NotNull]
public string Inode => $"{Stat.Inode}";
2023-10-03 23:27:57 +01:00
2022-03-06 13:29:38 +00:00
[NotNull]
public string Links => $"{Stat.Links}";
2023-10-03 23:27:57 +01:00
2022-03-06 13:29:38 +00:00
[NotNull]
public string Mode => $"{Stat.Mode}";
2023-10-03 23:27:57 +01:00
public FileEntryInfo Stat { get; set; }
public IBrush Color { get; set; }
}