port from perforce

This commit is contained in:
2026-04-18 22:31:51 +02:00
commit 8d0ab5b7cc
8409 changed files with 3972376 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
using System;
using DynamicData;
using Intromat.Interfaces;
using Intromat.ViewModels;
namespace Intromat.Actions.Hierarchy
{
public class CreateFileAction : IUndoItem
{
private readonly FileViewModel _file;
private readonly FolderViewModel _parent;
public CreateFileAction(MainViewModel mainVm, FileViewModel file, ModuleViewModel module, FolderViewModel parent)
{
_file = file;
_parent = parent;
File = module;
}
public IFile File { get; }
public void Redo()
{
_parent.Files.Add(_file);
_parent.IsExpanded = true;
_file.IsSelected = true;
}
public void Undo()
{
_parent.Files.Remove(_file);
_parent.IsSelected = true;
}
}
}