mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 12:26:30 +00:00
add loader and versioning
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
using System.Windows;
|
||||
using Azaion.CommonSecurity;
|
||||
using Azaion.CommonSecurity.Services;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Serilog;
|
||||
|
||||
namespace Azaion.LoaderUI;
|
||||
|
||||
public partial class App
|
||||
{
|
||||
private LoaderClient _loaderClient = null!;
|
||||
private readonly CancellationTokenSource _loaderUITokenSource = new();
|
||||
|
||||
protected override void OnStartup(StartupEventArgs e)
|
||||
{
|
||||
base.OnStartup(e);
|
||||
@@ -22,5 +30,30 @@ public partial class App
|
||||
rollingInterval: RollingInterval.Day)
|
||||
.CreateLogger();
|
||||
|
||||
var initConfig = SecurityConstants.ReadInitConfig();
|
||||
_loaderClient = new LoaderClient(initConfig.LoaderClientConfig, Log.Logger, _loaderUITokenSource.Token);
|
||||
_loaderClient.StartClient();
|
||||
_loaderClient.Connect();
|
||||
|
||||
var host = Host.CreateDefaultBuilder()
|
||||
.ConfigureAppConfiguration((_, config) => config
|
||||
.AddCommandLine(Environment.GetCommandLineArgs())
|
||||
.AddJsonFile(SecurityConstants.CONFIG_PATH, optional: true, reloadOnChange: true))
|
||||
.UseSerilog()
|
||||
.ConfigureServices((context, services) =>
|
||||
{
|
||||
services.AddSingleton<Login>();
|
||||
})
|
||||
.Build();
|
||||
host.Start();
|
||||
|
||||
host.Services.GetRequiredService<Login>().Show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//AFter:
|
||||
//_loaderClient.Login(credentials);
|
||||
//_loaderClient.Dispose();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Windows;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using Azaion.CommonSecurity.DTO;
|
||||
@@ -7,8 +8,6 @@ namespace Azaion.LoaderUI;
|
||||
|
||||
public partial class Login
|
||||
{
|
||||
public bool MainSuiteOpened { get; set; } = false;
|
||||
|
||||
public Login()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -18,7 +17,7 @@ public partial class Login
|
||||
{
|
||||
LoginBtn.Cursor = Cursors.Wait;
|
||||
Cursor = Cursors.Wait;
|
||||
MainSuiteOpened = true;
|
||||
Process.Start("Azaion.Suite.exe", $"-e {TbEmail.Text} -p {TbPassword.Password}");
|
||||
Close();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user