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,34 @@
using System.IO;
using Intromat.Interfaces;
using Intromat.ViewModels;
namespace Intromat.Actions.Hierarchy
{
public class CreateModuleAction : IUndoItem
{
private readonly ModuleViewModel _module;
private readonly ProjectViewModel _parent;
public CreateModuleAction(string name, ProjectViewModel parent)
{
var modulePath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(parent.FullPath)!, name, $"{name}.imodule"));
_module = new ModuleViewModel(parent, name, modulePath);
File = _parent = parent;
}
public IFile File { get; }
public void Redo()
{
_parent.Modules.Add(_module);
_parent.IsExpanded = true;
_module.IsSelected = true;
}
public void Undo()
{
_parent.Modules.Remove(_module);
_parent.IsSelected = true;
}
}
}