finish login & polish up
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using OwnChar.App.Desktop.Api;
|
||||
using OwnChar.App.Desktop.LangRes;
|
||||
using OwnChar.App.Desktop.Settings;
|
||||
using OwnChar.Data;
|
||||
using OwnChar.Data.Managers;
|
||||
@@ -8,7 +9,7 @@ using Telerik.WinControls.UI;
|
||||
|
||||
namespace OwnChar.App.Desktop.Features.LoginProviders;
|
||||
|
||||
internal class JsonFileLoginProvider() : LoginProvider(FeatureCodes.LoginProvider, "ownchar.jsonfile"), IPluginFeatureProvider<JsonFileLoginProvider>
|
||||
internal class JsonFileLoginProvider() : LoginProvider(FeatureCodes.LoginProvider, "ownchar.jsonfile", JsonFileLoginProviderLangRes.Name), IPluginFeatureProvider<JsonFileLoginProvider>
|
||||
{
|
||||
private const string defaultJsonFileName = "ownchar.db.json";
|
||||
|
||||
@@ -25,7 +26,7 @@ internal class JsonFileLoginProvider() : LoginProvider(FeatureCodes.LoginProvide
|
||||
var settings = AppApi.Instance.Settings.Get<JsonFileLoginProviderSettings>();
|
||||
using var ofd = new RadOpenFileDialog
|
||||
{
|
||||
Filter = "OwnChar Json database (*.json)|*.json"
|
||||
Filter = $"{JsonFileLoginProviderLangRes.Filter_Json} (*.json)|*.json"
|
||||
};
|
||||
|
||||
if (manager is DefaultDataManager defaultManager && defaultManager.DataProvider is JsonFileDataProvider jsonFileDataProvider)
|
||||
|
||||
81
OwnChar.App.Desktop/LangRes/JsonFileLoginProviderLangRes.Designer.cs
generated
Normal file
81
OwnChar.App.Desktop/LangRes/JsonFileLoginProviderLangRes.Designer.cs
generated
Normal file
@@ -0,0 +1,81 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion:4.0.30319.42000
|
||||
//
|
||||
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code erneut generiert wird.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace OwnChar.App.Desktop.LangRes {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
/// </summary>
|
||||
// Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class JsonFileLoginProviderLangRes {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal JsonFileLoginProviderLangRes() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OwnChar.App.Desktop.LangRes.JsonFileLoginProviderLangRes", typeof(JsonFileLoginProviderLangRes).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die OwnChar Json database ähnelt.
|
||||
/// </summary>
|
||||
internal static string Filter_Json {
|
||||
get {
|
||||
return ResourceManager.GetString("Filter_Json", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Json database file ähnelt.
|
||||
/// </summary>
|
||||
internal static string Name {
|
||||
get {
|
||||
return ResourceManager.GetString("Name", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
126
OwnChar.App.Desktop/LangRes/JsonFileLoginProviderLangRes.resx
Normal file
126
OwnChar.App.Desktop/LangRes/JsonFileLoginProviderLangRes.resx
Normal file
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Filter_Json" xml:space="preserve">
|
||||
<value>OwnChar Json database</value>
|
||||
</data>
|
||||
<data name="Name" xml:space="preserve">
|
||||
<value>Json database file</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -31,6 +31,11 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="LangRes\JsonFileLoginProviderLangRes.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>JsonFileLoginProviderLangRes.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="LangRes\LoginPageLangRes.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
@@ -44,6 +49,10 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="LangRes\JsonFileLoginProviderLangRes.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>JsonFileLoginProviderLangRes.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="LangRes\LoginPageLangRes.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>LoginPageLangRes.Designer.cs</LastGenOutput>
|
||||
|
||||
@@ -23,6 +23,7 @@ internal static class Program
|
||||
{
|
||||
// Load settings
|
||||
AppTempFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "OwnChar", "Desktop");
|
||||
Directory.CreateDirectory(AppTempFolder);
|
||||
SettingsManager = new SettingsManager(Path.Combine(AppTempFolder, "Settings.json"), true);
|
||||
AppApi.Instance.Settings = SettingsManager.Instance;
|
||||
|
||||
@@ -33,12 +34,10 @@ internal static class Program
|
||||
|
||||
// Load plugins
|
||||
OwnCharPlugins.Instance.LoadOwnPlugins();
|
||||
var pluginPath = Path.Combine(Path.GetDirectoryName(Pilz.IO.Extensions.GetExecutablePath())!, "Plugins");
|
||||
if (Directory.Exists(pluginPath))
|
||||
{
|
||||
var pluginPath = Path.Combine(AppTempFolder, "Plugins");
|
||||
Directory.CreateDirectory(pluginPath);
|
||||
var plugins = Directory.GetDirectories(pluginPath, "*", SearchOption.TopDirectoryOnly).Select(n => Path.Combine(n, n + ".dll")).ToArray();
|
||||
OwnCharPlugins.Instance.LoadPlugins(plugins);
|
||||
}
|
||||
|
||||
// Start main window
|
||||
var mainWindow = new MainWindow();
|
||||
|
||||
15
OwnChar.App.Desktop/Settings/MainWindowSettings.cs
Normal file
15
OwnChar.App.Desktop/Settings/MainWindowSettings.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Pilz.Configuration;
|
||||
|
||||
namespace OwnChar.App.Desktop.Settings;
|
||||
|
||||
internal class MainWindowSettings : IChildSettings, ISettingsIdentifier
|
||||
{
|
||||
public static string Identifier => "ownchar.view.main";
|
||||
|
||||
public bool AllowAero { get; set; }
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
AllowAero = true;
|
||||
}
|
||||
}
|
||||
@@ -57,8 +57,8 @@
|
||||
tableLayoutPanel1.AutoSize = true;
|
||||
tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
tableLayoutPanel1.ColumnCount = 2;
|
||||
tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 40F));
|
||||
tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 60F));
|
||||
tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.3333321F));
|
||||
tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 66.6666641F));
|
||||
tableLayoutPanel1.Controls.Add(radTextBoxControl_Password, 1, 2);
|
||||
tableLayoutPanel1.Controls.Add(radLabel2, 0, 2);
|
||||
tableLayoutPanel1.Controls.Add(radTextBoxControl_Username, 1, 1);
|
||||
@@ -66,7 +66,8 @@
|
||||
tableLayoutPanel1.Controls.Add(radLabel1, 0, 1);
|
||||
tableLayoutPanel1.Controls.Add(radLabel3, 0, 0);
|
||||
tableLayoutPanel1.Controls.Add(tableLayoutPanel3, 1, 0);
|
||||
tableLayoutPanel1.Location = new System.Drawing.Point(129, 74);
|
||||
tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
tableLayoutPanel1.Location = new System.Drawing.Point(155, 74);
|
||||
tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0);
|
||||
tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
tableLayoutPanel1.RowCount = 4;
|
||||
@@ -74,16 +75,17 @@
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
tableLayoutPanel1.Size = new System.Drawing.Size(259, 114);
|
||||
tableLayoutPanel1.Size = new System.Drawing.Size(207, 114);
|
||||
tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// radTextBoxControl_Password
|
||||
//
|
||||
radTextBoxControl_Password.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
radTextBoxControl_Password.Location = new System.Drawing.Point(106, 59);
|
||||
radTextBoxControl_Password.Location = new System.Drawing.Point(71, 59);
|
||||
radTextBoxControl_Password.Name = "radTextBoxControl_Password";
|
||||
radTextBoxControl_Password.Size = new System.Drawing.Size(150, 22);
|
||||
radTextBoxControl_Password.Size = new System.Drawing.Size(133, 22);
|
||||
radTextBoxControl_Password.TabIndex = 1;
|
||||
radTextBoxControl_Password.UseSystemPasswordChar = true;
|
||||
//
|
||||
// radLabel2
|
||||
//
|
||||
@@ -91,24 +93,24 @@
|
||||
radLabel2.AutoSize = false;
|
||||
radLabel2.Location = new System.Drawing.Point(3, 59);
|
||||
radLabel2.Name = "radLabel2";
|
||||
radLabel2.Size = new System.Drawing.Size(97, 22);
|
||||
radLabel2.Size = new System.Drawing.Size(62, 22);
|
||||
radLabel2.TabIndex = 0;
|
||||
radLabel2.Text = "Password";
|
||||
//
|
||||
// radTextBoxControl_Username
|
||||
//
|
||||
radTextBoxControl_Username.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
radTextBoxControl_Username.Location = new System.Drawing.Point(106, 31);
|
||||
radTextBoxControl_Username.Location = new System.Drawing.Point(71, 31);
|
||||
radTextBoxControl_Username.Name = "radTextBoxControl_Username";
|
||||
radTextBoxControl_Username.Size = new System.Drawing.Size(150, 22);
|
||||
radTextBoxControl_Username.TabIndex = 2;
|
||||
radTextBoxControl_Username.Size = new System.Drawing.Size(133, 22);
|
||||
radTextBoxControl_Username.TabIndex = 0;
|
||||
//
|
||||
// radButton_Login
|
||||
//
|
||||
radButton_Login.Location = new System.Drawing.Point(106, 87);
|
||||
radButton_Login.Location = new System.Drawing.Point(71, 87);
|
||||
radButton_Login.Name = "radButton_Login";
|
||||
radButton_Login.Size = new System.Drawing.Size(110, 24);
|
||||
radButton_Login.TabIndex = 1;
|
||||
radButton_Login.TabIndex = 2;
|
||||
radButton_Login.Text = "Login";
|
||||
radButton_Login.Click += RadButton_Login_Click;
|
||||
//
|
||||
@@ -118,7 +120,7 @@
|
||||
radLabel1.AutoSize = false;
|
||||
radLabel1.Location = new System.Drawing.Point(3, 31);
|
||||
radLabel1.Name = "radLabel1";
|
||||
radLabel1.Size = new System.Drawing.Size(97, 22);
|
||||
radLabel1.Size = new System.Drawing.Size(62, 22);
|
||||
radLabel1.TabIndex = 1;
|
||||
radLabel1.Text = "Username";
|
||||
//
|
||||
@@ -128,7 +130,7 @@
|
||||
radLabel3.AutoSize = false;
|
||||
radLabel3.Location = new System.Drawing.Point(3, 3);
|
||||
radLabel3.Name = "radLabel3";
|
||||
radLabel3.Size = new System.Drawing.Size(97, 22);
|
||||
radLabel3.Size = new System.Drawing.Size(62, 22);
|
||||
radLabel3.TabIndex = 3;
|
||||
radLabel3.Text = "Provider";
|
||||
//
|
||||
@@ -141,12 +143,12 @@
|
||||
tableLayoutPanel3.Controls.Add(radDropDownList_LoginProvider, 0, 0);
|
||||
tableLayoutPanel3.Controls.Add(radButton_ConfigureProvider, 1, 0);
|
||||
tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
tableLayoutPanel3.Location = new System.Drawing.Point(103, 0);
|
||||
tableLayoutPanel3.Location = new System.Drawing.Point(68, 0);
|
||||
tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(0);
|
||||
tableLayoutPanel3.Name = "tableLayoutPanel3";
|
||||
tableLayoutPanel3.RowCount = 1;
|
||||
tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
tableLayoutPanel3.Size = new System.Drawing.Size(156, 28);
|
||||
tableLayoutPanel3.Size = new System.Drawing.Size(139, 28);
|
||||
tableLayoutPanel3.TabIndex = 4;
|
||||
//
|
||||
// radDropDownList_LoginProvider
|
||||
@@ -155,27 +157,27 @@
|
||||
radDropDownList_LoginProvider.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
|
||||
radDropDownList_LoginProvider.Location = new System.Drawing.Point(3, 3);
|
||||
radDropDownList_LoginProvider.Name = "radDropDownList_LoginProvider";
|
||||
radDropDownList_LoginProvider.Size = new System.Drawing.Size(122, 22);
|
||||
radDropDownList_LoginProvider.TabIndex = 0;
|
||||
radDropDownList_LoginProvider.Size = new System.Drawing.Size(105, 22);
|
||||
radDropDownList_LoginProvider.TabIndex = 3;
|
||||
radDropDownList_LoginProvider.SelectedValueChanged += RadDropDownList_LoginProvider_SelectedValueChanged;
|
||||
//
|
||||
// radButton_ConfigureProvider
|
||||
//
|
||||
radButton_ConfigureProvider.DisplayStyle = Telerik.WinControls.DisplayStyle.Image;
|
||||
radButton_ConfigureProvider.ImageAlignment = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
radButton_ConfigureProvider.Location = new System.Drawing.Point(131, 3);
|
||||
radButton_ConfigureProvider.Location = new System.Drawing.Point(114, 3);
|
||||
radButton_ConfigureProvider.Name = "radButton_ConfigureProvider";
|
||||
radButton_ConfigureProvider.Size = new System.Drawing.Size(22, 22);
|
||||
radButton_ConfigureProvider.TabIndex = 1;
|
||||
radButton_ConfigureProvider.TabIndex = 4;
|
||||
radButton_ConfigureProvider.Text = "Configure";
|
||||
radButton_ConfigureProvider.Click += RadButton_ConfigureProvider_Click;
|
||||
//
|
||||
// tableLayoutPanel2
|
||||
//
|
||||
tableLayoutPanel2.ColumnCount = 3;
|
||||
tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
|
||||
tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
|
||||
tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
|
||||
tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 40F));
|
||||
tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30F));
|
||||
tableLayoutPanel2.Controls.Add(tableLayoutPanel1, 1, 1);
|
||||
tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
tableLayoutPanel2.Location = new System.Drawing.Point(0, 0);
|
||||
|
||||
@@ -64,7 +64,7 @@ public partial class TabLoginView : UserControl, ILoadContent
|
||||
|
||||
if (mainApi.Manager?.Login(dataManager, username, password) is not bool success || !success)
|
||||
{
|
||||
RadMessageBox.Show(LoginPageLangRes.MsgBox_LoginFailed, LoginPageLangRes.MsgBox_LoginFailed_Title, MessageBoxButtons.YesNo, RadMessageIcon.Exclamation);
|
||||
RadMessageBox.Show(LoginPageLangRes.MsgBox_LoginFailed, LoginPageLangRes.MsgBox_LoginFailed_Title, MessageBoxButtons.OK, RadMessageIcon.Exclamation);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,8 @@ namespace OwnChar.App.Desktop.UI.Windows
|
||||
//
|
||||
radTabbedFormControl2.Location = new System.Drawing.Point(0, 0);
|
||||
radTabbedFormControl2.Name = "radTabbedFormControl1";
|
||||
radTabbedFormControl2.ShowNewTabButton = false;
|
||||
radTabbedFormControl2.ShowIcon = true;
|
||||
radTabbedFormControl2.ShowTabPinButton = true;
|
||||
radTabbedFormControl2.Size = new System.Drawing.Size(768, 583);
|
||||
radTabbedFormControl2.TabIndex = 0;
|
||||
radTabbedFormControl2.TabWidth = 200;
|
||||
@@ -55,7 +56,6 @@ namespace OwnChar.App.Desktop.UI.Windows
|
||||
ClientSize = new System.Drawing.Size(780, 589);
|
||||
Controls.Add(radTabbedFormControl2);
|
||||
Name = "MainWindow";
|
||||
ShowIcon = false;
|
||||
Text = "RadForm1";
|
||||
Load += MainWindow_Load;
|
||||
((System.ComponentModel.ISupportInitialize)radTabbedFormControl2).EndInit();
|
||||
@@ -65,7 +65,6 @@ namespace OwnChar.App.Desktop.UI.Windows
|
||||
|
||||
#endregion
|
||||
|
||||
private Telerik.WinControls.UI.RadTabbedFormControl radTabbedFormControl1;
|
||||
private RadTabbedFormControl radTabbedFormControl2;
|
||||
}
|
||||
}
|
||||
@@ -1,49 +1,69 @@
|
||||
using OwnChar.App.Desktop.Api;
|
||||
using OwnChar.App.Desktop.Api.Parameters;
|
||||
using OwnChar.App.Desktop.LangRes;
|
||||
using OwnChar.App.Desktop.Settings;
|
||||
using OwnChar.App.Desktop.UI.MainTabs;
|
||||
using OwnChar.Manager;
|
||||
using Pilz.Plugins.Advanced;
|
||||
using Pilz.Plugins.Advanced.UI.Telerik;
|
||||
using Pilz.UI;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using Telerik.WinControls.UI;
|
||||
using Telerik.Windows.Diagrams.Core;
|
||||
|
||||
namespace OwnChar.App.Desktop.UI.Windows;
|
||||
|
||||
public partial class MainWindow : RadTabbedForm, IMainWindowApi
|
||||
{
|
||||
private readonly MainWindowSettings settings = AppApi.Instance.Settings.Get<MainWindowSettings>();
|
||||
|
||||
Form IMainWindowApi.Window => this;
|
||||
public OwnCharManager Manager { get; } = new();
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
PluginFeatureController.Instance.Features.Get(FeatureCodes.QuickAction).InsertItemsTo(radTabbedFormControl1.RightItems, customClickHandler: RightItem_Clicked);
|
||||
|
||||
if (!settings.AllowAero)
|
||||
AllowAero = false;
|
||||
|
||||
PluginFeatureController.Instance.Features.Get(FeatureCodes.QuickAction)
|
||||
.InsertItemsTo(radTabbedFormControl2.RightItems, customClickHandler: RightItem_Clicked)
|
||||
.ForEach(item => item.DisplayStyle = Telerik.WinControls.DisplayStyle.Image);
|
||||
}
|
||||
|
||||
private MainWindowParams GetMainWindowParams()
|
||||
protected virtual MainWindowParams GetMainWindowParams()
|
||||
{
|
||||
return new MainWindowParams(this);
|
||||
}
|
||||
|
||||
public void OpenTab(Control content, string title)
|
||||
{
|
||||
var newTab = new RadTabbedFormControlTab();
|
||||
content.BackColor = System.Drawing.Color.Transparent;
|
||||
content.Dock = DockStyle.Fill;
|
||||
newTab.Controls.Add(content);
|
||||
newTab.Text = title;
|
||||
newTab.Tag = content;
|
||||
|
||||
var newTab = new RadTabbedFormControlTab
|
||||
{
|
||||
Text = title,
|
||||
Tag = content
|
||||
};
|
||||
|
||||
content.Tag = newTab;
|
||||
radTabbedFormControl1.Tabs.Add(newTab);
|
||||
radTabbedFormControl1.SelectedTab = newTab;
|
||||
newTab.Controls.Add(content);
|
||||
|
||||
radTabbedFormControl2.Tabs.Add(newTab);
|
||||
radTabbedFormControl2.SelectedTab = newTab;
|
||||
|
||||
if (content is ILoadContent loadContent)
|
||||
loadContent.LoadContent();
|
||||
}
|
||||
|
||||
public void CloseTab(Control content)
|
||||
{
|
||||
if (FindTab(content) is RadTabbedFormControlTab tab)
|
||||
radTabbedFormControl1.Tabs.Remove(tab);
|
||||
radTabbedFormControl2.Tabs.Remove(tab);
|
||||
}
|
||||
|
||||
public bool IsTabOpen(Control content)
|
||||
@@ -58,12 +78,12 @@ public partial class MainWindow : RadTabbedForm, IMainWindowApi
|
||||
|
||||
private RadTabbedFormControlTab? FindTab(Control content)
|
||||
{
|
||||
return radTabbedFormControl1.Tabs.FirstOrDefault(n => n.Tag == content);
|
||||
return radTabbedFormControl2.Tabs.FirstOrDefault(n => n.Tag == content);
|
||||
}
|
||||
|
||||
private RadTabbedFormControlTab? FindTab<T>()
|
||||
{
|
||||
return radTabbedFormControl1.Tabs.FirstOrDefault(n => n.Tag is T);
|
||||
return radTabbedFormControl2.Tabs.FirstOrDefault(n => n.Tag is T);
|
||||
}
|
||||
|
||||
private void RightItem_Clicked(object? sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user