100 lines
1.8 KiB
C#
100 lines
1.8 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Collections.ObjectModel;
|
|||
|
using System.ComponentModel;
|
|||
|
using System.Linq;
|
|||
|
using System.Runtime.CompilerServices;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace RustTools.Editor;
|
|||
|
public class FileItem
|
|||
|
{
|
|||
|
public string Name
|
|||
|
{
|
|||
|
get; set;
|
|||
|
}
|
|||
|
public string Dir
|
|||
|
{
|
|||
|
get; set;
|
|||
|
}
|
|||
|
public bool IsFolder
|
|||
|
{
|
|||
|
get; set;
|
|||
|
}
|
|||
|
public bool IsExpanded
|
|||
|
{
|
|||
|
get; set;
|
|||
|
} = false; // 用来控制展开状态
|
|||
|
public ObservableCollection<FileItem> Children
|
|||
|
{
|
|||
|
get; set;
|
|||
|
}
|
|||
|
|
|||
|
public FileItem()
|
|||
|
{
|
|||
|
}
|
|||
|
public FileItem(bool isFolder)
|
|||
|
{
|
|||
|
IsFolder = isFolder;
|
|||
|
if (isFolder)
|
|||
|
{
|
|||
|
Children = new ObservableCollection<FileItem>();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//public class FileItem : INotifyPropertyChanged
|
|||
|
//{
|
|||
|
// private string _name;
|
|||
|
|
|||
|
// public string Name
|
|||
|
// {
|
|||
|
// get => _name;
|
|||
|
// set
|
|||
|
// {
|
|||
|
// _name = value;
|
|||
|
// OnPropertyChanged();
|
|||
|
// }
|
|||
|
// }
|
|||
|
|
|||
|
// public string Dir
|
|||
|
// {
|
|||
|
// get; set;
|
|||
|
// }
|
|||
|
// public bool IsFolder
|
|||
|
// {
|
|||
|
// get; set;
|
|||
|
// }
|
|||
|
// public ObservableCollection<FileItem> Children
|
|||
|
// {
|
|||
|
// get; set;
|
|||
|
// }
|
|||
|
|
|||
|
// public bool IsExpanded
|
|||
|
// {
|
|||
|
// get; set;
|
|||
|
// } = false; // 用来控制展开状态
|
|||
|
// public event PropertyChangedEventHandler PropertyChanged;
|
|||
|
|
|||
|
// public FileItem()
|
|||
|
// {
|
|||
|
// }
|
|||
|
// public FileItem(bool isFolder)
|
|||
|
// {
|
|||
|
// IsFolder = isFolder;
|
|||
|
// if (isFolder)
|
|||
|
// {
|
|||
|
// Children = new ObservableCollection<FileItem>();
|
|||
|
// }
|
|||
|
// }
|
|||
|
|
|||
|
// protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
|||
|
// {
|
|||
|
// PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|||
|
// }
|
|||
|
|
|||
|
|
|||
|
//}
|
|||
|
|