2019-11-17 15:22:19 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
using Avalonia;
|
2019-11-14 18:08:21 +00:00
|
|
|
|
using Avalonia.Collections;
|
|
|
|
|
using Avalonia.Controls;
|
|
|
|
|
|
|
|
|
|
using BFR.DataModels;
|
2019-11-16 01:47:07 +00:00
|
|
|
|
using BFR.Operations;
|
2019-11-13 22:01:08 +00:00
|
|
|
|
|
|
|
|
|
namespace BFR
|
|
|
|
|
{
|
|
|
|
|
public partial class MainWindow : Window
|
|
|
|
|
{
|
2019-11-21 18:07:46 +00:00
|
|
|
|
public static readonly AvaloniaProperty<string> WorkingDirectoryProperty =
|
2019-11-14 18:08:21 +00:00
|
|
|
|
AvaloniaProperty.Register<MainWindow, string>(nameof(WorkingDirectory));
|
2019-11-21 18:07:46 +00:00
|
|
|
|
public string WorkingDirectory { get => GetValue(WorkingDirectoryProperty); set => SetValue(WorkingDirectoryProperty, value); }
|
2019-11-14 18:08:21 +00:00
|
|
|
|
|
|
|
|
|
public AvaloniaList<FileModel> AllFiles { get; } = new AvaloniaList<FileModel>();
|
|
|
|
|
public AvaloniaList<FileModel> Files { get; } = new AvaloniaList<FileModel>();
|
2019-11-16 01:47:07 +00:00
|
|
|
|
public AvaloniaList<Operation> Operations { get; } = new AvaloniaList<Operation>();
|
2019-11-17 01:22:13 +00:00
|
|
|
|
public int SelectedOperation { get; set; }
|
|
|
|
|
|
|
|
|
|
public int SelectedOperationType { get; set; } = 0;
|
|
|
|
|
public OperationType[] OperationTypes { get; } = new[]
|
|
|
|
|
{
|
2019-11-17 15:22:19 +00:00
|
|
|
|
OperationType.Make<Overwrite>(),
|
2019-11-17 15:27:40 +00:00
|
|
|
|
OperationType.Make<Replace>(),
|
|
|
|
|
OperationType.Make<Remove>(),
|
2019-11-17 01:22:13 +00:00
|
|
|
|
};
|
2019-11-14 19:42:25 +00:00
|
|
|
|
|
2019-11-21 18:07:46 +00:00
|
|
|
|
public static readonly AvaloniaProperty<bool> IsCommitButtonEnabledProperty =
|
2019-11-17 01:41:05 +00:00
|
|
|
|
AvaloniaProperty.Register<MainWindow, bool>("IsCommitButtonEnabled", defaultValue: false);
|
2019-11-21 18:07:46 +00:00
|
|
|
|
public bool IsCommitButtonEnabled { get => GetValue(IsCommitButtonEnabledProperty); set => SetValue(IsCommitButtonEnabledProperty, value); }
|
|
|
|
|
public static readonly AvaloniaProperty<int> UndoCountProperty =
|
2019-11-17 01:41:05 +00:00
|
|
|
|
AvaloniaProperty.Register<MainWindow, int>("UndoCount", defaultValue: 0);
|
2019-11-21 18:07:46 +00:00
|
|
|
|
public int UndoCount { get => GetValue(UndoCountProperty); set => SetValue(UndoCountProperty, value); }
|
2019-11-17 01:41:05 +00:00
|
|
|
|
private readonly Stack<List<FileModel>> UndoStack = new Stack<List<FileModel>>();
|
|
|
|
|
|
2019-11-14 19:42:25 +00:00
|
|
|
|
// Filters
|
|
|
|
|
public string FilterExtension { get; set; } = "";
|
|
|
|
|
public string FilterPattern { get; set; } = "";
|
|
|
|
|
public bool FilterFullName { get; set; } = false;
|
|
|
|
|
public bool FilterRegex { get; set; } = false;
|
2019-11-13 22:01:08 +00:00
|
|
|
|
}
|
|
|
|
|
}
|