Files
GsaViewer/GsaEditor/ViewModels/EntryTreeNodeViewModel.cs
ItsTheSky d6d621dc92 Add project restore files and NuGet cache for GsaViewer
- Created project.nuget.cache to store NuGet package cache information.
- Added project.packagespec.json to define project restore settings and dependencies.
- Included rider.project.restore.info for Rider IDE integration.
2026-04-09 16:56:58 +02:00

41 lines
1.2 KiB
C#

using System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.ComponentModel;
using GsaEditor.Core.Models;
namespace GsaEditor.ViewModels;
/// <summary>
/// Represents a node in the archive tree view.
/// Can be a folder (with children) or a leaf file node (with an associated <see cref="GsaEntry"/>).
/// </summary>
public partial class EntryTreeNodeViewModel : ViewModelBase
{
[ObservableProperty]
private string _name = string.Empty;
/// <summary>
/// Full relative path of this node within the archive (using '/' separator).
/// </summary>
public string FullPath { get; set; } = string.Empty;
/// <summary>
/// Whether this node represents a folder (true) or a file (false).
/// </summary>
public bool IsFolder { get; set; }
/// <summary>
/// Whether this node represents a file.
/// </summary>
public bool IsFile => !IsFolder;
/// <summary>
/// The archive entry this node represents. Null for folder nodes.
/// </summary>
public GsaEntry? Entry { get; set; }
/// <summary>
/// Child nodes (sub-folders and files within this folder).
/// </summary>
public ObservableCollection<EntryTreeNodeViewModel> Children { get; } = new();
}