diff --git a/PCK-Studio/Internal/Editor.cs b/PCK-Studio/Internal/Editor.cs new file mode 100644 index 00000000..aeff9c97 --- /dev/null +++ b/PCK-Studio/Internal/Editor.cs @@ -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 : MetroForm where T : class + { + protected T EditorValue; + private readonly ISaveContext SaveContext; + + protected Editor(T value, ISaveContext saveContext) + { + _ = value ?? throw new ArgumentNullException(nameof(value)); + EditorValue = value; + SaveContext = saveContext; + } + + protected void Save() => SaveContext.Save(EditorValue); + } +} \ No newline at end of file diff --git a/PCK-Studio/PckStudio.csproj b/PCK-Studio/PckStudio.csproj index fdd1122d..8002273e 100644 --- a/PCK-Studio/PckStudio.csproj +++ b/PCK-Studio/PckStudio.csproj @@ -164,6 +164,9 @@ + + Form +