mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07:00
33 lines
848 B
C#
33 lines
848 B
C#
|
using System.Collections.Generic;
|
||
|
using System.IO;
|
||
|
|
||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||
|
|
||
|
namespace SourceGit.ViewModels
|
||
|
{
|
||
|
public class RevisionFileTreeNode : ObservableObject
|
||
|
{
|
||
|
public Models.Object Backend { get; set; } = null;
|
||
|
public int Depth { get; set; } = 0;
|
||
|
public List<RevisionFileTreeNode> Children { get; set; } = new List<RevisionFileTreeNode>();
|
||
|
|
||
|
public string Name
|
||
|
{
|
||
|
get => Backend == null ? string.Empty : Path.GetFileName(Backend.Path);
|
||
|
}
|
||
|
|
||
|
public bool IsFolder
|
||
|
{
|
||
|
get => Backend != null && Backend.Type == Models.ObjectType.Tree;
|
||
|
}
|
||
|
|
||
|
public bool IsExpanded
|
||
|
{
|
||
|
get => _isExpanded;
|
||
|
set => SetProperty(ref _isExpanded, value);
|
||
|
}
|
||
|
|
||
|
private bool _isExpanded = false;
|
||
|
}
|
||
|
}
|