release/0.4.1.0217 #4
23
MainForm.cs
23
MainForm.cs
@ -6,7 +6,6 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using RokettoLaunch.Models.SaveFile;
|
using RokettoLaunch.Models.SaveFile;
|
||||||
using RokettoLaunch.Windows.Forms;
|
using RokettoLaunch.Windows.Forms;
|
||||||
using RyzStudio;
|
using RyzStudio;
|
||||||
@ -18,7 +17,6 @@ namespace RokettoLaunch
|
|||||||
{
|
{
|
||||||
public partial class MainForm : Form
|
public partial class MainForm : Form
|
||||||
{
|
{
|
||||||
private readonly IServiceProvider _provider;
|
|
||||||
private readonly IFileSessionManager _fileSessionManager;
|
private readonly IFileSessionManager _fileSessionManager;
|
||||||
|
|
||||||
private bool _isBusy = false;
|
private bool _isBusy = false;
|
||||||
@ -30,22 +28,10 @@ namespace RokettoLaunch
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
this.AutoScaleMode = AutoScaleMode.None;
|
this.AutoScaleMode = AutoScaleMode.None;
|
||||||
|
this.StartPosition = FormStartPosition.WindowsDefaultLocation;
|
||||||
this.Text = Application.ProductName;
|
this.Text = Application.ProductName;
|
||||||
|
|
||||||
this.CurrentSession = new App4Options();
|
_fileSessionManager = new FileSessionManager();
|
||||||
|
|
||||||
//#if DEBUG
|
|
||||||
//flowLayoutPanel1.BackColor = Color.LightGreen;
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
notifyIcon1.Text = Application.ProductName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MainForm(IServiceProvider provider, IFileSessionManager fileSessionManager) : this()
|
|
||||||
{
|
|
||||||
_provider = provider;
|
|
||||||
_fileSessionManager = fileSessionManager;
|
|
||||||
|
|
||||||
_fileSessionManager.OpenFileDialog = openFileDialog1;
|
_fileSessionManager.OpenFileDialog = openFileDialog1;
|
||||||
_fileSessionManager.SaveFileDialog = saveFileDialog1;
|
_fileSessionManager.SaveFileDialog = saveFileDialog1;
|
||||||
_fileSessionManager.OnNewing += fileSessionManager_OnNewSession;
|
_fileSessionManager.OnNewing += fileSessionManager_OnNewSession;
|
||||||
@ -53,6 +39,8 @@ namespace RokettoLaunch
|
|||||||
_fileSessionManager.OnSaving += fileSessionManager_OnSaveSession;
|
_fileSessionManager.OnSaving += fileSessionManager_OnSaveSession;
|
||||||
_fileSessionManager.OnClearing += fileSessionManager_OnClearSession;
|
_fileSessionManager.OnClearing += fileSessionManager_OnClearSession;
|
||||||
_fileSessionManager.OnFilenameChanged += fileSessionManager_OnFilenameChanged;
|
_fileSessionManager.OnFilenameChanged += fileSessionManager_OnFilenameChanged;
|
||||||
|
|
||||||
|
notifyIcon1.Text = Application.ProductName;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async override void OnShown(EventArgs e)
|
protected async override void OnShown(EventArgs e)
|
||||||
@ -435,8 +423,7 @@ namespace RokettoLaunch
|
|||||||
|
|
||||||
private async Task<bool> fileSessionManager_OnLoadSession(FileSessionManager sender, string filename, int formatType)
|
private async Task<bool> fileSessionManager_OnLoadSession(FileSessionManager sender, string filename, int formatType)
|
||||||
{
|
{
|
||||||
// Progress indicator
|
var loadingForm = new LoadingForm();
|
||||||
var loadingForm = _provider.GetRequiredService<LoadingForm>();
|
|
||||||
var result = await loadingForm.ShowDialog(filename);
|
var result = await loadingForm.ShowDialog(filename);
|
||||||
if (result != DialogResult.OK)
|
if (result != DialogResult.OK)
|
||||||
{
|
{
|
||||||
|
|||||||
13
Program.cs
13
Program.cs
@ -1,7 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using RyzStudio.Windows.Forms;
|
|
||||||
|
|
||||||
namespace RokettoLaunch
|
namespace RokettoLaunch
|
||||||
{
|
{
|
||||||
@ -13,19 +11,10 @@ namespace RokettoLaunch
|
|||||||
[STAThread]
|
[STAThread]
|
||||||
static void Main()
|
static void Main()
|
||||||
{
|
{
|
||||||
var services = new ServiceCollection();
|
|
||||||
services.AddSingleton<IFileSessionManager, FileSessionManager>();
|
|
||||||
services.AddTransient<MainForm>();
|
|
||||||
services.AddTransient<LoadingForm>();
|
|
||||||
|
|
||||||
var provider = services.BuildServiceProvider();
|
|
||||||
|
|
||||||
Application.SetHighDpiMode(HighDpiMode.SystemAware);
|
Application.SetHighDpiMode(HighDpiMode.SystemAware);
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
//Application.Run(new MainForm());
|
Application.Run(new MainForm());
|
||||||
|
|
||||||
Application.Run(provider.GetRequiredService<MainForm>());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -79,7 +79,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.7" />
|
|
||||||
<PackageReference Include="RyzStudio" Version="10.1.0.128" />
|
<PackageReference Include="RyzStudio" Version="10.1.0.128" />
|
||||||
<PackageReference Include="RyzStudio.Windows.Forms" Version="10.1.0.140" />
|
<PackageReference Include="RyzStudio.Windows.Forms" Version="10.1.0.140" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user