You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.0 KiB
C#

using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace CommanderApp;
public class FileSystemItem : INotifyPropertyChanged
{
public string Name { get; set; } = string.Empty;
public string FullName { get; set; } = string.Empty;
public bool IsDirectory { get; set; }
public string DisplayText
{
get
{
if (string.IsNullOrWhiteSpace(Name))
return "[No Name]";
if (Name == "..")
return "⬆️ ..";
return IsDirectory ? $"📁 {Name}" : $"📄 {Name}";
}
}
private bool _isSelected;
public bool IsSelected
{
get => _isSelected;
set
{
_isSelected = value;
OnPropertyChanged();
}
}
public event PropertyChangedEventHandler? PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}