Files
Aaru/Aaru.Gui/ViewModels/Panels/FileSystemViewModel.cs

95 lines
4.8 KiB
C#
Raw Normal View History

2020-04-17 21:45:50 +01:00
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : FileSystemViewModel.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : GUI view models.
//
// --[ Description ] ----------------------------------------------------------
//
// View model and code for the filesystem information panel.
//
// --[ 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 Aaru.CommonTypes.AaruMetadata;
2020-07-22 13:20:25 +01:00
using JetBrains.Annotations;
namespace Aaru.Gui.ViewModels.Panels;
2023-10-04 08:29:56 +01:00
public sealed class FileSystemViewModel([NotNull] FileSystem metadata, string information)
{
2023-10-04 08:29:56 +01:00
public string TypeText { get; } = string.Format(Localization.Core.Filesystem_type_0, metadata.Type);
public string VolumeNameText { get; } = string.Format(Localization.Core.Volume_name_0, metadata.VolumeName);
public string SerialNumberText { get; } = string.Format(Localization.Core.Volume_serial_0, metadata.VolumeSerial);
2023-10-04 08:29:56 +01:00
public string ApplicationIdentifierText { get; } =
string.Format(Localization.Core.Application_identifier_0, metadata.ApplicationIdentifier);
2023-10-04 08:29:56 +01:00
public string SystemIdentifierText { get; } =
string.Format(Localization.Core.System_identifier_0, metadata.SystemIdentifier);
2023-10-04 08:29:56 +01:00
public string VolumeSetIdentifierText { get; } =
string.Format(Localization.Core.Volume_set_identifier_0, metadata.VolumeSetIdentifier);
2023-10-04 08:29:56 +01:00
public string DataPreparerIdentifierText { get; } =
string.Format(Localization.Core.Data_preparer_identifier_0, metadata.DataPreparerIdentifier);
2023-10-04 08:29:56 +01:00
public string PublisherIdentifierText { get; } =
string.Format(Localization.Core.Publisher_identifier_0, metadata.PublisherIdentifier);
2023-10-04 08:29:56 +01:00
public string CreationDateText { get; } =
string.Format(Localization.Core.Volume_created_on_0, metadata.CreationDate);
2023-10-04 08:29:56 +01:00
public string EffectiveDateText { get; } =
string.Format(Localization.Core.Volume_effective_from_0, metadata.EffectiveDate);
2023-10-04 08:29:56 +01:00
public string ModificationDateText { get; } =
string.Format(Localization.Core.Volume_last_modified_on_0, metadata.ModificationDate);
2023-10-04 08:29:56 +01:00
public string ExpirationDateText { get; } =
string.Format(Localization.Core.Volume_expired_on_0, metadata.ExpirationDate);
2022-03-06 13:29:38 +00:00
2023-10-04 08:29:56 +01:00
public string BackupDateText { get; } =
string.Format(Localization.Core.Volume_last_backed_up_on_0, metadata.BackupDate);
public string ClustersText { get; } =
2024-05-01 04:05:22 +01:00
string.Format(Localization.Core.Volume_has_0_clusters_of_1_bytes_each_total_of_2_bytes,
metadata.Clusters,
metadata.ClusterSize,
metadata.Clusters * metadata.ClusterSize);
2023-10-04 08:29:56 +01:00
public string FreeClustersText { get; } = string.Format(Localization.Core.Volume_has_0_clusters_free_1,
metadata.FreeClusters,
metadata.FreeClusters / metadata.Clusters);
2023-10-04 08:29:56 +01:00
public string FilesText { get; } = string.Format(Localization.Core.Volume_contains_0_files, metadata.Files);
public bool BootableChecked { get; } = metadata.Bootable;
public bool DirtyChecked { get; } = metadata.Dirty;
public string InformationText { get; } = information;
public bool CreationDateVisible { get; } = metadata.CreationDate != null;
public bool EffectiveDateVisible { get; } = metadata.EffectiveDate != null;
public bool ModificationDateVisible { get; } = metadata.ModificationDate != null;
public bool ExpirationDateVisible { get; } = metadata.ExpirationDate != null;
public bool BackupDateVisible { get; } = metadata.BackupDate != null;
public bool FreeClustersVisible { get; } = metadata.FreeClusters != null;
public bool FilesVisible { get; } = metadata.Files != null;
}