Compare commits

..

No commits in common. "146aefeb39755ef4e4b8492aaf9db3c26b6ae4b3" and "e9c0a7018ab4cc9b716d2b0b66c07d1e8fd933e4" have entirely different histories.

8 changed files with 36 additions and 78 deletions

28
MainForm.Designer.cs generated
View File

@ -80,9 +80,9 @@ namespace RokettoLaunch
panel1 = new System.Windows.Forms.Panel();
tileMenu1 = new System.Windows.Forms.ContextMenuStrip(components);
editToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
removeToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
toolStripMenuItem6 = new System.Windows.Forms.ToolStripMenuItem();
toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
removeToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
contextMenuStrip2.SuspendLayout();
menuStrip1.SuspendLayout();
tileContainerMenu1.SuspendLayout();
@ -92,12 +92,12 @@ namespace RokettoLaunch
//
// saveFileDialog1
//
saveFileDialog1.Filter = "Session files (compressed)|*.jsnx|Session files|*.json;*.jsonfig";
saveFileDialog1.Filter = "Session files|*.jsonfig";
saveFileDialog1.Title = "Choose file to save the session";
//
// openFileDialog1
//
openFileDialog1.Filter = "All supported files|*.json;*.jsonfig;*.jsnx|Session files (compressed)|*.jsnx|Session files|*.json;*.jsonfig";
openFileDialog1.Filter = "Session files|*.jsonfig";
openFileDialog1.Title = "Choose session file";
//
// notifyIcon1
@ -420,33 +420,33 @@ namespace RokettoLaunch
//
tileMenu1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { editToolStripMenuItem1, toolStripMenuItem6, toolStripSeparator4, removeToolStripMenuItem1 });
tileMenu1.Name = "tileMenu1";
tileMenu1.Size = new System.Drawing.Size(125, 76);
tileMenu1.Size = new System.Drawing.Size(181, 98);
//
// editToolStripMenuItem1
//
editToolStripMenuItem1.Name = "editToolStripMenuItem1";
editToolStripMenuItem1.Size = new System.Drawing.Size(124, 22);
editToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
editToolStripMenuItem1.Text = "&Edit";
editToolStripMenuItem1.Click += editToolStripMenuItem1_Click;
//
// removeToolStripMenuItem1
//
removeToolStripMenuItem1.Name = "removeToolStripMenuItem1";
removeToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
removeToolStripMenuItem1.Text = "&Remove";
removeToolStripMenuItem1.Click += removeToolStripMenuItem1_Click;
//
// toolStripMenuItem6
//
toolStripMenuItem6.Name = "toolStripMenuItem6";
toolStripMenuItem6.Size = new System.Drawing.Size(124, 22);
toolStripMenuItem6.Size = new System.Drawing.Size(180, 22);
toolStripMenuItem6.Text = "&Duplicate";
toolStripMenuItem6.Click += toolStripMenuItem6_Click;
//
// toolStripSeparator4
//
toolStripSeparator4.Name = "toolStripSeparator4";
toolStripSeparator4.Size = new System.Drawing.Size(121, 6);
//
// removeToolStripMenuItem1
//
removeToolStripMenuItem1.Name = "removeToolStripMenuItem1";
removeToolStripMenuItem1.Size = new System.Drawing.Size(124, 22);
removeToolStripMenuItem1.Text = "&Remove";
removeToolStripMenuItem1.Click += removeToolStripMenuItem1_Click;
toolStripSeparator4.Size = new System.Drawing.Size(177, 6);
//
// MainForm
//

View File

