add api culture
This commit is contained in:
10
OwnChar.App.Desktop/Api/IMainWindowApi.cs
Normal file
10
OwnChar.App.Desktop/Api/IMainWindowApi.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace OwnChar.App.Desktop.Api
|
||||||
|
{
|
||||||
|
public interface IMainWindowApi
|
||||||
|
{
|
||||||
|
void OpenTab(Control content);
|
||||||
|
void CloseTab(Control content);
|
||||||
|
}
|
||||||
|
}
|
||||||
8
OwnChar.App.Desktop/Api/IMainWindowTab.cs
Normal file
8
OwnChar.App.Desktop/Api/IMainWindowTab.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
namespace OwnChar.App.Desktop.Api
|
||||||
|
{
|
||||||
|
public interface IMainWindowTab
|
||||||
|
{
|
||||||
|
string Name { get; }
|
||||||
|
IMainWindowApi MaindWindow { get; internal set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
14
OwnChar.App.Desktop/Api/IOwnCharApi.cs
Normal file
14
OwnChar.App.Desktop/Api/IOwnCharApi.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace OwnChar.App.Desktop.Api
|
||||||
|
{
|
||||||
|
public interface IOwnCharApi
|
||||||
|
{
|
||||||
|
public static IOwnCharApi Instance { get; } = new AppApi();
|
||||||
|
public IMainWindowApi? MainWindow { get; internal set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using OwnChar.App.Desktop.Api;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -6,8 +7,8 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace OwnChar.App.Desktop
|
namespace OwnChar.App.Desktop
|
||||||
{
|
{
|
||||||
public sealed class AppApi
|
public sealed class AppApi : IOwnCharApi
|
||||||
{
|
{
|
||||||
public AppApi Instance = new();
|
public IMainWindowApi? MainWindow { get; internal set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using OwnChar.Plugins;
|
using OwnChar.App.Desktop.Api;
|
||||||
|
using OwnChar.Plugins;
|
||||||
using Pilz.Plugins.Advanced;
|
using Pilz.Plugins.Advanced;
|
||||||
|
|
||||||
namespace OwnChar.App.Desktop
|
namespace OwnChar.App.Desktop
|
||||||
@@ -18,7 +19,7 @@ namespace OwnChar.App.Desktop
|
|||||||
|
|
||||||
public object? GetApi()
|
public object? GetApi()
|
||||||
{
|
{
|
||||||
return null;
|
return IOwnCharApi.Instance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,8 @@
|
|||||||
using System;
|
namespace OwnChar.App.Desktop
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace OwnChar.App.Desktop
|
|
||||||
{
|
{
|
||||||
public static class FeatureCodes
|
public static class FeatureCodes
|
||||||
{
|
{
|
||||||
public const string MainTab = "ownchar.app.desktop.main.tab";
|
public const string MainTab = "ownchar.app.desktop.main.tab";
|
||||||
|
public const string QuickAction = "ownchar.app.desktop.main.quickaction";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
using OwnChar.App.Desktop.UI.MainTabs;
|
||||||
|
using Pilz.Plugins.Advanced;
|
||||||
|
using Pilz.Plugins.Advanced.UI.Telerik;
|
||||||
|
|
||||||
|
namespace OwnChar.App.Desktop.Features.MainWindow.MainTabs
|
||||||
|
{
|
||||||
|
internal class TabMyGroupsFeature() : PluginModule(FeatureCodes.MainTab, "ownchar.mygroups", "My groups"), IPluginFeatureProvider<TabMyGroupsFeature>
|
||||||
|
{
|
||||||
|
public static TabMyGroupsFeature Instance { get; } = new();
|
||||||
|
|
||||||
|
protected override PluginModuleUI CreateNewUI()
|
||||||
|
{
|
||||||
|
return new TabCharList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
using OwnChar.App.Desktop.UI.MainTabs;
|
||||||
|
using Pilz.Plugins.Advanced;
|
||||||
|
using Pilz.Plugins.Advanced.UI.Telerik;
|
||||||
|
|
||||||
|
namespace OwnChar.App.Desktop.Features.MainWindow.MainTabs
|
||||||
|
{
|
||||||
|
internal class TabMyUserFeature() : PluginModule(FeatureCodes.MainTab, "ownchar.myuser", "My user"), IPluginFeatureProvider<TabMyUserFeature>
|
||||||
|
{
|
||||||
|
public static TabMyUserFeature Instance { get; } = new();
|
||||||
|
|
||||||
|
protected override PluginModuleUI CreateNewUI()
|
||||||
|
{
|
||||||
|
return new TabEditChar();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using OwnChar.App.Desktop.Features.MainWindow.MainTabs;
|
||||||
|
using Pilz.Plugins.Advanced;
|
||||||
|
using Pilz.Plugins.Advanced.UI.Telerik;
|
||||||
|
|
||||||
|
namespace OwnChar.App.Desktop.Features.MainWindow.QuickAction
|
||||||
|
{
|
||||||
|
internal class HomeFeature() : PluginModule(FeatureCodes.QuickAction, "ownchar.home", "Home"), IPluginFeatureProvider<TabMyUserFeature>
|
||||||
|
{
|
||||||
|
public static TabMyUserFeature Instance { get; } = new();
|
||||||
|
|
||||||
|
protected override PluginModuleUI CreateNewUI()
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
//return new TabEditChar();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using OwnChar.App.Desktop.Features.MainWindow.MainTabs;
|
||||||
|
using Pilz.Plugins.Advanced;
|
||||||
|
using Pilz.Plugins.Advanced.UI.Telerik;
|
||||||
|
|
||||||
|
namespace OwnChar.App.Desktop.Features.MainWindow.QuickAction
|
||||||
|
{
|
||||||
|
internal class SettingsFeature() : PluginModule(FeatureCodes.QuickAction, "ownchar.settings", "Settings"), IPluginFeatureProvider<TabMyUserFeature>
|
||||||
|
{
|
||||||
|
public static TabMyUserFeature Instance { get; } = new();
|
||||||
|
|
||||||
|
protected override PluginModuleUI CreateNewUI()
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
//return new TabSettings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
using OwnChar.App.Desktop.UI.Windows;
|
using OwnChar.App.Desktop.Api;
|
||||||
|
using OwnChar.App.Desktop.UI.Windows;
|
||||||
using OwnChar.Plugins;
|
using OwnChar.Plugins;
|
||||||
using Pilz.Plugins;
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Telerik.WinControls;
|
using Telerik.WinControls;
|
||||||
using Telerik.WinControls.Themes;
|
using Telerik.WinControls.Themes;
|
||||||
@@ -31,7 +30,9 @@ namespace OwnChar.App.Desktop
|
|||||||
OwnCharPlugins.Instance.LoadPlugins(plugins);
|
OwnCharPlugins.Instance.LoadPlugins(plugins);
|
||||||
}
|
}
|
||||||
|
|
||||||
Application.Run(new MainWindow());
|
var mainWindow = new MainWindow();
|
||||||
|
IOwnCharApi.Instance.MainWindow = mainWindow.Api;
|
||||||
|
Application.Run(mainWindow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
using Pilz.Plugins.Advanced;
|
|
||||||
using Pilz.Plugins.Advanced.UI.Telerik;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace OwnChar.App.Desktop.UI.MainTabs
|
|
||||||
{
|
|
||||||
internal class TabCharListFeature() : PluginModule(FeatureCodes.MainTab, "ownchar.tabcharlist", "Character list"), IPluginFeatureProvider<TabCharListFeature>
|
|
||||||
{
|
|
||||||
public static TabCharListFeature Instance { get; } = new();
|
|
||||||
|
|
||||||
protected override PluginModuleUI CreateNewUI()
|
|
||||||
{
|
|
||||||
return new TabCharList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +1,4 @@
|
|||||||
using Pilz.Plugins.Advanced.UI.Telerik;
|
using Pilz.Plugins.Advanced.UI.Telerik;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
namespace OwnChar.App.Desktop.UI.MainTabs
|
namespace OwnChar.App.Desktop.UI.MainTabs
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
using Pilz.Plugins.Advanced;
|
|
||||||
using Pilz.Plugins.Advanced.UI.Telerik;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace OwnChar.App.Desktop.UI.MainTabs
|
|
||||||
{
|
|
||||||
internal class TabEditCharFeature() : PluginModule(FeatureCodes.MainTab, "ownchar.tabcharedit", "Edit Character"), IPluginFeatureProvider<TabEditCharFeature>
|
|
||||||
{
|
|
||||||
public static TabEditCharFeature Instance { get; } = new();
|
|
||||||
|
|
||||||
protected override PluginModuleUI CreateNewUI()
|
|
||||||
{
|
|
||||||
return new TabEditChar();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +1,17 @@
|
|||||||
using Pilz.Plugins.Advanced;
|
using Pilz.Plugins.Advanced;
|
||||||
using Pilz.Plugins.Advanced.UI.Telerik;
|
using Pilz.Plugins.Advanced.UI.Telerik;
|
||||||
using Pilz.UI.Telerik.Dialogs;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
using Telerik.WinControls;
|
|
||||||
using Telerik.WinControls.UI;
|
using Telerik.WinControls.UI;
|
||||||
|
|
||||||
namespace OwnChar.App.Desktop.UI.Windows
|
namespace OwnChar.App.Desktop.UI.Windows
|
||||||
{
|
{
|
||||||
public partial class MainWindow : RadForm
|
public partial class MainWindow : RadForm
|
||||||
{
|
{
|
||||||
|
public MainWindowApi Api { get; }
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
|
Api = new(this);
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
PluginFeatureController.Instance.Features.Get(FeatureCodes.MainTab).InsertItemsTo(radMenuItem2.Items, customClickHandler: MainTabItem_Clicked);
|
PluginFeatureController.Instance.Features.Get(FeatureCodes.MainTab).InsertItemsTo(radMenuItem2.Items, customClickHandler: MainTabItem_Clicked);
|
||||||
}
|
}
|
||||||
|
|||||||
23
OwnChar.App.Desktop/UI/Windows/MainWindowApi.cs
Normal file
23
OwnChar.App.Desktop/UI/Windows/MainWindowApi.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
using OwnChar.App.Desktop.Api;
|
||||||
|
using System;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace OwnChar.App.Desktop.UI.Windows;
|
||||||
|
|
||||||
|
public partial class MainWindow
|
||||||
|
{
|
||||||
|
public class MainWindowApi(MainWindow mainWindow) : IMainWindowApi
|
||||||
|
{
|
||||||
|
public MainWindow MainWindow { get; } = mainWindow;
|
||||||
|
|
||||||
|
public void CloseTab(Control content)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OpenTab(Control content)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user