finally more structure

This commit is contained in:
2024-05-20 18:50:10 +02:00
parent 7becf9b4ea
commit fb0898fad1
22 changed files with 279 additions and 106 deletions

View File

@@ -1,10 +1,14 @@
using System.Windows.Forms;
using OwnChar.Manager;
using System.Windows.Forms;
namespace OwnChar.App.Desktop.Api
{
public interface IMainWindowApi
{
void OpenTab(Control content);
OwnCharManager? Manager { get; }
void OpenTab(Control content, string title);
void CloseTab(Control content);
bool IsTabOpen(Control content);
bool IsTabOpen<T>();
}
}

View File

@@ -1,4 +1,5 @@
using System;
using Pilz.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -8,7 +9,7 @@ namespace OwnChar.App.Desktop.Api
{
public interface IOwnCharApi
{
public static IOwnCharApi Instance { get; } = new AppApi();
public IMainWindowApi? MainWindow { get; internal set; }
public abstract IMainWindowApi? MainWindow { get; }
public abstract ISettings? Settings { get; }
}
}

View File

@@ -0,0 +1,14 @@
using OwnChar.Plugins;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OwnChar.App.Desktop.Api.Parameters
{
public class AppInitParams(IOwnCharApi api) : OwnCharPluginInitParams
{
public IOwnCharApi Api { get; set; } = api;
}
}

View File

@@ -0,0 +1,14 @@
using Pilz.Plugins.Advanced;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OwnChar.App.Desktop.Api.Parameters
{
public class MainWindowParams(IMainWindowApi api) : PluginFunctionParameter
{
public IMainWindowApi Api { get; } = api;
}
}