@ -5,11 +5,12 @@ using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;
using RokettoLaunch.Models;
using RyzStudio;
using RyzStudio.Windows.Forms;
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
using RyzStudio.Windows.TileForms;
using static RyzStudio.Windows.ThemedForms.ButtonTextBox.ThKeyCodeTextBox;
namespace RokettoLaunch
{
@ -25,7 +26,6 @@ namespace RokettoLaunch
{
InitializeComponent();
this.AutoScaleMode = AutoScaleMode.None;
this.Text = Application.ProductName;
_fileSessionManager = new FileSessionManager();
@ -37,7 +37,10 @@ namespace RokettoLaunch
_fileSessionManager.OnClearing += fileSessionManager_OnClearSession;
_fileSessionManager.OnFilenameChanged += fileSessionManager_OnFilenameChanged;
//tileContainer1.OnColumnSizeChanged += tileContainer1_OnSizeChanged;
notifyIcon1.Text = Application.ProductName;
this.AutoScaleMode = AutoScaleMode.None;
}
protected async override void OnShown(EventArgs e)
@ -427,22 +430,7 @@ namespace RokettoLaunch
{
return await Task.Run(async () =>
{
var result = GenericResult.Create();
switch (Path.GetExtension(filename?.ToLower()?.Trim() ?? string.Empty))
{
case ".json":
case ".jsonfig":
this.CurrentSession = RyzStudio.Text.Json.JsonSerialiser.DeserialiseFile<AppOptions>(filename);
break;
case ".jsnx":
this.CurrentSession = await RyzStudio.IO.Compression.ZFile.ReadFile<AppOptions>(filename, "Document.json");
break;
default:
this.CurrentSession = null;
break;
}
if (this.CurrentSession == null)
{
MessageBox.Show("Unable to read session", "Load session");
@ -491,7 +479,7 @@ namespace RokettoLaunch
return true;
}
return await Task.Run(async () =>
return await Task.Run(() =>
{
if (_isBusy)
{
@ -515,31 +503,7 @@ namespace RokettoLaunch
this.CurrentSession.Groups.Add((TileGroupModel)container.Tag);
}
var result = GenericResult.Create();
switch (Path.GetExtension(filename?.ToLower()?.Trim() ?? string.Empty))
{
case ".json":
case ".jsonfig":
result = RyzStudio.Text.Json.JsonSerialiser.SerialiseFile(filename, this.CurrentSession);
break;
case ".jsnx":
try
{
System.IO.File.Delete(filename);
}
catch(Exception)
{
// do nothing
}
result = await RyzStudio.IO.Compression.ZFile.WriteFile(filename, "Document.json", this.CurrentSession);
break;
default:
result = GenericResult.Fault("Format not supported");
break;
}
var result = RyzStudio.Text.Json.JsonSerialiser.SerialiseFile(filename, this.CurrentSession);
if (result.IsSuccess)
{
if (showNotices)
@ -548,16 +512,17 @@ namespace RokettoLaunch
}
}
else
{
if (showNotices)
{
MessageBox.Show(result.Message, "Save session");
}
_isBusy = false;
return false;
}
_isBusy = false;
return result.IsSuccess;
return true;
});
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -14,7 +14,7 @@
<Copyright>Ray Lam</Copyright>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<Version>0.3.3.038</Version>
<Version>0.3.2.017</Version>
<EnableNETAnalyzers>False</EnableNETAnalyzers>
<PlatformTarget>x64</PlatformTarget>
<PackageIcon>icon-128.png</PackageIcon>
@ -78,8 +78,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="RyzStudio" Version="8.1.2.249" />
<PackageReference Include="RyzStudio.Windows.Forms" Version="8.1.3.87" />
<PackageReference Include="RyzStudio" Version="8.1.2.244" />
<PackageReference Include="RyzStudio.Windows.Forms" Version="8.1.3.36" />
</ItemGroup>
<ItemGroup>

View File

@ -66,7 +66,11 @@ namespace RokettoLaunch.Windows.Forms
{
if ((fileList?.Length ?? 0) > 0)
{
LoadInfo(fileList[0]);
var model = GetTileModel(fileList[0]);
if (model != null)
{
LoadInfo(model);
}
}
}
}
@ -133,17 +137,6 @@ namespace RokettoLaunch.Windows.Forms
toolTip1.SetToolTip(this, this.Title);
}
public void LoadInfo(string filename)
{
var model = GetTileModel(filename);
if (model == null)
{
return;
}
LoadInfo(model);
}
private void Execute(TileModel model)
{
if (model == null)