mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-26 21:35:10 +00:00
Add Editor.cs
This commit is contained in:
25
PCK-Studio/Internal/Editor.cs
Normal file
25
PCK-Studio/Internal/Editor.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using MetroFramework.Forms;
|
||||
using PckStudio.Interfaces;
|
||||
|
||||
namespace PckStudio.Internal
|
||||
{
|
||||
public abstract class Editor<T> : MetroForm where T : class
|
||||
{
|
||||
protected T EditorValue;
|
||||
private readonly ISaveContext<T> SaveContext;
|
||||
|
||||
protected Editor(T value, ISaveContext<T> saveContext)
|
||||
{
|
||||
_ = value ?? throw new ArgumentNullException(nameof(value));
|
||||
EditorValue = value;
|
||||
SaveContext = saveContext;
|
||||
}
|
||||
|
||||
protected void Save() => SaveContext.Save(EditorValue);
|
||||
}
|
||||
}
|
||||
@@ -164,6 +164,9 @@
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\IModelImportProvider.cs" />
|
||||
<Compile Include="Internal\App\Updater.cs" />
|
||||
<Compile Include="Internal\Editor.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Internal\GameModelInfo.cs" />
|
||||
<Compile Include="Internal\IO\PSM\PSMFileReader.cs" />
|
||||
<Compile Include="Internal\IO\PSM\PSMFileWriter.cs" />
|
||||
|
||||
Reference in New Issue
Block a user