Merge pull request 'release/0.4.1.0217' (#4) from release/0.4.1.0217 into master

Reviewed-on: #4
This commit is contained in:
Ray 2026-05-15 21:40:08 +00:00
commit 5587ec2f00
19 changed files with 60 additions and 89 deletions

View File

@ -3,7 +3,7 @@ using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
namespace RokettoLaunch.Models.SaveFile namespace RokettoLaunch.DTOs.SaveFile
{ {
public class App3Options : AppOptionsBase public class App3Options : AppOptionsBase
{ {

View File

@ -6,7 +6,7 @@ using System.Linq;
using System.Text.Json; using System.Text.Json;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
namespace RokettoLaunch.Models.SaveFile namespace RokettoLaunch.DTOs.SaveFile
{ {
public class App4Options : AppOptionsBase public class App4Options : AppOptionsBase
{ {

View File

@ -1,6 +1,6 @@
using System.Drawing; using System.Drawing;
namespace RokettoLaunch.Models.SaveFile namespace RokettoLaunch.DTOs.SaveFile
{ {
public class AppOptionsBase public class AppOptionsBase
{ {

View File

@ -5,7 +5,7 @@ using System.Windows.Forms;
using RyzStudio.Windows.Forms; using RyzStudio.Windows.Forms;
using RyzStudio.Windows.ThemedForms; using RyzStudio.Windows.ThemedForms;
namespace RokettoLaunch namespace RokettoLaunch.Forms
{ {
public class CopyToTileForm : Form public class CopyToTileForm : Form
{ {

View File

@ -5,12 +5,12 @@ using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using RokettoLaunch.Models.SaveFile; using RokettoLaunch.DTOs.SaveFile;
using RyzStudio.Windows.Forms; using RyzStudio.Windows.Forms;
using RyzStudio.Windows.ThemedForms; using RyzStudio.Windows.ThemedForms;
using RyzStudio.Windows.ThemedForms.ButtonTextBox; using RyzStudio.Windows.ThemedForms.ButtonTextBox;
namespace RokettoLaunch namespace RokettoLaunch.Forms
{ {
public class EditFolderForm : Form public class EditFolderForm : Form
{ {

View File

@ -1,12 +1,12 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using RokettoLaunch.Models.SaveFile; using RokettoLaunch.DTOs.SaveFile;
using RokettoLaunch.Windows.Forms; using RokettoLaunch.Windows.Forms;
using RyzStudio.Windows.Forms; using RyzStudio.Windows.Forms;
using RyzStudio.Windows.ThemedForms.ButtonTextBox; using RyzStudio.Windows.ThemedForms.ButtonTextBox;
using RyzStudio.Windows.ThemedForms.PickerBox; using RyzStudio.Windows.ThemedForms.PickerBox;
namespace RokettoLaunch namespace RokettoLaunch.Forms
{ {
public class EditGroupForm : Form public class EditGroupForm : Form
{ {

View File

@ -2,13 +2,13 @@
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using RokettoLaunch.Models.SaveFile; using RokettoLaunch.DTOs.SaveFile;
using RyzStudio.Windows.Forms; using RyzStudio.Windows.Forms;
using RyzStudio.Windows.ThemedForms; using RyzStudio.Windows.ThemedForms;
using RyzStudio.Windows.ThemedForms.ButtonTextBox; using RyzStudio.Windows.ThemedForms.ButtonTextBox;
using RyzStudio.Windows.ThemedForms.PickerBox; using RyzStudio.Windows.ThemedForms.PickerBox;
namespace RokettoLaunch namespace RokettoLaunch.Forms
{ {
public class EditTileForm : Form public class EditTileForm : Form
{ {

View File

@ -3,10 +3,10 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using RokettoLaunch.Models.SaveFile; using RokettoLaunch.DTOs.SaveFile;
using RyzStudio.Windows.Forms; using RyzStudio.Windows.Forms;
namespace RokettoLaunch namespace RokettoLaunch.Forms
{ {
public class LoadingForm : Form public class LoadingForm : Form
{ {

View File

@ -1,12 +1,12 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using RokettoLaunch.Models.SaveFile; using RokettoLaunch.DTOs.SaveFile;
using RyzStudio.Windows.Forms; using RyzStudio.Windows.Forms;
using RyzStudio.Windows.ThemedForms; using RyzStudio.Windows.ThemedForms;
using RyzStudio.Windows.ThemedForms.ButtonTextBox; using RyzStudio.Windows.ThemedForms.ButtonTextBox;
using RyzStudio.Windows.ThemedForms.PickerBox; using RyzStudio.Windows.ThemedForms.PickerBox;
namespace RokettoLaunch namespace RokettoLaunch.Forms
{ {
public class OptionsForm : Form public class OptionsForm : Form
{ {

View File

@ -6,8 +6,8 @@ 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.DTOs.SaveFile;
using RokettoLaunch.Models.SaveFile; using RokettoLaunch.Forms;
using RokettoLaunch.Windows.Forms; using RokettoLaunch.Windows.Forms;
using RyzStudio; using RyzStudio;
using RyzStudio.Windows.Forms; using RyzStudio.Windows.Forms;
@ -18,11 +18,11 @@ 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 App4Options currentSession = null;
private bool _requestExit = false; private bool isBusy = false;
private bool requestExit = false;
public MainForm() public MainForm()
@ -30,22 +30,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 +41,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)
@ -88,7 +78,7 @@ namespace RokettoLaunch
this.CurrentSession = new App4Options(); this.CurrentSession = new App4Options();
} }
if (this.CurrentSession.HideOnClose && !_requestExit) if (this.CurrentSession.HideOnClose && !requestExit)
{ {
this.Hide(); this.Hide();
@ -96,7 +86,7 @@ namespace RokettoLaunch
return; return;
} }
_requestExit = false; requestExit = false;
var result = await _fileSessionManager.CloseSession(); var result = await _fileSessionManager.CloseSession();
if (!result) if (!result)
@ -125,7 +115,7 @@ namespace RokettoLaunch
break; break;
case RyzStudio.Runtime.InteropServices.User32.WM_QUERYENDSESSION: case RyzStudio.Runtime.InteropServices.User32.WM_QUERYENDSESSION:
_requestExit = true; requestExit = true;
Application.Exit(); Application.Exit();
@ -139,8 +129,19 @@ namespace RokettoLaunch
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public App4Options CurrentSession { get; set; } = null; public App4Options CurrentSession
{
get
{
if (currentSession == null)
{
currentSession = new App4Options();
}
return currentSession;
}
set => currentSession = value;
}
private void InvalidateOptions(bool resize) private void InvalidateOptions(bool resize)
{ {
@ -205,7 +206,7 @@ namespace RokettoLaunch
/// <param name="e"></param> /// <param name="e"></param>
private async void NewToolStripMenuItem_Click(object sender, EventArgs e) private async void NewToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (_isBusy) if (isBusy)
{ {
return; return;
} }
@ -220,7 +221,7 @@ namespace RokettoLaunch
/// <param name="e"></param> /// <param name="e"></param>
private async void OpenToolStripMenuItem_Click(object sender, EventArgs e) private async void OpenToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (_isBusy) if (isBusy)
{ {
return; return;
} }
@ -235,7 +236,7 @@ namespace RokettoLaunch
/// <param name="e"></param> /// <param name="e"></param>
private async void CloseToolStripMenuItem_Click(object sender, EventArgs e) private async void CloseToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (_isBusy) if (isBusy)
{ {
return; return;
} }
@ -250,7 +251,7 @@ namespace RokettoLaunch
/// <param name="e"></param> /// <param name="e"></param>
private async void SaveToolStripMenuItem_Click(object sender, EventArgs e) private async void SaveToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (_isBusy) if (isBusy)
{ {
return; return;
} }
@ -265,7 +266,7 @@ namespace RokettoLaunch
/// <param name="e"></param> /// <param name="e"></param>
private async void SaveAsToolStripMenuItem_Click(object sender, EventArgs e) private async void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (_isBusy) if (isBusy)
{ {
return; return;
} }
@ -280,12 +281,12 @@ namespace RokettoLaunch
/// <param name="e"></param> /// <param name="e"></param>
private void ExitToolStripMenuItem_Click(object sender, EventArgs e) private void ExitToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (_isBusy) if (isBusy)
{ {
return; return;
} }
_requestExit = true; requestExit = true;
this.Close(); this.Close();
} }
@ -404,12 +405,12 @@ namespace RokettoLaunch
private void NotifyExitToolStripMenuItem_Click(object sender, EventArgs e) private void NotifyExitToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (_isBusy) if (isBusy)
{ {
return; return;
} }
_requestExit = true; requestExit = true;
this.Close(); this.Close();
} }
@ -435,8 +436,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)
{ {
@ -473,12 +473,12 @@ namespace RokettoLaunch
return await Task.Run(async () => return await Task.Run(async () =>
{ {
if (_isBusy) if (isBusy)
{ {
return false; return false;
} }
_isBusy = true; isBusy = true;
// update session // update session
if (this.CurrentSession == null) if (this.CurrentSession == null)
@ -530,7 +530,7 @@ namespace RokettoLaunch
} }
} }
_isBusy = false; isBusy = false;
return result.IsSuccess; return result.IsSuccess;
}); });
@ -724,7 +724,7 @@ namespace RokettoLaunch
return; return;
} }
_isBusy = true; isBusy = true;
await Task.Run(() => await Task.Run(() =>
{ {
@ -735,7 +735,7 @@ namespace RokettoLaunch
}); });
_fileSessionManager.HasChanged = true; _fileSessionManager.HasChanged = true;
_isBusy = false; isBusy = false;
} }
/// <summary> /// <summary>

View File

@ -1,10 +0,0 @@
namespace RokettoLaunch.Models
{
public class NewFormModel
{
public int ColumnCount { get; set; } = 8;
public int GroupCount { get; set; } = 1;
}
}

View File

@ -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>());
} }
} }
} }

View File

@ -14,7 +14,7 @@
<Copyright>Ray Lam</Copyright> <Copyright>Ray Lam</Copyright>
<AssemblyVersion>1.0.0.0</AssemblyVersion> <AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion> <FileVersion>1.0.0.0</FileVersion>
<Version>0.4.1.0202</Version> <Version>0.4.1.0217</Version>
<EnableNETAnalyzers>False</EnableNETAnalyzers> <EnableNETAnalyzers>False</EnableNETAnalyzers>
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<PackageIcon>icon-128.png</PackageIcon> <PackageIcon>icon-128.png</PackageIcon>
@ -31,15 +31,15 @@
<ItemGroup> <ItemGroup>
<Compile Remove="#\**" /> <Compile Remove="#\**" />
<Compile Remove="Resources\UI\**" /> <Compile Remove="Resources\**" />
<Compile Remove="RyzStudio\**" /> <Compile Remove="RyzStudio\**" />
<Compile Remove="Text\**" /> <Compile Remove="Text\**" />
<EmbeddedResource Remove="#\**" /> <EmbeddedResource Remove="#\**" />
<EmbeddedResource Remove="Resources\UI\**" /> <EmbeddedResource Remove="Resources\**" />
<EmbeddedResource Remove="RyzStudio\**" /> <EmbeddedResource Remove="RyzStudio\**" />
<EmbeddedResource Remove="Text\**" /> <EmbeddedResource Remove="Text\**" />
<None Remove="#\**" /> <None Remove="#\**" />
<None Remove="Resources\UI\**" /> <None Remove="Resources\**" />
<None Remove="RyzStudio\**" /> <None Remove="RyzStudio\**" />
<None Remove="Text\**" /> <None Remove="Text\**" />
</ItemGroup> </ItemGroup>
@ -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>
@ -89,10 +88,10 @@
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DependentUpon>AppResource.resx</DependentUpon> <DependentUpon>AppResource.resx</DependentUpon>
</Compile> </Compile>
<Compile Update="CopyToTileForm.cs"> <Compile Update="Forms\CopyToTileForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Update="LoadingForm.cs"> <Compile Update="Forms\LoadingForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
</ItemGroup> </ItemGroup>
@ -104,11 +103,4 @@
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Update="Resources\icon-128.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
</Project> </Project>