release/0.4.1 #3

Merged
Ray merged 7 commits from release/0.4.1 into master 2026-05-10 12:38:44 +00:00
39 changed files with 3116 additions and 1495 deletions

View File

@ -19,7 +19,7 @@ namespace RokettoLaunch {
// class via a tool like ResGen or Visual Studio. // class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class AppResource { internal class AppResource {
@ -106,6 +106,26 @@ namespace RokettoLaunch {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap folder_minus {
get {
object obj = ResourceManager.GetObject("folder_minus", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap help_circle {
get {
object obj = ResourceManager.GetObject("help_circle", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
@ -115,5 +135,45 @@ namespace RokettoLaunch {
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap plus {
get {
object obj = ResourceManager.GetObject("plus", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap save {
get {
object obj = ResourceManager.GetObject("save", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap settings {
get {
object obj = ResourceManager.GetObject("settings", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap trash_2 {
get {
object obj = ResourceManager.GetObject("trash_2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
} }
} }

View File

@ -133,7 +133,25 @@
<data name="folder_32" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="folder_32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\folder_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>Resources\folder_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="folder_minus" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\MainMenu\folder-minus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="help_circle" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\MainMenu\help-circle.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icon_64" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="icon_64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\icon-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>Resources\icon-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="plus" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\MainMenu\plus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="save" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\MainMenu\save.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="settings" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\MainMenu\settings.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="trash_2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\MainMenu\trash-2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

105
CopyToTileForm.cs Normal file
View File

@ -0,0 +1,105 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using RyzStudio.Windows.Forms;
using RyzStudio.Windows.ThemedForms;
namespace RokettoLaunch
{
public class CopyToTileForm : Form
{
private Label label1;
private ThPickerBox pickerBox1;
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
private List<string> result = null;
public CopyToTileForm(List<string> model = null)
{
InitializeComponent();
UISetup.Dialog(this, true);
this.Text = "Copy To...";
result = model;
pickerBox1.Setup(model, 0);
}
protected override void OnShown(EventArgs e)
{
base.OnShown(e);
pickerBox1.Value = 0;
}
private void InitializeComponent()
{
label1 = new Label();
pickerBox1 = new ThPickerBox();
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
SuspendLayout();
//
// label1
//
label1.AutoSize = true;
label1.BackColor = Color.Transparent;
label1.ForeColor = SystemColors.ControlText;
label1.Location = new Point(10, 20);
label1.Margin = new Padding(0);
label1.Name = "label1";
label1.Padding = new Padding(0, 9, 0, 0);
label1.Size = new Size(40, 24);
label1.TabIndex = 153;
label1.Text = "Group";
label1.TextAlign = ContentAlignment.MiddleLeft;
//
// pickerBox1
//
pickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
pickerBox1.BackColor = Color.Transparent;
pickerBox1.EnableMovable = false;
pickerBox1.Location = new Point(95, 20);
pickerBox1.Name = "pickerBox1";
pickerBox1.SelectedIndex = -1;
pickerBox1.Size = new Size(280, 32);
pickerBox1.TabIndex = 174;
pickerBox1.TabStop = false;
//
// dialogFooter1
//
dialogFooter1.BackColor = Color.FromArgb(240, 240, 240);
dialogFooter1.Dock = DockStyle.Bottom;
dialogFooter1.EnableMovable = false;
dialogFooter1.IsBusy = false;
dialogFooter1.Location = new Point(0, 451);
dialogFooter1.Name = "dialogFooter1";
dialogFooter1.Size = new Size(384, 70);
dialogFooter1.TabIndex = 0;
dialogFooter1.TabStop = false;
//
// CopyToTileForm
//
BackColor = Color.White;
ClientSize = new Size(384, 521);
Controls.Add(dialogFooter1);
Controls.Add(pickerBox1);
Controls.Add(label1);
MinimumSize = new Size(400, 560);
Name = "CopyToTileForm";
Text = "Copy To...";
ResumeLayout(false);
PerformLayout();
}
public int Result
{
get => pickerBox1.Value;
}
}
}

View File

@ -5,14 +5,14 @@ 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; using RokettoLaunch.Models.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
{ {
public class EditTileFolderForm : Form public class EditFolderForm : Form
{ {
private Label label1; private Label label1;
private ThClearableTextBox textBox1; private ThClearableTextBox textBox1;
@ -21,21 +21,27 @@ namespace RokettoLaunch
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1; private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
private TileModel result = null; private App4Options.Item result = null;
public EditTileFolderForm(TileModel model = null) public EditFolderForm(App4Options.Item model = null)
{ {
InitializeComponent(); InitializeComponent();
UISetup.Dialog(this); UISetup.Dialog(this, true);
this.Text = (result == null) ? "Add Folder" : "Edit Folder"; this.Text = (result == null) ? "Add Folder" : "Edit Folder";
result = model; result = model;
}
protected override void OnShown(EventArgs e)
{
base.OnShown(e);
textBox1.Text = result?.Title ?? "New Folder"; textBox1.Text = result?.Title ?? "New Folder";
foreach (TileModel item in result?.Items ?? new List<TileModel>())
foreach (var item in result?.Items ?? new List<App4Options.Item>())
{ {
if (item.IsGroup) if (item.IsGroup)
{ {
@ -60,13 +66,11 @@ namespace RokettoLaunch
textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
textBox1.BackColor = Color.Transparent; textBox1.BackColor = Color.Transparent;
textBox1.ClearedValue = ""; textBox1.ClearedValue = "";
textBox1.EnableReactiveVisual = true; textBox1.EnableMovable = false;
textBox1.Font = new Font("Microsoft Sans Serif", 8.25F);
textBox1.Icon = "O"; textBox1.Icon = "O";
textBox1.IconSize = 13F; textBox1.IconSize = 13F;
textBox1.Location = new Point(109, 20); textBox1.Location = new Point(115, 20);
textBox1.Name = "textBox1"; textBox1.Name = "textBox1";
textBox1.Padding = new Padding(4, 4, 3, 3);
textBox1.Size = new Size(260, 32); textBox1.Size = new Size(260, 32);
textBox1.TabIndex = 152; textBox1.TabIndex = 152;
textBox1.TabStop = false; textBox1.TabStop = false;
@ -88,21 +92,18 @@ namespace RokettoLaunch
// //
// listBox1 // listBox1
// //
listBox1.AllowDrop = true;
listBox1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; listBox1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
listBox1.BackColor = Color.Transparent; listBox1.BackColor = Color.Transparent;
listBox1.EnableReactiveVisual = true; listBox1.EnableMovable = false;
listBox1.Font = new Font("Microsoft Sans Serif", 8.25F); listBox1.Location = new Point(115, 62);
listBox1.Location = new Point(109, 62);
listBox1.Name = "listBox1"; listBox1.Name = "listBox1";
listBox1.Padding = new Padding(4, 4, 3, 3);
listBox1.Size = new Size(260, 366); listBox1.Size = new Size(260, 366);
listBox1.TabIndex = 180; listBox1.TabIndex = 180;
listBox1.OnAdd += listBox1_OnAdd; listBox1.OnAdd += ListBox_OnAdd;
listBox1.OnEdit += listBox1_OnEdit; listBox1.OnEdit += ListBox_OnEdit;
listBox1.OnCopy += listBox1_OnCopy; listBox1.OnCopy += ListBox_OnCopy;
listBox1.DragDrop += listBox1_DragDrop; listBox1.DragDrop += ListBox_DragDrop;
listBox1.DragOver += listBox1_DragOver; listBox1.DragOver += ListBox_DragOver;
// //
// label2 // label2
// //
@ -113,21 +114,22 @@ namespace RokettoLaunch
label2.Margin = new Padding(0); label2.Margin = new Padding(0);
label2.Name = "label2"; label2.Name = "label2";
label2.Padding = new Padding(0, 9, 0, 0); label2.Padding = new Padding(0, 9, 0, 0);
label2.Size = new Size(82, 24); label2.Size = new Size(30, 24);
label2.TabIndex = 181; label2.TabIndex = 181;
label2.Text = "Tile Collection"; label2.Text = "Tiles";
label2.TextAlign = ContentAlignment.MiddleLeft; label2.TextAlign = ContentAlignment.MiddleLeft;
// //
// dialogFooter1 // dialogFooter1
// //
dialogFooter1.BackColor = Color.FromArgb(240, 240, 240); dialogFooter1.BackColor = Color.FromArgb(240, 240, 240);
dialogFooter1.Button1Text = "&Save";
dialogFooter1.Dialog = this;
dialogFooter1.Dock = DockStyle.Bottom; dialogFooter1.Dock = DockStyle.Bottom;
dialogFooter1.EnableMovable = false;
dialogFooter1.IsBusy = false; dialogFooter1.IsBusy = false;
dialogFooter1.Location = new Point(0, 437); dialogFooter1.Location = new Point(0, 451);
dialogFooter1.Name = "dialogFooter1"; dialogFooter1.Name = "dialogFooter1";
dialogFooter1.Size = new Size(384, 84); dialogFooter1.Size = new Size(384, 70);
dialogFooter1.TabIndex = 0;
dialogFooter1.TabStop = false;
// //
// EditFolderForm // EditFolderForm
// //
@ -145,20 +147,20 @@ namespace RokettoLaunch
PerformLayout(); PerformLayout();
} }
public TileModel Result public App4Options.Item Result
{ {
get get
{ {
if (result == null) if (result == null)
{ {
result = new TileModel(); result = new App4Options.Item();
} }
result.Title = textBox1.Text?.Trim() ?? string.Empty; result.Title = textBox1.Text?.Trim() ?? string.Empty;
result.IsGroup = true; result.IsGroup = true;
result.Items = new List<TileModel>(); result.Items = new List<App4Options.Item>();
foreach (TileModel item in listBox1.ListBox.Items.OfType<TileModel>()) foreach (var item in listBox1.ListBox.Items.OfType<App4Options.Item>())
{ {
if (item.IsGroup) if (item.IsGroup)
{ {
@ -173,7 +175,7 @@ namespace RokettoLaunch
} }
private void listBox1_OnAdd(object sender, EventArgs e) private void ListBox_OnAdd(object sender, EventArgs e)
{ {
var form = new EditTileForm(); var form = new EditTileForm();
if (form.ShowDialog() == DialogResult.OK) if (form.ShowDialog() == DialogResult.OK)
@ -182,7 +184,7 @@ namespace RokettoLaunch
}; };
} }
private void listBox1_OnEdit(object sender, EventArgs e) private void ListBox_OnEdit(object sender, EventArgs e)
{ {
if (listBox1.ListBox.Items.Count <= 0) if (listBox1.ListBox.Items.Count <= 0)
{ {
@ -200,7 +202,7 @@ namespace RokettoLaunch
return; return;
} }
var form = new EditTileForm((TileModel)listBox1.ListBox.SelectedItem); var form = new EditTileForm((App4Options.Item)listBox1.ListBox.SelectedItem);
if (form.ShowDialog() == DialogResult.OK) if (form.ShowDialog() == DialogResult.OK)
{ {
listBox1.ListBox.Items.RemoveAt(n); listBox1.ListBox.Items.RemoveAt(n);
@ -208,12 +210,12 @@ namespace RokettoLaunch
}; };
} }
private void listBox1_OnCopy(object sender, EventArgs e) private void ListBox_OnCopy(object sender, EventArgs e)
{ {
listBox1.ListBox.CopyItem<TileModel>(); listBox1.ListBox.CopyItem<App4Options.Item>();
} }
private void listBox1_DragOver(object sender, DragEventArgs e) private void ListBox_DragOver(object sender, DragEventArgs e)
{ {
if (e.Data.GetDataPresent(DataFormats.FileDrop)) if (e.Data.GetDataPresent(DataFormats.FileDrop))
{ {
@ -225,7 +227,7 @@ namespace RokettoLaunch
} }
} }
private void listBox1_DragDrop(object sender, DragEventArgs e) private void ListBox_DragDrop(object sender, DragEventArgs e)
{ {
var fileList = e.Data.GetData(DataFormats.FileDrop) as string[]; var fileList = e.Data.GetData(DataFormats.FileDrop) as string[];
if (fileList == null) if (fileList == null)
@ -245,34 +247,12 @@ namespace RokettoLaunch
continue; continue;
} }
var model = new TileModel() var model = new App4Options.Item()
{ {
ProcessFilename = item, TargetPath = item,
Title = Path.GetFileName(item) Title = RyzStudio.IO.File.GetName(item)
}; };
// exe
if (Path.GetExtension(item).Equals(".exe", StringComparison.CurrentCultureIgnoreCase))
{
if (File.Exists(item))
{
try
{
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(item);
if (fvi != null)
{
model.Title = fvi.ProductName;
}
}
catch
{
// do nothing
}
}
model.Title = (string.IsNullOrWhiteSpace(model.Title) ? "Untitled" : Path.GetFileNameWithoutExtension(item));
}
listBox1.ListBox.Items.Add(model); listBox1.ListBox.Items.Add(model);
} }
} }

242
EditGroupForm.cs Normal file
View File

@ -0,0 +1,242 @@
using System;
using System.Windows.Forms;
using RokettoLaunch.Models.SaveFile;
using RokettoLaunch.Windows.Forms;
using RyzStudio.Windows.Forms;
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
using RyzStudio.Windows.ThemedForms.PickerBox;
namespace RokettoLaunch
{
public class EditGroupForm : Form
{
private Label label2;
private Label label1;
private ThYesNoPickerBox pickerBox1;
private ThClearableTextBox textBox1;
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
private THorizontalSeparator horizontalSeparator1;
private RyzStudio.Windows.ThemedForms.ThNumericBox numericBox1;
private Label label4;
private RyzStudio.Windows.ThemedForms.ThNumericBox numericBox2;
private Label label3;
private App4Options.Group result = null;
public EditGroupForm(App4Options.Group model = null)
{
InitializeComponent();
UISetup.Dialog(this, true);
this.Text = (result == null) ? "Add Group" : "Edit Group";
result = model;
pickerBox1.Setup([ "No", "Yes" ], 0);
numericBox1.Minimum = TileLayoutPanel.MIN_COLUMNS;
numericBox1.Maximum = 32;
numericBox2.Minimum = 1;
numericBox2.Maximum = 32;
}
protected override void OnShown(EventArgs e)
{
base.OnShown(e);
textBox1.Text = result?.Title?.Trim() ?? "New Group";
pickerBox1.Value = result?.IsOpen ?? true;
numericBox1.Value = Math.Max(TileLayoutPanel.MIN_COLUMNS, result?.GridSize.Width ?? TileLayoutPanel.MIN_COLUMNS);
numericBox2.Value = Math.Max(1, result?.GridSize.Height ?? 1);
}
private void InitializeComponent()
{
textBox1 = new ThClearableTextBox();
label2 = new Label();
label1 = new Label();
pickerBox1 = new ThYesNoPickerBox();
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
horizontalSeparator1 = new THorizontalSeparator();
numericBox1 = new RyzStudio.Windows.ThemedForms.ThNumericBox();
label4 = new Label();
numericBox2 = new RyzStudio.Windows.ThemedForms.ThNumericBox();
label3 = new Label();
SuspendLayout();
//
// textBox1
//
textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
textBox1.BackColor = System.Drawing.Color.Transparent;
textBox1.ClearedValue = "";
textBox1.EnableMovable = false;
textBox1.Icon = "O";
textBox1.IconSize = 13F;
textBox1.Location = new System.Drawing.Point(115, 20);
textBox1.Name = "textBox1";
textBox1.Size = new System.Drawing.Size(260, 32);
textBox1.TabIndex = 152;
textBox1.TabStop = false;
textBox1.UseSystemPasswordChar = false;
//
// label2
//
label2.AutoSize = true;
label2.BackColor = System.Drawing.Color.Transparent;
label2.ForeColor = System.Drawing.SystemColors.ControlText;
label2.Location = new System.Drawing.Point(10, 62);
label2.Margin = new Padding(0);
label2.Name = "label2";
label2.Padding = new Padding(0, 9, 0, 0);
label2.Size = new System.Drawing.Size(91, 24);
label2.TabIndex = 155;
label2.Text = "Show Expanded";
label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label1
//
label1.AutoSize = true;
label1.BackColor = System.Drawing.Color.Transparent;
label1.ForeColor = System.Drawing.SystemColors.ControlText;
label1.Location = new System.Drawing.Point(10, 20);
label1.Margin = new Padding(0);
label1.Name = "label1";
label1.Padding = new Padding(0, 9, 0, 0);
label1.Size = new System.Drawing.Size(29, 24);
label1.TabIndex = 153;
label1.Text = "Title";
label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// pickerBox1
//
pickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
pickerBox1.BackColor = System.Drawing.Color.Transparent;
pickerBox1.EnableMovable = false;
pickerBox1.Location = new System.Drawing.Point(295, 62);
pickerBox1.Name = "pickerBox1";
pickerBox1.SelectedIndex = 0;
pickerBox1.Size = new System.Drawing.Size(80, 32);
pickerBox1.TabIndex = 174;
pickerBox1.TabStop = false;
pickerBox1.Value = false;
//
// dialogFooter1
//
dialogFooter1.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
dialogFooter1.Dock = DockStyle.Bottom;
dialogFooter1.EnableMovable = false;
dialogFooter1.IsBusy = false;
dialogFooter1.Location = new System.Drawing.Point(0, 451);
dialogFooter1.Name = "dialogFooter1";
dialogFooter1.Size = new System.Drawing.Size(384, 70);
dialogFooter1.TabIndex = 0;
dialogFooter1.TabStop = false;
//
// horizontalSeparator1
//
horizontalSeparator1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
horizontalSeparator1.Location = new System.Drawing.Point(5, 99);
horizontalSeparator1.Name = "horizontalSeparator1";
horizontalSeparator1.Size = new System.Drawing.Size(375, 10);
//
// numericBox1
//
numericBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
numericBox1.BackColor = System.Drawing.Color.Transparent;
numericBox1.EnableMovable = false;
numericBox1.Location = new System.Drawing.Point(275, 116);
numericBox1.Maximum = 20;
numericBox1.Minimum = 4;
numericBox1.Name = "numericBox1";
numericBox1.Size = new System.Drawing.Size(100, 32);
numericBox1.TabIndex = 198;
numericBox1.TabStop = false;
numericBox1.Value = 1;
//
// label4
//
label4.AutoSize = true;
label4.BackColor = System.Drawing.Color.Transparent;
label4.ForeColor = System.Drawing.SystemColors.ControlText;
label4.Location = new System.Drawing.Point(10, 116);
label4.Margin = new Padding(0);
label4.Name = "label4";
label4.Padding = new Padding(0, 8, 0, 0);
label4.Size = new System.Drawing.Size(76, 23);
label4.TabIndex = 197;
label4.Text = "Tiles Per Row";
label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// numericBox2
//
numericBox2.Anchor = AnchorStyles.Top | AnchorStyles.Right;
numericBox2.BackColor = System.Drawing.Color.Transparent;
numericBox2.EnableMovable = false;
numericBox2.Location = new System.Drawing.Point(275, 158);
numericBox2.Maximum = 32;
numericBox2.Minimum = 1;
numericBox2.Name = "numericBox2";
numericBox2.Size = new System.Drawing.Size(100, 32);
numericBox2.TabIndex = 200;
numericBox2.TabStop = false;
numericBox2.Value = 1;
//
// label3
//
label3.AutoSize = true;
label3.BackColor = System.Drawing.Color.Transparent;
label3.ForeColor = System.Drawing.SystemColors.ControlText;
label3.Location = new System.Drawing.Point(10, 158);
label3.Margin = new Padding(0);
label3.Name = "label3";
label3.Padding = new Padding(0, 8, 0, 0);
label3.Size = new System.Drawing.Size(96, 23);
label3.TabIndex = 199;
label3.Text = "Number of Rows";
label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// EditGroupForm
//
BackColor = System.Drawing.Color.White;
ClientSize = new System.Drawing.Size(384, 521);
Controls.Add(numericBox2);
Controls.Add(label3);
Controls.Add(numericBox1);
Controls.Add(label4);
Controls.Add(horizontalSeparator1);
Controls.Add(dialogFooter1);
Controls.Add(pickerBox1);
Controls.Add(label2);
Controls.Add(label1);
Controls.Add(textBox1);
MinimumSize = new System.Drawing.Size(400, 560);
Name = "EditGroupForm";
Text = "Edit Section";
ResumeLayout(false);
PerformLayout();
}
public App4Options.Group Result
{
get
{
if (result == null)
{
result = new App4Options.Group();
}
var maxGridSize = result.GetMaxGridSize();
var x = Math.Max(maxGridSize.Width, numericBox1.Value);
var y = Math.Max(maxGridSize.Height, numericBox2.Value);
result.Title = textBox1.Text?.Trim() ?? string.Empty;
result.IsOpen = pickerBox1.Value;
result.GridSize = new System.Drawing.Size(x, y);
return result;
}
}
}
}

120
EditGroupForm.resx Normal file
View File

@ -0,0 +1,120 @@
<?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>
</root>

View File

@ -1,158 +0,0 @@
using System.Windows.Forms;
using RokettoLaunch.Models;
using RyzStudio.Windows.Forms;
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
using RyzStudio.Windows.ThemedForms.PickerBox;
namespace RokettoLaunch
{
public class EditSectionForm : Form
{
private Label label2;
private Label label1;
private ThYesNoPickerBox pickerBox1;
private ThClearableTextBox textBox1;
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
private TileGroupModel result = null;
public EditSectionForm(TileGroupModel model = null)
{
InitializeComponent();
UISetup.Dialog(this);
this.Text = (result == null) ? "Add Group" : "Edit Group";
result = model;
pickerBox1.ComboBox.Items.Clear();
pickerBox1.ComboBox.Items.AddRange(new string[] { "No", "Yes" });
if (pickerBox1.ComboBox.Items.Count > 0)
{
pickerBox1.ComboBox.SelectedIndex = 0;
}
if (result != null)
{
textBox1.Text = result.Title?.Trim() ?? string.Empty;
pickerBox1.Value = result.IsExpanded;
}
}
private void InitializeComponent()
{
textBox1 = new ThClearableTextBox();
label2 = new Label();
label1 = new Label();
pickerBox1 = new ThYesNoPickerBox();
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
SuspendLayout();
//
// textBox1
//
textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
textBox1.BackColor = System.Drawing.Color.Transparent;
textBox1.ClearedValue = "";
textBox1.EnableReactiveVisual = true;
textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
textBox1.Icon = "O";
textBox1.IconSize = 13F;
textBox1.Location = new System.Drawing.Point(192, 20);
textBox1.Name = "textBox1";
textBox1.Padding = new Padding(4, 4, 3, 3);
textBox1.Size = new System.Drawing.Size(177, 32);
textBox1.TabIndex = 152;
textBox1.TabStop = false;
textBox1.UseSystemPasswordChar = false;
//
// label2
//
label2.AutoSize = true;
label2.BackColor = System.Drawing.Color.Transparent;
label2.ForeColor = System.Drawing.SystemColors.ControlText;
label2.Location = new System.Drawing.Point(10, 62);
label2.Margin = new Padding(0);
label2.Name = "label2";
label2.Padding = new Padding(0, 9, 0, 0);
label2.Size = new System.Drawing.Size(91, 24);
label2.TabIndex = 155;
label2.Text = "Show Expanded";
label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label1
//
label1.AutoSize = true;
label1.BackColor = System.Drawing.Color.Transparent;
label1.ForeColor = System.Drawing.SystemColors.ControlText;
label1.Location = new System.Drawing.Point(10, 20);
label1.Margin = new Padding(0);
label1.Name = "label1";
label1.Padding = new Padding(0, 9, 0, 0);
label1.Size = new System.Drawing.Size(29, 24);
label1.TabIndex = 153;
label1.Text = "Title";
label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// pickerBox1
//
pickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
pickerBox1.BackColor = System.Drawing.Color.Transparent;
pickerBox1.EnableReactiveVisual = true;
pickerBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
pickerBox1.Location = new System.Drawing.Point(285, 62);
pickerBox1.Name = "pickerBox1";
pickerBox1.Padding = new Padding(4, 4, 3, 3);
pickerBox1.SelectedIndex = 0;
pickerBox1.Size = new System.Drawing.Size(84, 34);
pickerBox1.TabIndex = 174;
pickerBox1.TabStop = false;
pickerBox1.Value = false;
//
// dialogFooter1
//
dialogFooter1.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
dialogFooter1.Button1Text = "&Save";
dialogFooter1.Dialog = this;
dialogFooter1.Dock = DockStyle.Bottom;
dialogFooter1.IsBusy = false;
dialogFooter1.Location = new System.Drawing.Point(0, 437);
dialogFooter1.Name = "dialogFooter1";
dialogFooter1.Size = new System.Drawing.Size(384, 84);
//
// EditSectionForm
//
BackColor = System.Drawing.Color.White;
ClientSize = new System.Drawing.Size(384, 521);
Controls.Add(dialogFooter1);
Controls.Add(pickerBox1);
Controls.Add(label2);
Controls.Add(label1);
Controls.Add(textBox1);
MinimumSize = new System.Drawing.Size(400, 560);
Name = "EditSectionForm";
Text = "Edit Section";
ResumeLayout(false);
PerformLayout();
}
public TileGroupModel Result
{
get
{
if (result == null)
{
result = new TileGroupModel();
}
result.Title = textBox1.Text?.Trim() ?? string.Empty;
result.IsExpanded = pickerBox1.Value;
return result;
}
}
}
}

View File

@ -1,7 +1,8 @@
using System.Diagnostics; using System;
using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using RokettoLaunch.Models; using RokettoLaunch.Models.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;
@ -17,9 +18,9 @@ namespace RokettoLaunch
private Label label3; private Label label3;
private Label label2; private Label label2;
private Label label1; private Label label1;
private ThPathDialogTextBox textBox2; private ThPathTextBox textBox2;
private ThClearableTextBox textBox3; private ThClearableTextBox textBox3;
private ThPathDialogTextBox textBox4; private ThPathTextBox textBox4;
private ThPickerBox pickerBox1; private ThPickerBox pickerBox1;
private ThYesNoPickerBox pickerBox2; private ThYesNoPickerBox pickerBox2;
private THorizontalSeparator horizontalSeparator1; private THorizontalSeparator horizontalSeparator1;
@ -27,32 +28,32 @@ namespace RokettoLaunch
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1; private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
private TileModel result = null; private App4Options.Item result = null;
public EditTileForm(TileModel model = null) public EditTileForm(App4Options.Item model = null)
{ {
InitializeComponent(); InitializeComponent();
UISetup.Dialog(this); UISetup.Dialog(this, true);
this.Text = (result == null) ? "Add Tile" : "Edit Tile"; this.Text = (result == null) ? "Add Tile" : "Edit Tile";
result = model; result = model;
pickerBox1.ComboBox.Items.Clear(); pickerBox1.Setup([ "Normal", "Hidden", "Minimized", "Maximized" ], 0);
pickerBox1.ComboBox.Items.AddRange(new string[] { "Normal", "Hidden", "Minimized", "Maximized" }); }
if (pickerBox1.ComboBox.Items.Count > 0)
{ protected override void OnShown(EventArgs e)
pickerBox1.ComboBox.SelectedIndex = 0; {
} base.OnShown(e);
textBox1.Text = result?.Title ?? "New Tile"; textBox1.Text = result?.Title ?? "New Tile";
textBox2.Text = result?.ProcessFilename ?? string.Empty; textBox2.Text = result?.TargetPath ?? string.Empty;
textBox3.Text = result?.ProcessArgument ?? string.Empty; textBox3.Text = result?.Argument ?? string.Empty;
textBox4.Text = result?.ProcessWorkingDirectory ?? string.Empty; textBox4.Text = result?.ResolvedStartPath ?? string.Empty;
pickerBox1.ComboBox.SelectedIndex = (int)(result?.ProcessWindowStyle ?? ProcessWindowStyle.Normal); pickerBox1.Value = (int)(result?.WindowStyle ?? ProcessWindowStyle.Normal);
pickerBox2.Value = result?.ProcessAsAdmin ?? false; pickerBox2.Value = result?.RunAsAdmin ?? false;
} }
private void InitializeComponent() private void InitializeComponent()
@ -64,9 +65,9 @@ namespace RokettoLaunch
label3 = new Label(); label3 = new Label();
label2 = new Label(); label2 = new Label();
label1 = new Label(); label1 = new Label();
textBox2 = new ThPathDialogTextBox(); textBox2 = new ThPathTextBox();
textBox3 = new ThClearableTextBox(); textBox3 = new ThClearableTextBox();
textBox4 = new ThPathDialogTextBox(); textBox4 = new ThPathTextBox();
pickerBox1 = new ThPickerBox(); pickerBox1 = new ThPickerBox();
pickerBox2 = new ThYesNoPickerBox(); pickerBox2 = new ThYesNoPickerBox();
horizontalSeparator1 = new THorizontalSeparator(); horizontalSeparator1 = new THorizontalSeparator();
@ -78,13 +79,12 @@ namespace RokettoLaunch
textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
textBox1.BackColor = Color.Transparent; textBox1.BackColor = Color.Transparent;
textBox1.ClearedValue = ""; textBox1.ClearedValue = "";
textBox1.EnableReactiveVisual = true; textBox1.EnableMovable = false;
textBox1.Font = new Font("Segoe UI", 9F);
textBox1.Icon = "O"; textBox1.Icon = "O";
textBox1.IconSize = 13F; textBox1.IconSize = 13F;
textBox1.Location = new Point(109, 20); textBox1.Location = new Point(95, 20);
textBox1.Name = "textBox1"; textBox1.Name = "textBox1";
textBox1.Size = new Size(260, 32); textBox1.Size = new Size(280, 32);
textBox1.TabIndex = 152; textBox1.TabIndex = 152;
textBox1.TabStop = false; textBox1.TabStop = false;
textBox1.UseSystemPasswordChar = false; textBox1.UseSystemPasswordChar = false;
@ -94,7 +94,7 @@ namespace RokettoLaunch
label6.AutoSize = true; label6.AutoSize = true;
label6.BackColor = Color.Transparent; label6.BackColor = Color.Transparent;
label6.ForeColor = SystemColors.ControlText; label6.ForeColor = SystemColors.ControlText;
label6.Location = new Point(10, 264); label6.Location = new Point(10, 242);
label6.Margin = new Padding(0); label6.Margin = new Padding(0);
label6.Name = "label6"; label6.Name = "label6";
label6.Padding = new Padding(0, 9, 0, 0); label6.Padding = new Padding(0, 9, 0, 0);
@ -108,7 +108,7 @@ namespace RokettoLaunch
label7.AutoSize = true; label7.AutoSize = true;
label7.BackColor = Color.Transparent; label7.BackColor = Color.Transparent;
label7.ForeColor = SystemColors.ControlText; label7.ForeColor = SystemColors.ControlText;
label7.Location = new Point(10, 220); label7.Location = new Point(10, 200);
label7.Margin = new Padding(0); label7.Margin = new Padding(0);
label7.Name = "label7"; label7.Name = "label7";
label7.Padding = new Padding(0, 9, 0, 0); label7.Padding = new Padding(0, 9, 0, 0);
@ -126,9 +126,9 @@ namespace RokettoLaunch
label4.Margin = new Padding(0); label4.Margin = new Padding(0);
label4.Name = "label4"; label4.Name = "label4";
label4.Padding = new Padding(0, 9, 0, 0); label4.Padding = new Padding(0, 9, 0, 0);
label4.Size = new Size(103, 24); label4.Size = new Size(82, 24);
label4.TabIndex = 159; label4.TabIndex = 159;
label4.Text = "Working Directory"; label4.Text = "Start Directory";
label4.TextAlign = ContentAlignment.MiddleLeft; label4.TextAlign = ContentAlignment.MiddleLeft;
// //
// label3 // label3
@ -177,16 +177,13 @@ namespace RokettoLaunch
// //
textBox2.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; textBox2.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
textBox2.BackColor = Color.Transparent; textBox2.BackColor = Color.Transparent;
textBox2.DialogMode = ThPathDialogTextBox.DialogType.OpenFile; textBox2.DialogMode = ThPathTextBox.DialogType.OpenFile;
textBox2.EnableReactiveVisual = true; textBox2.EnableMovable = false;
textBox2.FolderBrowserDialog = null; textBox2.FolderBrowserDialog = null;
textBox2.Font = new Font("Segoe UI", 9F); textBox2.Icon = "D";
textBox2.Icon = "C";
textBox2.IconSize = 13F; textBox2.IconSize = 13F;
textBox2.Location = new Point(109, 62); textBox2.Location = new Point(115, 62);
textBox2.Name = "textBox2"; textBox2.Name = "textBox2";
textBox2.OpenFileDialog = null;
textBox2.SaveFileDialog = null;
textBox2.Size = new Size(260, 32); textBox2.Size = new Size(260, 32);
textBox2.TabIndex = 170; textBox2.TabIndex = 170;
textBox2.TabStop = false; textBox2.TabStop = false;
@ -197,13 +194,12 @@ namespace RokettoLaunch
textBox3.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; textBox3.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
textBox3.BackColor = Color.Transparent; textBox3.BackColor = Color.Transparent;
textBox3.ClearedValue = ""; textBox3.ClearedValue = "";
textBox3.EnableReactiveVisual = true; textBox3.EnableMovable = false;
textBox3.Font = new Font("Segoe UI", 9F);
textBox3.Icon = "O"; textBox3.Icon = "O";
textBox3.IconSize = 13F; textBox3.IconSize = 13F;
textBox3.Location = new Point(149, 104); textBox3.Location = new Point(135, 104);
textBox3.Name = "textBox3"; textBox3.Name = "textBox3";
textBox3.Size = new Size(220, 32); textBox3.Size = new Size(240, 32);
textBox3.TabIndex = 171; textBox3.TabIndex = 171;
textBox3.TabStop = false; textBox3.TabStop = false;
textBox3.UseSystemPasswordChar = false; textBox3.UseSystemPasswordChar = false;
@ -212,17 +208,14 @@ namespace RokettoLaunch
// //
textBox4.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; textBox4.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
textBox4.BackColor = Color.Transparent; textBox4.BackColor = Color.Transparent;
textBox4.DialogMode = ThPathDialogTextBox.DialogType.FolderBrowser; textBox4.DialogMode = ThPathTextBox.DialogType.FolderBrowser;
textBox4.EnableReactiveVisual = true; textBox4.EnableMovable = false;
textBox4.FolderBrowserDialog = null; textBox4.FolderBrowserDialog = null;
textBox4.Font = new Font("Segoe UI", 9F);
textBox4.Icon = "D"; textBox4.Icon = "D";
textBox4.IconSize = 13F; textBox4.IconSize = 13F;
textBox4.Location = new Point(149, 146); textBox4.Location = new Point(135, 146);
textBox4.Name = "textBox4"; textBox4.Name = "textBox4";
textBox4.OpenFileDialog = null; textBox4.Size = new Size(240, 32);
textBox4.SaveFileDialog = null;
textBox4.Size = new Size(220, 32);
textBox4.TabIndex = 172; textBox4.TabIndex = 172;
textBox4.TabStop = false; textBox4.TabStop = false;
textBox4.UseSystemPasswordChar = false; textBox4.UseSystemPasswordChar = false;
@ -231,12 +224,11 @@ namespace RokettoLaunch
// //
pickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right; pickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
pickerBox1.BackColor = Color.Transparent; pickerBox1.BackColor = Color.Transparent;
pickerBox1.EnableReactiveVisual = true; pickerBox1.EnableMovable = false;
pickerBox1.Font = new Font("Segoe UI", 9F); pickerBox1.Location = new Point(255, 200);
pickerBox1.Location = new Point(249, 220);
pickerBox1.Name = "pickerBox1"; pickerBox1.Name = "pickerBox1";
pickerBox1.SelectedIndex = -1; pickerBox1.SelectedIndex = -1;
pickerBox1.Size = new Size(120, 34); pickerBox1.Size = new Size(120, 32);
pickerBox1.TabIndex = 174; pickerBox1.TabIndex = 174;
pickerBox1.TabStop = false; pickerBox1.TabStop = false;
// //
@ -244,12 +236,11 @@ namespace RokettoLaunch
// //
pickerBox2.Anchor = AnchorStyles.Top | AnchorStyles.Right; pickerBox2.Anchor = AnchorStyles.Top | AnchorStyles.Right;
pickerBox2.BackColor = Color.Transparent; pickerBox2.BackColor = Color.Transparent;
pickerBox2.EnableReactiveVisual = true; pickerBox2.EnableMovable = false;
pickerBox2.Font = new Font("Segoe UI", 9F); pickerBox2.Location = new Point(295, 242);
pickerBox2.Location = new Point(289, 264);
pickerBox2.Name = "pickerBox2"; pickerBox2.Name = "pickerBox2";
pickerBox2.SelectedIndex = 0; pickerBox2.SelectedIndex = 0;
pickerBox2.Size = new Size(80, 34); pickerBox2.Size = new Size(80, 32);
pickerBox2.TabIndex = 175; pickerBox2.TabIndex = 175;
pickerBox2.TabStop = false; pickerBox2.TabStop = false;
pickerBox2.Value = false; pickerBox2.Value = false;
@ -257,27 +248,21 @@ namespace RokettoLaunch
// horizontalSeparator1 // horizontalSeparator1
// //
horizontalSeparator1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; horizontalSeparator1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
horizontalSeparator1.AutoScrollMargin = new Size(0, 0); horizontalSeparator1.Location = new Point(5, 183);
horizontalSeparator1.AutoScrollMinSize = new Size(0, 0);
horizontalSeparator1.BackColor = Color.Transparent;
horizontalSeparator1.Location = new Point(10, 187);
horizontalSeparator1.Margin = new Padding(0, 10, 0, 0);
horizontalSeparator1.MaximumSize = new Size(4920, 2);
horizontalSeparator1.MinimumSize = new Size(0, 22);
horizontalSeparator1.Name = "horizontalSeparator1"; horizontalSeparator1.Name = "horizontalSeparator1";
horizontalSeparator1.Size = new Size(364, 22); horizontalSeparator1.Size = new Size(375, 10);
horizontalSeparator1.TabIndex = 176;
horizontalSeparator1.TabStop = false;
// //
// dialogFooter1 // dialogFooter1
// //
dialogFooter1.BackColor = Color.FromArgb(240, 240, 240); dialogFooter1.BackColor = Color.FromArgb(240, 240, 240);
dialogFooter1.Button1Text = "&Save";
dialogFooter1.Dialog = this;
dialogFooter1.Dock = DockStyle.Bottom; dialogFooter1.Dock = DockStyle.Bottom;
dialogFooter1.Location = new Point(0, 437); dialogFooter1.EnableMovable = false;
dialogFooter1.IsBusy = false;
dialogFooter1.Location = new Point(0, 451);
dialogFooter1.Name = "dialogFooter1"; dialogFooter1.Name = "dialogFooter1";
dialogFooter1.Size = new Size(384, 84); dialogFooter1.Size = new Size(384, 70);
dialogFooter1.TabIndex = 0;
dialogFooter1.TabStop = false;
// //
// EditTileForm // EditTileForm
// //
@ -304,21 +289,21 @@ namespace RokettoLaunch
PerformLayout(); PerformLayout();
} }
public TileModel Result public App4Options.Item Result
{ {
get get
{ {
if (result == null) if (result == null)
{ {
result = new TileModel(); result = new App4Options.Item();
} }
result.Title = textBox1.Text?.Trim() ?? string.Empty; result.Title = textBox1.Text?.Trim() ?? string.Empty;
result.ProcessFilename = textBox2.Text?.Trim() ?? string.Empty; result.TargetPath = textBox2.Text?.Trim() ?? string.Empty;
result.ProcessArgument = textBox3.Text?.Trim() ?? string.Empty; result.Argument = textBox3.Text?.Trim() ?? string.Empty;
result.ProcessWorkingDirectory = textBox4.Text?.Trim(); result.StartPath = textBox4.Text?.Trim();
result.ProcessWindowStyle = (System.Diagnostics.ProcessWindowStyle)pickerBox1.ComboBox.SelectedIndex; result.WindowStyle = (ProcessWindowStyle)pickerBox1.ComboBox.SelectedIndex;
result.ProcessAsAdmin = pickerBox2.Value; result.RunAsAdmin = pickerBox2.Value;
return result; return result;
} }

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 2.0 Version 2.0
@ -48,7 +48,7 @@
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter : System.Runtime.Serialization.Formatters.Soap.SoapFormatter

321
LoadingForm.cs Normal file
View File

@ -0,0 +1,321 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using System.Windows.Forms;
using RokettoLaunch.Models.SaveFile;
using RyzStudio.Windows.Forms;
namespace RokettoLaunch
{
public class LoadingForm : Form
{
private TProgressBar progressBar1;
private RyzStudio.Windows.ThemedForms.ThUserControl userControl1;
private RyzStudio.Windows.ThemedForms.ThUserControl userControl2;
private TProgressBar progressBar2;
private App4Options result = null;
private Label label1;
private Label label2;
private string loadFilename = "";
public LoadingForm()
{
InitializeComponent();
UISetup.Dialog(this, true);
this.Text = "Loading";
}
private void InitializeComponent()
{
progressBar1 = new TProgressBar();
userControl1 = new RyzStudio.Windows.ThemedForms.ThUserControl();
userControl2 = new RyzStudio.Windows.ThemedForms.ThUserControl();
progressBar2 = new TProgressBar();
label1 = new Label();
label2 = new Label();
userControl1.SuspendLayout();
userControl2.SuspendLayout();
SuspendLayout();
//
// progressBar1
//
progressBar1.BarColour = System.Drawing.Color.FromArgb(158, 225, 249);
progressBar1.Dock = DockStyle.Fill;
progressBar1.EnableMovable = false;
progressBar1.Location = new System.Drawing.Point(3, 3);
progressBar1.Maximum = 100;
progressBar1.Minimum = 0;
progressBar1.Name = "progressBar1";
progressBar1.OnProgressChanged = null;
progressBar1.ShowText = true;
progressBar1.Size = new System.Drawing.Size(418, 18);
progressBar1.TabIndex = 156;
progressBar1.Value = 25;
//
// userControl1
//
userControl1.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
userControl1.BackColor = System.Drawing.Color.Transparent;
userControl1.Controls.Add(progressBar1);
userControl1.EnableMovable = false;
userControl1.Location = new System.Drawing.Point(10, 64);
userControl1.Name = "userControl1";
userControl1.Size = new System.Drawing.Size(424, 24);
userControl1.TabIndex = 157;
//
// userControl2
//
userControl2.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
userControl2.BackColor = System.Drawing.Color.Transparent;
userControl2.Controls.Add(progressBar2);
userControl2.EnableMovable = false;
userControl2.Location = new System.Drawing.Point(10, 98);
userControl2.Name = "userControl2";
userControl2.Size = new System.Drawing.Size(424, 24);
userControl2.TabIndex = 158;
//
// progressBar2
//
progressBar2.BarColour = System.Drawing.Color.FromArgb(158, 225, 249);
progressBar2.Dock = DockStyle.Fill;
progressBar2.EnableMovable = false;
progressBar2.Location = new System.Drawing.Point(3, 3);
progressBar2.Maximum = 100;
progressBar2.Minimum = 0;
progressBar2.Name = "progressBar2";
progressBar2.OnProgressChanged = null;
progressBar2.ShowText = true;
progressBar2.Size = new System.Drawing.Size(418, 18);
progressBar2.TabIndex = 156;
progressBar2.Value = 25;
//
// label1
//
label1.AutoSize = true;
label1.Location = new System.Drawing.Point(10, 20);
label1.Name = "label1";
label1.Size = new System.Drawing.Size(59, 15);
label1.TabIndex = 159;
label1.Text = "Loading...";
//
// label2
//
label2.AutoSize = true;
label2.Location = new System.Drawing.Point(10, 40);
label2.Name = "label2";
label2.Size = new System.Drawing.Size(59, 15);
label2.TabIndex = 160;
label2.Text = "Loading...";
//
// LoadingForm
//
BackColor = System.Drawing.Color.White;
ClientSize = new System.Drawing.Size(444, 141);
Controls.Add(label2);
Controls.Add(label1);
Controls.Add(userControl2);
Controls.Add(userControl1);
Name = "LoadingForm";
Text = "Edit Section";
userControl1.ResumeLayout(false);
userControl2.ResumeLayout(false);
ResumeLayout(false);
PerformLayout();
}
protected async override void OnShown(EventArgs e)
{
base.OnShown(e);
await Task.Run(async () =>
{
this.Clear();
UIControl.SetText(label1, "Loading...");
UIControl.SetText(label2, "... " + Path.GetFileName(loadFilename));
var newSession = await LoadSaveSessionWithVersion(loadFilename);
// Update progress bars
progressBar1.Maximum = newSession.Groups?.Count ?? 0;
progressBar2.Maximum = 0;
UIControl.SetText(label1, "Counting...");
UIControl.SetText(label2, "");
foreach (var group in newSession?.Groups ?? new List<App4Options.Group>())
{
UIControl.SetText(label2, "... " + group.Title);
foreach (var item in group?.Items ?? new List<App4Options.Item>())
{
if (item.IsGroup)
{
progressBar2.Maximum += item.Items?.Count ?? 0;
}
else
{
progressBar2.Maximum++;
}
}
}
// Resolve paths
progressBar2.Value = 0;
UIControl.SetText(label1, "Seeking...");
UIControl.SetText(label2, "");
// Resolve paths
foreach (var group in newSession?.Groups ?? new List<App4Options.Group>())
{
foreach (var item in group?.Items ?? new List<App4Options.Item>())
{
progressBar1.Value++;
UIControl.SetText(label2, "... " + group.Title);
if (item.IsGroup)
{
foreach (var subItem in item.Items ?? new List<App4Options.Item>())
{
progressBar2.Value++;
UIControl.SetText(label2, "... " + subItem.Title);
subItem.ResolvePaths();
}
}
else
{
progressBar2.Value++;
UIControl.SetText(label2, "... " + item.Title);
item.ResolvePaths();
}
}
}
result = newSession;
UIControl.SetText(label1, "Done");
UIControl.SetText(label2, "Done");
});
this.DialogResult = DialogResult.OK;
}
protected override void OnFormClosing(FormClosingEventArgs e)
{
base.OnFormClosing(e);
if (this.DialogResult != DialogResult.OK)
{
e.Cancel = true;
}
}
public App4Options Result
{
get => result ?? new App4Options();
}
public async Task<DialogResult> ShowDialog(string filename)
{
loadFilename = filename;
return this.ShowDialog();
}
public void Clear()
{
UIControl.SetText(label1, "Ready");
UIControl.SetText(label2, "");
progressBar1.Value = progressBar1.Maximum = 0;
progressBar2.Value = progressBar2.Maximum = 0;
}
private async Task<App4Options> LoadSaveSessionWithVersion(string filename)
{
var result = new App4Options();
if (string.IsNullOrWhiteSpace(filename))
{
return result;
}
var fileExtension = Path.GetExtension(filename?.ToLower()?.Trim() ?? string.Empty);
if (string.IsNullOrWhiteSpace(fileExtension))
{
return result;
}
// Load session, assume version 3.
App3Options loadSession = null;
switch (fileExtension)
{
case ".json":
case ".jsonfig":
loadSession = await RyzStudio.Text.Json.JsonSerialiser.DeserialiseFile<App3Options>(filename);
break;
case ".jsnx":
loadSession = await RyzStudio.IO.Compression.ZFile.ReadFile<App3Options>(filename, "Document.json");
break;
default:
break;
}
if (loadSession == null)
{
return result;
}
// File likely not correct schema.
if (loadSession.FileVersion <= 0)
{
return result;
}
// Load session, if version 4.
if (loadSession.FileVersion == 4)
{
switch (fileExtension)
{
case ".json":
case ".jsonfig":
result = await RyzStudio.Text.Json.JsonSerialiser.DeserialiseFile<App4Options>(filename);
break;
case ".jsnx":
result = await RyzStudio.IO.Compression.ZFile.ReadFile<App4Options>(filename, "Document.json");
break;
default:
break;
}
}
if (result == null)
{
return new App4Options();
}
// Convert version 3 to 4.
if (loadSession.FileVersion == 3)
{
result.Load(loadSession);
}
return result;
}
}
}

120
LoadingForm.resx Normal file
View File

@ -0,0 +1,120 @@
<?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>
</root>

163
MainForm.Designer.cs generated
View File

@ -35,7 +35,7 @@ namespace RokettoLaunch
saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
notifyIcon1 = new System.Windows.Forms.NotifyIcon(components); notifyIcon1 = new System.Windows.Forms.NotifyIcon(components);
contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(components); trayMenuStrip = new System.Windows.Forms.ContextMenuStrip(components);
exitToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); exitToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
menuStrip1 = new System.Windows.Forms.MenuStrip(); menuStrip1 = new System.Windows.Forms.MenuStrip();
fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -59,7 +59,7 @@ namespace RokettoLaunch
viewHelpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); viewHelpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
toolStripMenuItem16 = new System.Windows.Forms.ToolStripSeparator(); toolStripMenuItem16 = new System.Windows.Forms.ToolStripSeparator();
aboutToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); aboutToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
tileContainerMenu1 = new System.Windows.Forms.ContextMenuStrip(components); groupMenuStrip = new System.Windows.Forms.ContextMenuStrip(components);
addGroupToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); addGroupToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem(); toolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem();
editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -74,16 +74,16 @@ namespace RokettoLaunch
removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
panel1 = new System.Windows.Forms.Panel(); panel1 = new System.Windows.Forms.Panel();
tileMenu1 = new System.Windows.Forms.ContextMenuStrip(components); tileMenuStrip = new System.Windows.Forms.ContextMenuStrip(components);
editToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); editToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
toolStripMenuItem6 = new System.Windows.Forms.ToolStripMenuItem(); toolStripMenuItem6 = new System.Windows.Forms.ToolStripMenuItem();
toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
removeToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); removeToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
contextMenuStrip2.SuspendLayout(); trayMenuStrip.SuspendLayout();
menuStrip1.SuspendLayout(); menuStrip1.SuspendLayout();
tileContainerMenu1.SuspendLayout(); groupMenuStrip.SuspendLayout();
panel1.SuspendLayout(); panel1.SuspendLayout();
tileMenu1.SuspendLayout(); tileMenuStrip.SuspendLayout();
SuspendLayout(); SuspendLayout();
// //
// saveFileDialog1 // saveFileDialog1
@ -98,33 +98,33 @@ namespace RokettoLaunch
// //
// notifyIcon1 // notifyIcon1
// //
notifyIcon1.ContextMenuStrip = contextMenuStrip2; notifyIcon1.ContextMenuStrip = trayMenuStrip;
notifyIcon1.Icon = (System.Drawing.Icon)resources.GetObject("notifyIcon1.Icon"); notifyIcon1.Icon = (System.Drawing.Icon)resources.GetObject("notifyIcon1.Icon");
notifyIcon1.Text = "notifyIcon1"; notifyIcon1.Text = "notifyIcon1";
notifyIcon1.Visible = true; notifyIcon1.Visible = true;
notifyIcon1.MouseClick += notifyIcon1_MouseClick; notifyIcon1.MouseClick += NotifyIcon_MouseClick;
// //
// contextMenuStrip2 // trayMenuStrip
// //
contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { exitToolStripMenuItem1 }); trayMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { exitToolStripMenuItem1 });
contextMenuStrip2.Name = "contextMenuStrip2"; trayMenuStrip.Name = "contextMenuStrip2";
contextMenuStrip2.Size = new System.Drawing.Size(94, 26); trayMenuStrip.Size = new System.Drawing.Size(94, 26);
// //
// exitToolStripMenuItem1 // exitToolStripMenuItem1
// //
exitToolStripMenuItem1.Name = "exitToolStripMenuItem1"; exitToolStripMenuItem1.Name = "exitToolStripMenuItem1";
exitToolStripMenuItem1.Size = new System.Drawing.Size(93, 22); exitToolStripMenuItem1.Size = new System.Drawing.Size(93, 22);
exitToolStripMenuItem1.Text = "E&xit"; exitToolStripMenuItem1.Text = "E&xit";
exitToolStripMenuItem1.Click += exitToolStripMenuItem1_Click; exitToolStripMenuItem1.Click += NotifyExitToolStripMenuItem_Click;
// //
// menuStrip1 // menuStrip1
// //
menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { fileToolStripMenuItem, toolStripMenuItem1, viewToolStripMenuItem, toolsToolStripMenuItem, helpToolStripMenuItem1 }); menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { fileToolStripMenuItem, toolStripMenuItem1, viewToolStripMenuItem, toolsToolStripMenuItem, helpToolStripMenuItem1 });
menuStrip1.Location = new System.Drawing.Point(0, 0); menuStrip1.Location = new System.Drawing.Point(0, 0);
menuStrip1.Name = "menuStrip1"; menuStrip1.Name = "menuStrip1";
menuStrip1.Size = new System.Drawing.Size(404, 24); menuStrip1.Size = new System.Drawing.Size(464, 24);
menuStrip1.TabIndex = 2; menuStrip1.TabIndex = 2;
menuStrip1.MenuActivate += menuStrip1_MenuActivate; menuStrip1.MenuActivate += MainMenuStrip_MenuActivate;
// //
// fileToolStripMenuItem // fileToolStripMenuItem
// //
@ -140,16 +140,16 @@ namespace RokettoLaunch
newToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N; newToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N;
newToolStripMenuItem.Size = new System.Drawing.Size(146, 22); newToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
newToolStripMenuItem.Text = "&New"; newToolStripMenuItem.Text = "&New";
newToolStripMenuItem.Click += newToolStripMenuItem_Click; newToolStripMenuItem.Click += NewToolStripMenuItem_Click;
// //
// openToolStripMenuItem // openToolStripMenuItem
// //
openToolStripMenuItem.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; openToolStripMenuItem.Image = AppResource.folder_minus;
openToolStripMenuItem.Name = "openToolStripMenuItem"; openToolStripMenuItem.Name = "openToolStripMenuItem";
openToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O; openToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O;
openToolStripMenuItem.Size = new System.Drawing.Size(146, 22); openToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
openToolStripMenuItem.Text = "&Open"; openToolStripMenuItem.Text = "&Open";
openToolStripMenuItem.Click += openToolStripMenuItem_Click; openToolStripMenuItem.Click += OpenToolStripMenuItem_Click;
// //
// toolStripMenuItem13 // toolStripMenuItem13
// //
@ -161,7 +161,7 @@ namespace RokettoLaunch
closeToolStripMenuItem.Name = "closeToolStripMenuItem"; closeToolStripMenuItem.Name = "closeToolStripMenuItem";
closeToolStripMenuItem.Size = new System.Drawing.Size(146, 22); closeToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
closeToolStripMenuItem.Text = "&Close"; closeToolStripMenuItem.Text = "&Close";
closeToolStripMenuItem.Click += closeToolStripMenuItem_Click; closeToolStripMenuItem.Click += CloseToolStripMenuItem_Click;
// //
// toolStripMenuItem14 // toolStripMenuItem14
// //
@ -170,19 +170,19 @@ namespace RokettoLaunch
// //
// saveToolStripMenuItem // saveToolStripMenuItem
// //
saveToolStripMenuItem.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; saveToolStripMenuItem.Image = AppResource.save;
saveToolStripMenuItem.Name = "saveToolStripMenuItem"; saveToolStripMenuItem.Name = "saveToolStripMenuItem";
saveToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S; saveToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S;
saveToolStripMenuItem.Size = new System.Drawing.Size(146, 22); saveToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
saveToolStripMenuItem.Text = "&Save"; saveToolStripMenuItem.Text = "&Save";
saveToolStripMenuItem.Click += saveToolStripMenuItem_Click; saveToolStripMenuItem.Click += SaveToolStripMenuItem_Click;
// //
// saveAsToolStripMenuItem // saveAsToolStripMenuItem
// //
saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
saveAsToolStripMenuItem.Size = new System.Drawing.Size(146, 22); saveAsToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
saveAsToolStripMenuItem.Text = "Save &As..."; saveAsToolStripMenuItem.Text = "Save &As...";
saveAsToolStripMenuItem.Click += saveAsToolStripMenuItem_Click; saveAsToolStripMenuItem.Click += SaveAsToolStripMenuItem_Click;
// //
// toolStripMenuItem15 // toolStripMenuItem15
// //
@ -194,7 +194,7 @@ namespace RokettoLaunch
exitToolStripMenuItem2.Name = "exitToolStripMenuItem2"; exitToolStripMenuItem2.Name = "exitToolStripMenuItem2";
exitToolStripMenuItem2.Size = new System.Drawing.Size(146, 22); exitToolStripMenuItem2.Size = new System.Drawing.Size(146, 22);
exitToolStripMenuItem2.Text = "E&xit"; exitToolStripMenuItem2.Text = "E&xit";
exitToolStripMenuItem2.Click += exitToolStripMenuItem2_Click; exitToolStripMenuItem2.Click += ExitToolStripMenuItem_Click;
// //
// toolStripMenuItem1 // toolStripMenuItem1
// //
@ -205,10 +205,11 @@ namespace RokettoLaunch
// //
// addGroupToolStripMenuItem // addGroupToolStripMenuItem
// //
addGroupToolStripMenuItem.Image = AppResource.plus;
addGroupToolStripMenuItem.Name = "addGroupToolStripMenuItem"; addGroupToolStripMenuItem.Name = "addGroupToolStripMenuItem";
addGroupToolStripMenuItem.Size = new System.Drawing.Size(138, 22); addGroupToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
addGroupToolStripMenuItem.Text = "&Add Section"; addGroupToolStripMenuItem.Text = "&Add Group";
addGroupToolStripMenuItem.Click += addGroupToolStripMenuItem_Click; addGroupToolStripMenuItem.Click += AddGroupToolStripMenuItem_Click;
// //
// viewToolStripMenuItem // viewToolStripMenuItem
// //
@ -222,14 +223,14 @@ namespace RokettoLaunch
showBigIconsToolStripMenuItem.Name = "showBigIconsToolStripMenuItem"; showBigIconsToolStripMenuItem.Name = "showBigIconsToolStripMenuItem";
showBigIconsToolStripMenuItem.Size = new System.Drawing.Size(154, 22); showBigIconsToolStripMenuItem.Size = new System.Drawing.Size(154, 22);
showBigIconsToolStripMenuItem.Text = "Show &Big Icons"; showBigIconsToolStripMenuItem.Text = "Show &Big Icons";
showBigIconsToolStripMenuItem.Click += showBigIconsToolStripMenuItem_Click; showBigIconsToolStripMenuItem.Click += ShowBigIconsToolStripMenuItem_Click;
// //
// alwaysOnTopToolStripMenuItem // alwaysOnTopToolStripMenuItem
// //
alwaysOnTopToolStripMenuItem.Name = "alwaysOnTopToolStripMenuItem"; alwaysOnTopToolStripMenuItem.Name = "alwaysOnTopToolStripMenuItem";
alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(154, 22); alwaysOnTopToolStripMenuItem.Size = new System.Drawing.Size(154, 22);
alwaysOnTopToolStripMenuItem.Text = "Always On &Top"; alwaysOnTopToolStripMenuItem.Text = "Always On &Top";
alwaysOnTopToolStripMenuItem.Click += alwaysOnTopToolStripMenuItem_Click; alwaysOnTopToolStripMenuItem.Click += AlwaysOnTopToolStripMenuItem_Click;
// //
// toolsToolStripMenuItem // toolsToolStripMenuItem
// //
@ -240,12 +241,12 @@ namespace RokettoLaunch
// //
// optionsToolStripMenuItem // optionsToolStripMenuItem
// //
optionsToolStripMenuItem.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; optionsToolStripMenuItem.Image = AppResource.settings;
optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
optionsToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F12; optionsToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F12;
optionsToolStripMenuItem.Size = new System.Drawing.Size(168, 22); optionsToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
optionsToolStripMenuItem.Text = "&Options"; optionsToolStripMenuItem.Text = "&Options";
optionsToolStripMenuItem.Click += optionsToolStripMenuItem_Click; optionsToolStripMenuItem.Click += OptionsToolStripMenuItem_Click;
// //
// helpToolStripMenuItem1 // helpToolStripMenuItem1
// //
@ -256,12 +257,12 @@ namespace RokettoLaunch
// //
// viewHelpToolStripMenuItem1 // viewHelpToolStripMenuItem1
// //
viewHelpToolStripMenuItem1.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; viewHelpToolStripMenuItem1.Image = AppResource.help_circle;
viewHelpToolStripMenuItem1.Name = "viewHelpToolStripMenuItem1"; viewHelpToolStripMenuItem1.Name = "viewHelpToolStripMenuItem1";
viewHelpToolStripMenuItem1.ShortcutKeys = System.Windows.Forms.Keys.F1; viewHelpToolStripMenuItem1.ShortcutKeys = System.Windows.Forms.Keys.F1;
viewHelpToolStripMenuItem1.Size = new System.Drawing.Size(146, 22); viewHelpToolStripMenuItem1.Size = new System.Drawing.Size(146, 22);
viewHelpToolStripMenuItem1.Text = "&View Help"; viewHelpToolStripMenuItem1.Text = "&View Help";
viewHelpToolStripMenuItem1.Click += viewHelpToolStripMenuItem1_Click; viewHelpToolStripMenuItem1.Click += ViewHelpToolStripMenuItem_Click;
// //
// toolStripMenuItem16 // toolStripMenuItem16
// //
@ -273,93 +274,95 @@ namespace RokettoLaunch
aboutToolStripMenuItem1.Name = "aboutToolStripMenuItem1"; aboutToolStripMenuItem1.Name = "aboutToolStripMenuItem1";
aboutToolStripMenuItem1.Size = new System.Drawing.Size(146, 22); aboutToolStripMenuItem1.Size = new System.Drawing.Size(146, 22);
aboutToolStripMenuItem1.Text = "&About"; aboutToolStripMenuItem1.Text = "&About";
aboutToolStripMenuItem1.Click += aboutToolStripMenuItem1_Click; aboutToolStripMenuItem1.Click += AboutToolStripMenuItem_Click;
// //
// tileContainerMenu1 // groupMenuStrip
// //
tileContainerMenu1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { addGroupToolStripMenuItem1, toolStripMenuItem4, editToolStripMenuItem, toolStripMenuItem5, toolStripSeparator1, toolStripMenuItem3, toolStripSeparator3, removeToolStripMenuItem }); groupMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { addGroupToolStripMenuItem1, toolStripMenuItem4, editToolStripMenuItem, toolStripMenuItem5, toolStripSeparator1, toolStripMenuItem3, toolStripSeparator3, removeToolStripMenuItem });
tileContainerMenu1.Name = "tileContainerMenu1"; groupMenuStrip.Name = "tileContainerMenu1";
tileContainerMenu1.Size = new System.Drawing.Size(181, 170); groupMenuStrip.Size = new System.Drawing.Size(133, 148);
// //
// addGroupToolStripMenuItem1 // addGroupToolStripMenuItem1
// //
addGroupToolStripMenuItem1.Image = AppResource.plus;
addGroupToolStripMenuItem1.Name = "addGroupToolStripMenuItem1"; addGroupToolStripMenuItem1.Name = "addGroupToolStripMenuItem1";
addGroupToolStripMenuItem1.Size = new System.Drawing.Size(180, 22); addGroupToolStripMenuItem1.Size = new System.Drawing.Size(132, 22);
addGroupToolStripMenuItem1.Text = "&Add Tile"; addGroupToolStripMenuItem1.Text = "&Add Tile";
addGroupToolStripMenuItem1.Click += addGroupToolStripMenuItem1_Click; addGroupToolStripMenuItem1.Click += AddTileToolStripMenuItem_Click;
// //
// toolStripMenuItem4 // toolStripMenuItem4
// //
toolStripMenuItem4.Name = "toolStripMenuItem4"; toolStripMenuItem4.Name = "toolStripMenuItem4";
toolStripMenuItem4.Size = new System.Drawing.Size(180, 22); toolStripMenuItem4.Size = new System.Drawing.Size(132, 22);
toolStripMenuItem4.Text = "Add &Folder"; toolStripMenuItem4.Text = "Add &Folder";
toolStripMenuItem4.Click += toolStripMenuItem4_Click; toolStripMenuItem4.Click += AddFolderToolStripMenuItem_Click;
// //
// editToolStripMenuItem // editToolStripMenuItem
// //
editToolStripMenuItem.Name = "editToolStripMenuItem"; editToolStripMenuItem.Name = "editToolStripMenuItem";
editToolStripMenuItem.Size = new System.Drawing.Size(180, 22); editToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
editToolStripMenuItem.Text = "&Edit"; editToolStripMenuItem.Text = "&Edit";
editToolStripMenuItem.Click += editToolStripMenuItem_Click; editToolStripMenuItem.Click += EditGroupToolStripMenuItem_Click;
// //
// toolStripMenuItem5 // toolStripMenuItem5
// //
toolStripMenuItem5.Name = "toolStripMenuItem5"; toolStripMenuItem5.Name = "toolStripMenuItem5";
toolStripMenuItem5.Size = new System.Drawing.Size(180, 22); toolStripMenuItem5.Size = new System.Drawing.Size(132, 22);
toolStripMenuItem5.Text = "&Duplicate"; toolStripMenuItem5.Text = "&Duplicate";
toolStripMenuItem5.Click += toolStripMenuItem5_Click; toolStripMenuItem5.Click += toolStripMenuItem5_Click;
// //
// toolStripSeparator1 // toolStripSeparator1
// //
toolStripSeparator1.Name = "toolStripSeparator1"; toolStripSeparator1.Name = "toolStripSeparator1";
toolStripSeparator1.Size = new System.Drawing.Size(177, 6); toolStripSeparator1.Size = new System.Drawing.Size(129, 6);
// //
// toolStripMenuItem3 // toolStripMenuItem3
// //
toolStripMenuItem3.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { topToolStripMenuItem, upToolStripMenuItem, downToolStripMenuItem, bottomToolStripMenuItem }); toolStripMenuItem3.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { topToolStripMenuItem, upToolStripMenuItem, downToolStripMenuItem, bottomToolStripMenuItem });
toolStripMenuItem3.Name = "toolStripMenuItem3"; toolStripMenuItem3.Name = "toolStripMenuItem3";
toolStripMenuItem3.Size = new System.Drawing.Size(180, 22); toolStripMenuItem3.Size = new System.Drawing.Size(132, 22);
toolStripMenuItem3.Text = "&Move"; toolStripMenuItem3.Text = "&Move";
// //
// topToolStripMenuItem // topToolStripMenuItem
// //
topToolStripMenuItem.Name = "topToolStripMenuItem"; topToolStripMenuItem.Name = "topToolStripMenuItem";
topToolStripMenuItem.Size = new System.Drawing.Size(180, 22); topToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
topToolStripMenuItem.Text = "&Top"; topToolStripMenuItem.Text = "&Top";
topToolStripMenuItem.Click += topToolStripMenuItem_Click; topToolStripMenuItem.Click += MoveTopToolStripMenuItem_Click;
// //
// upToolStripMenuItem // upToolStripMenuItem
// //
upToolStripMenuItem.Name = "upToolStripMenuItem"; upToolStripMenuItem.Name = "upToolStripMenuItem";
upToolStripMenuItem.Size = new System.Drawing.Size(180, 22); upToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
upToolStripMenuItem.Text = "&Up"; upToolStripMenuItem.Text = "&Up";
upToolStripMenuItem.Click += upToolStripMenuItem_Click; upToolStripMenuItem.Click += MoveUpToolStripMenuItem_Click;
// //
// downToolStripMenuItem // downToolStripMenuItem
// //
downToolStripMenuItem.Name = "downToolStripMenuItem"; downToolStripMenuItem.Name = "downToolStripMenuItem";
downToolStripMenuItem.Size = new System.Drawing.Size(180, 22); downToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
downToolStripMenuItem.Text = "&Down"; downToolStripMenuItem.Text = "&Down";
downToolStripMenuItem.Click += downToolStripMenuItem_Click; downToolStripMenuItem.Click += MoveDownToolStripMenuItem_Click;
// //
// bottomToolStripMenuItem // bottomToolStripMenuItem
// //
bottomToolStripMenuItem.Name = "bottomToolStripMenuItem"; bottomToolStripMenuItem.Name = "bottomToolStripMenuItem";
bottomToolStripMenuItem.Size = new System.Drawing.Size(180, 22); bottomToolStripMenuItem.Size = new System.Drawing.Size(114, 22);
bottomToolStripMenuItem.Text = "&Bottom"; bottomToolStripMenuItem.Text = "&Bottom";
bottomToolStripMenuItem.Click += bottomToolStripMenuItem_Click; bottomToolStripMenuItem.Click += MoveBottomToolStripMenuItem_Click;
// //
// toolStripSeparator3 // toolStripSeparator3
// //
toolStripSeparator3.Name = "toolStripSeparator3"; toolStripSeparator3.Name = "toolStripSeparator3";
toolStripSeparator3.Size = new System.Drawing.Size(177, 6); toolStripSeparator3.Size = new System.Drawing.Size(129, 6);
// //
// removeToolStripMenuItem // removeToolStripMenuItem
// //
removeToolStripMenuItem.Image = AppResource.trash_2;
removeToolStripMenuItem.Name = "removeToolStripMenuItem"; removeToolStripMenuItem.Name = "removeToolStripMenuItem";
removeToolStripMenuItem.Size = new System.Drawing.Size(180, 22); removeToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
removeToolStripMenuItem.Text = "&Remove"; removeToolStripMenuItem.Text = "&Remove";
removeToolStripMenuItem.Click += removeToolStripMenuItem_Click; removeToolStripMenuItem.Click += RemoveGroupToolStripMenuItem_Click;
// //
// flowLayoutPanel1 // flowLayoutPanel1
// //
@ -367,10 +370,10 @@ namespace RokettoLaunch
flowLayoutPanel1.BackColor = System.Drawing.Color.Transparent; flowLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
flowLayoutPanel1.Location = new System.Drawing.Point(0, 0); flowLayoutPanel1.Location = new System.Drawing.Point(10, 0);
flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0);
flowLayoutPanel1.Name = "flowLayoutPanel1"; flowLayoutPanel1.Name = "flowLayoutPanel1";
flowLayoutPanel1.Size = new System.Drawing.Size(404, 417); flowLayoutPanel1.Size = new System.Drawing.Size(454, 257);
flowLayoutPanel1.TabIndex = 8; flowLayoutPanel1.TabIndex = 8;
flowLayoutPanel1.WrapContents = false; flowLayoutPanel1.WrapContents = false;
// //
@ -382,47 +385,49 @@ namespace RokettoLaunch
panel1.Location = new System.Drawing.Point(0, 24); panel1.Location = new System.Drawing.Point(0, 24);
panel1.Margin = new System.Windows.Forms.Padding(0); panel1.Margin = new System.Windows.Forms.Padding(0);
panel1.Name = "panel1"; panel1.Name = "panel1";
panel1.Size = new System.Drawing.Size(404, 417); panel1.Padding = new System.Windows.Forms.Padding(10, 0, 0, 0);
panel1.Size = new System.Drawing.Size(464, 257);
panel1.TabIndex = 9; panel1.TabIndex = 9;
// //
// tileMenu1 // tileMenuStrip
// //
tileMenu1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { editToolStripMenuItem1, toolStripMenuItem6, toolStripSeparator4, removeToolStripMenuItem1 }); tileMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { editToolStripMenuItem1, toolStripMenuItem6, toolStripSeparator4, removeToolStripMenuItem1 });
tileMenu1.Name = "tileMenu1"; tileMenuStrip.Name = "tileMenu1";
tileMenu1.Size = new System.Drawing.Size(125, 76); tileMenuStrip.Size = new System.Drawing.Size(127, 76);
// //
// editToolStripMenuItem1 // editToolStripMenuItem1
// //
editToolStripMenuItem1.Name = "editToolStripMenuItem1"; editToolStripMenuItem1.Name = "editToolStripMenuItem1";
editToolStripMenuItem1.Size = new System.Drawing.Size(124, 22); editToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
editToolStripMenuItem1.Text = "&Edit"; editToolStripMenuItem1.Text = "&Edit";
editToolStripMenuItem1.Click += editToolStripMenuItem1_Click; editToolStripMenuItem1.Click += EditTileToolStripMenuItem_Click;
// //
// toolStripMenuItem6 // toolStripMenuItem6
// //
toolStripMenuItem6.Name = "toolStripMenuItem6"; toolStripMenuItem6.Name = "toolStripMenuItem6";
toolStripMenuItem6.Size = new System.Drawing.Size(124, 22); toolStripMenuItem6.Size = new System.Drawing.Size(180, 22);
toolStripMenuItem6.Text = "&Duplicate"; toolStripMenuItem6.Text = "Copy To...";
toolStripMenuItem6.Click += toolStripMenuItem6_Click; toolStripMenuItem6.Click += CopyToTileToolStripMenuItem_Click;
// //
// toolStripSeparator4 // toolStripSeparator4
// //
toolStripSeparator4.Name = "toolStripSeparator4"; toolStripSeparator4.Name = "toolStripSeparator4";
toolStripSeparator4.Size = new System.Drawing.Size(121, 6); toolStripSeparator4.Size = new System.Drawing.Size(177, 6);
// //
// removeToolStripMenuItem1 // removeToolStripMenuItem1
// //
removeToolStripMenuItem1.Image = AppResource.trash_2;
removeToolStripMenuItem1.Name = "removeToolStripMenuItem1"; removeToolStripMenuItem1.Name = "removeToolStripMenuItem1";
removeToolStripMenuItem1.Size = new System.Drawing.Size(124, 22); removeToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
removeToolStripMenuItem1.Text = "&Remove"; removeToolStripMenuItem1.Text = "&Remove";
removeToolStripMenuItem1.Click += removeToolStripMenuItem1_Click; removeToolStripMenuItem1.Click += RemoveTileToolStripMenuItem_Click;
// //
// MainForm // MainForm
// //
AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
BackColor = System.Drawing.Color.White; BackColor = System.Drawing.Color.White;
BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
ClientSize = new System.Drawing.Size(404, 441); ClientSize = new System.Drawing.Size(464, 281);
Controls.Add(panel1); Controls.Add(panel1);
Controls.Add(menuStrip1); Controls.Add(menuStrip1);
DoubleBuffered = true; DoubleBuffered = true;
@ -433,12 +438,12 @@ namespace RokettoLaunch
MinimizeBox = false; MinimizeBox = false;
MinimumSize = new System.Drawing.Size(300, 320); MinimumSize = new System.Drawing.Size(300, 320);
Name = "MainForm"; Name = "MainForm";
contextMenuStrip2.ResumeLayout(false); trayMenuStrip.ResumeLayout(false);
menuStrip1.ResumeLayout(false); menuStrip1.ResumeLayout(false);
menuStrip1.PerformLayout(); menuStrip1.PerformLayout();
tileContainerMenu1.ResumeLayout(false); groupMenuStrip.ResumeLayout(false);
panel1.ResumeLayout(false); panel1.ResumeLayout(false);
tileMenu1.ResumeLayout(false); tileMenuStrip.ResumeLayout(false);
ResumeLayout(false); ResumeLayout(false);
PerformLayout(); PerformLayout();
} }
@ -447,7 +452,7 @@ namespace RokettoLaunch
private System.Windows.Forms.SaveFileDialog saveFileDialog1; private System.Windows.Forms.SaveFileDialog saveFileDialog1;
private System.Windows.Forms.OpenFileDialog openFileDialog1; private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.NotifyIcon notifyIcon1; private System.Windows.Forms.NotifyIcon notifyIcon1;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip2; private System.Windows.Forms.ContextMenuStrip trayMenuStrip;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem1;
private System.Windows.Forms.MenuStrip menuStrip1; private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
@ -471,7 +476,7 @@ namespace RokettoLaunch
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem addGroupToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem addGroupToolStripMenuItem;
private System.Windows.Forms.ContextMenuStrip tileContainerMenu1; private System.Windows.Forms.ContextMenuStrip groupMenuStrip;
private System.Windows.Forms.ToolStripMenuItem addGroupToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem addGroupToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem;
@ -486,7 +491,7 @@ namespace RokettoLaunch
private System.Windows.Forms.ToolStripMenuItem bottomToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem bottomToolStripMenuItem;
private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem5; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem5;
private System.Windows.Forms.ContextMenuStrip tileMenu1; private System.Windows.Forms.ContextMenuStrip tileMenuStrip;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem6; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem6;

File diff suppressed because it is too large Load Diff

View File

@ -126,7 +126,7 @@
<metadata name="notifyIcon1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="notifyIcon1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>448, 17</value> <value>448, 17</value>
</metadata> </metadata>
<metadata name="contextMenuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="trayMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>561, 17</value> <value>561, 17</value>
</metadata> </metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
@ -428,12 +428,12 @@
</value> </value>
</data> </data>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>716, 17</value> <value>46, 13</value>
</metadata> </metadata>
<metadata name="tileContainerMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="groupMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>831, 17</value> <value>831, 17</value>
</metadata> </metadata>
<metadata name="tileMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="tileMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>990, 17</value> <value>990, 17</value>
</metadata> </metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

View File

@ -0,0 +1,58 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Text.Json.Serialization;
namespace RokettoLaunch.Models.SaveFile
{
public class App3Options : AppOptionsBase
{
public class Group
{
public string Title { get; set; }
public bool IsExpanded { get; set; } = false;
public List<Item> Items { get; set; } = new List<Item>();
[JsonConverter(typeof(RyzStudio.Text.Json.JsonSizeConverter))]
public Size GridSize { get; set; } = new Size(0, 0);
}
public class Item
{
public string Title { get; set; }
public string ProcessFilename { get; set; }
public string ProcessArgument { get; set; }
public string ProcessWorkingDirectory { get; set; }
public ProcessWindowStyle ProcessWindowStyle { get; set; } = ProcessWindowStyle.Normal;
public bool ProcessAsAdmin { get; set; } = false;
[JsonConverter(typeof(RyzStudio.Text.Json.JsonPointConverter))]
public Point Position { get; set; }
public bool IsGroup { get; set; } = false;
public List<Item> Items { get; set; } = new List<Item>();
public override string ToString()
{
return this.Title?.Trim() ?? string.Empty;
}
}
public new int FileVersion { get; set; } = 3;
public List<Group> Groups { get; set; } = new List<Group>();
}
}

View File

@ -0,0 +1,378 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace RokettoLaunch.Models.SaveFile
{
public class App4Options : AppOptionsBase
{
public class Group
{
public Guid Id { get; set; } = Guid.NewGuid();
public string Title { get; set; }
public bool IsOpen { get; set; } = false;
public List<Item> Items { get; set; } = new List<Item>();
[JsonConverter(typeof(RyzStudio.Text.Json.JsonSizeConverter))]
public Size GridSize { get; set; } = new Size(0, 0);
public Item AddItem(Item item)
{
var canPosition = this.CanPosition(item);
if (!canPosition)
{
// Find next available position
item.Position = this.GetNextPosition();
}
// Resize-expand table
if ((item.Position.Y + 1) > this.GridSize.Height)
{
this.GridSize = new Size(this.GridSize.Width, (item.Position.Y + 1));
//this.UpdateTable(table, this.GridSize);
}
// Add item
this.Items.Add(item);
return item;
}
public Group CopyOf()
{
var json = JsonSerializer.Serialize(this);
var newGroupInfo = JsonSerializer.Deserialize<Group>(json);
newGroupInfo.Id = Guid.NewGuid();
newGroupInfo.Title = "Copy of " + newGroupInfo.Title;
// Resolve paths
foreach (var item in newGroupInfo.Items ?? new List<Item>())
{
item.Id = Guid.NewGuid();
if (item.IsGroup)
{
foreach (var subItem in item.Items ?? new List<Item>())
{
subItem.Id = Guid.NewGuid();
subItem.ResolvePaths();
}
}
else
{
item.ResolvePaths();
}
}
return newGroupInfo;
}
public Size GetMaxGridSize()
{
var result = this.GridSize;
var maxPosition = this.GetMaxPosition();
result.Width = Math.Max(result.Width, (maxPosition.X + 1));
result.Height = Math.Max(result.Height, (maxPosition.Y + 1));
return result;
}
public Point GetMaxPosition()
{
if (this.Items.Count <= 0)
{
return new Point(0, 0);
}
var result = new Point(0, 0);
result.Y = this.Items.Select(x => x.Position.Y).Max();
result.X = this.Items.Where(x => x.Position.Y == result.Y)?.Select(x => x.Position.X)?.Max() ?? 0;
return result;
}
public Point GetNextPosition()
{
if (this.Items.Count <= 0)
{
return new Point(0, 0);
}
var pos = this.GetMaxPosition();
pos.X++;
if (pos.X > (this.GridSize.Width - 1))
{
pos.X = 0;
pos.Y++;
}
return pos;
}
public bool CanPosition(Item tile)
{
if (tile.Position == new Point(-1, -1))
{
return false;
}
if (Items.Count <= 0)
{
return true;
}
return !Items.Where(x => x.Id != tile.Id && x.Position == tile.Position).Any();
}
}
public class Item
{
public static Item Create(App3Options.Item model)
{
var result = new Item();
result.Load(model);
return result;
}
public Guid Id { get; set; } = Guid.NewGuid();
public string Title { get; set; }
public string TargetPath { get; set; }
public string Argument { get; set; }
public string StartPath { get; set; }
public ProcessWindowStyle WindowStyle { get; set; } = ProcessWindowStyle.Normal;
public bool RunAsAdmin { get; set; } = false;
[JsonConverter(typeof(RyzStudio.Text.Json.JsonPointConverter))]
public Point Position { get; set; }
public bool IsGroup { get; set; } = false;
public List<Item> Items { get; set; } = new List<Item>();
[JsonIgnore]
public string ResolvedTargetPath { get; private set; }
[JsonIgnore]
public string ResolvedArgument { get; private set; }
[JsonIgnore]
public string ResolvedStartPath { get; private set; }
public Item CopyOf()
{
var json = JsonSerializer.Serialize(this);
var newTileInfo = JsonSerializer.Deserialize<Item>(json);
newTileInfo.Id = Guid.NewGuid();
newTileInfo.Title = "Copy of " + newTileInfo.Title;
newTileInfo.Position = new Point(-1, -1);
if (newTileInfo.IsGroup)
{
foreach (var subItem in newTileInfo.Items ?? new List<Item>())
{
subItem.Id = Guid.NewGuid();
subItem.ResolvePaths();
}
}
else
{
newTileInfo.ResolvePaths();
}
return newTileInfo;
}
public void Load(App3Options.Item model)
{
this.Title = model.Title;
this.TargetPath = model.ProcessFilename;
this.Argument = model.ProcessArgument;
this.StartPath = model.ProcessWorkingDirectory;
this.WindowStyle = model.ProcessWindowStyle;
this.RunAsAdmin = model.ProcessAsAdmin;
this.Position = model.Position;
this.IsGroup = model.IsGroup;
this.Items = model.Items.Select(x => Item.Create(x))?.ToList() ?? new List<Item>();
}
public void Load(Item model)
{
this.Title = model.Title;
this.TargetPath = model.TargetPath;
this.Argument = model.Argument;
this.StartPath = model.StartPath;
this.WindowStyle = model.WindowStyle;
this.RunAsAdmin = model.RunAsAdmin;
this.Position = model.Position;
this.IsGroup = model.IsGroup;
this.Items = model.Items ?? new List<Item>();
this.ResolvedTargetPath = model.ResolvedTargetPath;
this.ResolvedStartPath = model.ResolvedStartPath;
this.ResolvedArgument = model.ResolvedArgument;
this.ResolvePaths();
}
public void ResolvePaths()
{
if (this.IsGroup)
{
foreach (var subItem in this.Items ?? new List<Item>())
{
subItem.ResolvePaths();
}
}
else
{
this.ResolvedTargetPath = RyzStudio.IO.File.ResolvePath(this.TargetPath);
this.ResolvedArgument = RyzStudio.IO.File.ResolvePath(this.Argument);
this.ResolvedStartPath = RyzStudio.IO.File.ResolvePath(this.StartPath);
}
}
public override string ToString()
{
return this.Title?.Trim() ?? string.Empty;
}
}
public new int FileVersion { get; set; } = 4;
public List<Group> Groups { get; set; } = new List<Group>();
public void Load(App3Options options)
{
this.TilesPerRow = options.TilesPerRow;
this.ShowBigIcons = options.ShowBigIcons;
this.ShowToggleHotkey = options.ShowToggleHotkey;
this.HideOnClose = options.HideOnClose;
this.HideOnExecute = options.HideOnExecute;
this.AlwaysOnTop = options.AlwaysOnTop;
this.StartPosition = options.StartPosition;
this.Height = options.Height;
foreach (var group in options.Groups)
{
var newGroup = new Group()
{
Title = group.Title,
IsOpen = group.IsExpanded,
GridSize = group.GridSize
};
newGroup.Items = group.Items.Select(x => Item.Create(x))?.ToList() ?? new List<Item>();
this.Groups.Add(newGroup);
}
}
public Item FindById(Guid id)
{
if (id == Guid.Empty)
{
return null;
}
foreach (var group in this.Groups)
{
foreach (var item in group.Items)
{
if (item.Id == id)
{
return item;
}
if (item.IsGroup)
{
foreach (var subItem in item.Items)
{
if (subItem.Id == id)
{
return subItem;
}
}
}
}
}
return null;
}
//public bool Update(Item value)
//{
// var result = this.FindById(value.Id);
// if (result == null)
// {
// return false;
// }
// result.Load(value);
// return true;
//}
public bool Remove(Guid id)
{
if (id == Guid.Empty)
{
return false;
}
foreach (var group in this.Groups)
{
foreach (var item in group.Items)
{
if (item.Id == id)
{
return group.Items.Remove(item);
}
if (item.IsGroup)
{
foreach (var subItem in item.Items)
{
if (subItem.Id == id)
{
return item.Items.Remove(subItem);
}
}
}
}
}
return false;
}
}
}

View File

@ -1,11 +1,12 @@
using System.Collections.Generic; using System.Drawing;
using System.Drawing;
namespace RokettoLaunch.Models namespace RokettoLaunch.Models.SaveFile
{ {
public class AppOptions public class AppOptionsBase
{ {
public int TilesPerRow { get; set; } = 8; public int FileVersion { get; set; } = 0;
public int TilesPerRow { get; set; } = 6;
public bool ShowBigIcons { get; set; } = true; public bool ShowBigIcons { get; set; } = true;
@ -17,11 +18,10 @@ namespace RokettoLaunch.Models
public bool AlwaysOnTop { get; set; } = false; public bool AlwaysOnTop { get; set; } = false;
public List<TileGroupModel> Groups { get; set; } = new List<TileGroupModel>();
public Point StartPosition { get; set; } = Point.Empty; public Point StartPosition { get; set; } = Point.Empty;
public int Height { get; set; } = 280; public int Width { get; set; } = 0;
public int Height { get; set; } = 320;
} }
} }

View File

@ -1,19 +0,0 @@
using System.Collections.Generic;
using System.Drawing;
using System.Text.Json.Serialization;
namespace RokettoLaunch.Models
{
public class TileGroupModel
{
public string Title { get; set; }
public bool IsExpanded { get; set; } = false;
public List<TileModel> Items { get; set; } = new List<TileModel>();
[JsonConverter(typeof(RyzStudio.Text.Json.JsonSizeConverter))]
public Size GridSize { get; set; } = new Size(0, 0);
}
}

View File

@ -1,259 +0,0 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Text.Json.Serialization;
namespace RokettoLaunch.Models
{
public class TileModel
{
public string Title { get; set; }
public string ProcessFilename { get; set; }
public string ProcessArgument { get; set; }
public string ProcessWorkingDirectory { get; set; }
public ProcessWindowStyle ProcessWindowStyle { get; set; } = ProcessWindowStyle.Normal;
public bool ProcessAsAdmin { get; set; } = false;
[JsonConverter(typeof(RyzStudio.Text.Json.JsonPointConverter))]
public Point Position { get; set; }
public bool IsGroup { get; set; } = false;
public List<TileModel> Items { get; set; } = new List<TileModel>();
public string Version { get; set; }
public override string ToString() => this.Title ?? string.Empty;
[JsonIgnore]
public string CleanProcessFilename
{
get
{
return (string.IsNullOrWhiteSpace(this.ProcessFilename) ? string.Empty : ResolvePath(this.ProcessFilename));
}
}
[JsonIgnore]
public string CleanProcessArgument
{
get
{
return (string.IsNullOrWhiteSpace(this.ProcessArgument) ? string.Empty : ResolvePath(this.ProcessArgument));
}
}
[JsonIgnore]
public string CleanProcessWorkingDirectory
{
get
{
return (string.IsNullOrWhiteSpace(this.ProcessWorkingDirectory) ? string.Empty : ResolvePath(this.ProcessWorkingDirectory));
}
}
private Tuple<string, string> SplitPath(string path, string needle)
{
if (string.IsNullOrWhiteSpace(path))
{
return null;
}
if (string.IsNullOrWhiteSpace(needle))
{
return null;
}
if (!path.Contains(needle))
{
return null;
}
string head = path.Substring(0, path.IndexOf(needle));
string tail = path.Substring(path.IndexOf(needle) + needle.Length);
return new Tuple<string, string>(head, tail);
}
private string GetFirstPath(string value)
{
var parts = SplitPath(value, "%FIRST%");
if (parts == null)
{
return null;
}
string[] dirList = new string[0];
try
{
dirList = System.IO.Directory.GetDirectories(parts.Item1, "*", System.IO.SearchOption.TopDirectoryOnly);
}
catch
{
// do nothing
}
if (dirList.Length <= 0)
{
return null;
}
return System.IO.Path.GetFileName(dirList[0]);
}
private string GetLastPath(string value)
{
var parts = SplitPath(value, "%LAST%");
if (parts == null)
{
return null;
}
string[] dirList = new string[0];
try
{
dirList = System.IO.Directory.GetDirectories(parts.Item1, "*", System.IO.SearchOption.TopDirectoryOnly);
}
catch
{
// do nothing
}
if (dirList.Length <= 0)
{
return null;
}
return System.IO.Path.GetFileName(dirList[(dirList.Length - 1)]);
}
private string ResolvePath(string path)
{
var result = Environment.ExpandEnvironmentVariables(path);
if (result.Contains("%FIRST%"))
{
result = ResolveFirstPath(result);
}
if (result.Contains("%LAST%"))
{
result = ResolveLastPath(result);
}
return result;
}
private string ResolveFirstPath(string value)
{
var parts = SplitPath(value, "%FIRST%");
if (parts == null)
{
return value;
}
try
{
if (!System.IO.Directory.Exists(parts.Item1))
{
return value;
}
}
catch (Exception)
{
return value;
}
// Try cached version
if (!string.IsNullOrWhiteSpace(this.Version))
{
var filename = parts.Item1 + this.Version + parts.Item2;
try
{
if (System.IO.File.Exists(filename))
{
return filename;
}
}
catch (Exception)
{
}
}
// Resolve version
var version = GetFirstPath(value);
if (version == null)
{
return value;
}
this.Version = version;
return parts.Item1 + version + parts.Item2;
}
private string ResolveLastPath(string value)
{
var parts = SplitPath(value, "%LAST%");
if (parts == null)
{
return value;
}
try
{
if (!System.IO.Directory.Exists(parts.Item1))
{
return value;
}
}
catch (Exception)
{
return value;
}
// Try cached version
if (!string.IsNullOrWhiteSpace(this.Version))
{
var filename = parts.Item1 + this.Version + parts.Item2;
try
{
if (System.IO.File.Exists(filename))
{
return filename;
}
}
catch (Exception)
{
}
}
// Resolve version
var version = GetLastPath(value);
if (version == null)
{
return value;
}
this.Version = version;
return parts.Item1 + version + parts.Item2;
}
}
}

View File

@ -1,7 +1,6 @@
using System; using System;
using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using RokettoLaunch.Models; using RokettoLaunch.Models.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;
@ -11,247 +10,153 @@ namespace RokettoLaunch
{ {
public class OptionsForm : Form public class OptionsForm : Form
{ {
private System.Windows.Forms.Label label1;
private ThYesNoPickerBox yesNoPickerBox2;
private System.Windows.Forms.Label label6;
private ThYesNoPickerBox yesNoPickerBox3;
private System.Windows.Forms.Label label7;
private ThKeyCodeTextBox textBox1;
private ThNumericBox numericBox1;
private Label label4;
private FlowLayoutPanel flowLayoutPanel1;
private TTogglePanel tTogglePanel1;
private TTogglePanel tTogglePanel2;
private ThYesNoPickerBox yesNoPickerBox1;
private Label label2;
private ThYesNoPickerBox yesNoPickerBox4;
private Label label3;
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1; private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
private FlowLayoutPanel flowLayoutPanel1;
private TTogglePanel togglePanel1;
private Label label2;
private Label label4;
private TTogglePanel togglePanel2;
private Label label3;
private Label label1;
private Label label6;
private Label label7;
private ThYesNoPickerBox yesNoPickerBox1;
private ThNumericBox numericBox1;
private ThYesNoPickerBox yesNoPickerBox4;
private ThKeyCodeTextBox textBox1;
private ThYesNoPickerBox yesNoPickerBox2;
private ThYesNoPickerBox yesNoPickerBox3;
private TTogglePanel togglePanel3;
private App4Options _appSession = null;
private AppOptions _appSession = null; public OptionsForm(App4Options appSession)
public OptionsForm(AppOptions appSession)
{ {
InitializeComponent(); InitializeComponent();
UISetup.Dialog(this); UISetup.Dialog(this, true);
UISetup.AutoSizeChildren(flowLayoutPanel1);
_appSession = appSession; _appSession = appSession;
numericBox1.Minimum = 4; numericBox1.Minimum = 4;
numericBox1.Maximum = 24; numericBox1.Maximum = 24;
}
if (_appSession != null) protected override void OnShown(EventArgs e)
{ {
numericBox1.Value = _appSession.TilesPerRow; base.OnShown(e);
yesNoPickerBox1.Value = _appSession.ShowBigIcons;
textBox1.UpdateKeyCode(_appSession?.ShowToggleHotkey ?? new ThKeyCodeTextBox.Results()); numericBox1.Value = _appSession?.TilesPerRow ?? 4;
yesNoPickerBox2.Value = _appSession.HideOnClose; yesNoPickerBox1.Value = _appSession?.ShowBigIcons ?? true;
yesNoPickerBox3.Value = _appSession.HideOnExecute; textBox1.UpdateKeyCode(_appSession?.ShowToggleHotkey ?? new ThKeyCodeTextBox.Results());
yesNoPickerBox4.Value = _appSession.AlwaysOnTop; yesNoPickerBox4.Value = _appSession?.AlwaysOnTop ?? true;
} yesNoPickerBox2.Value = _appSession?.HideOnClose ?? true;
yesNoPickerBox3.Value = _appSession?.HideOnExecute ?? true;
} }
private void InitializeComponent() private void InitializeComponent()
{ {
ThKeyCodeTextBox.Results results1 = new ThKeyCodeTextBox.Results(); ThKeyCodeTextBox.Results results1 = new ThKeyCodeTextBox.Results();
label1 = new Label();
yesNoPickerBox2 = new ThYesNoPickerBox();
label6 = new Label();
yesNoPickerBox3 = new ThYesNoPickerBox();
label7 = new Label();
textBox1 = new ThKeyCodeTextBox();
numericBox1 = new ThNumericBox();
label4 = new Label();
flowLayoutPanel1 = new FlowLayoutPanel();
tTogglePanel1 = new TTogglePanel();
yesNoPickerBox1 = new ThYesNoPickerBox();
label2 = new Label();
tTogglePanel2 = new TTogglePanel();
yesNoPickerBox4 = new ThYesNoPickerBox();
label3 = new Label();
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter(); dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
flowLayoutPanel1 = new FlowLayoutPanel();
togglePanel1 = new TTogglePanel();
yesNoPickerBox1 = new ThYesNoPickerBox();
numericBox1 = new ThNumericBox();
label2 = new Label();
label4 = new Label();
togglePanel2 = new TTogglePanel();
label6 = new Label();
yesNoPickerBox4 = new ThYesNoPickerBox();
textBox1 = new ThKeyCodeTextBox();
yesNoPickerBox2 = new ThYesNoPickerBox();
label3 = new Label();
label1 = new Label();
togglePanel3 = new TTogglePanel();
label7 = new Label();
yesNoPickerBox3 = new ThYesNoPickerBox();
flowLayoutPanel1.SuspendLayout(); flowLayoutPanel1.SuspendLayout();
tTogglePanel1.SuspendLayout(); togglePanel1.SuspendLayout();
tTogglePanel2.SuspendLayout(); togglePanel2.SuspendLayout();
togglePanel3.SuspendLayout();
SuspendLayout(); SuspendLayout();
// //
// label1 // dialogFooter1
// //
label1.AutoSize = true; dialogFooter1.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
label1.BackColor = System.Drawing.Color.Transparent; dialogFooter1.Dock = DockStyle.Bottom;
label1.ForeColor = System.Drawing.SystemColors.ControlText; dialogFooter1.EnableMovable = false;
label1.Location = new System.Drawing.Point(1, 22); dialogFooter1.IsBusy = false;
label1.Margin = new Padding(0); dialogFooter1.Location = new System.Drawing.Point(0, 451);
label1.Name = "label1"; dialogFooter1.Name = "dialogFooter1";
label1.Padding = new Padding(0, 8, 0, 0); dialogFooter1.Size = new System.Drawing.Size(444, 70);
label1.Size = new System.Drawing.Size(115, 23); dialogFooter1.TabIndex = 0;
label1.TabIndex = 153; dialogFooter1.TabStop = false;
label1.Text = "Show Toggle Hotkey";
label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// yesNoPickerBox2
//
yesNoPickerBox2.Anchor = AnchorStyles.Top | AnchorStyles.Right;
yesNoPickerBox2.BackColor = System.Drawing.Color.Transparent;
yesNoPickerBox2.EnableReactiveVisual = true;
yesNoPickerBox2.Font = new System.Drawing.Font("Segoe UI", 9F);
yesNoPickerBox2.Location = new System.Drawing.Point(307, 63);
yesNoPickerBox2.Name = "yesNoPickerBox2";
yesNoPickerBox2.Padding = new Padding(4, 4, 3, 3);
yesNoPickerBox2.SelectedIndex = 1;
yesNoPickerBox2.Size = new System.Drawing.Size(84, 34);
yesNoPickerBox2.TabIndex = 183;
yesNoPickerBox2.TabStop = false;
yesNoPickerBox2.Value = true;
//
// label6
//
label6.AutoSize = true;
label6.BackColor = System.Drawing.Color.Transparent;
label6.ForeColor = System.Drawing.SystemColors.ControlText;
label6.Location = new System.Drawing.Point(1, 63);
label6.Margin = new Padding(0);
label6.Name = "label6";
label6.Padding = new Padding(0, 8, 0, 0);
label6.Size = new System.Drawing.Size(83, 23);
label6.TabIndex = 182;
label6.Text = "Hide On Close";
label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// yesNoPickerBox3
//
yesNoPickerBox3.Anchor = AnchorStyles.Top | AnchorStyles.Right;
yesNoPickerBox3.BackColor = System.Drawing.Color.Transparent;
yesNoPickerBox3.EnableReactiveVisual = true;
yesNoPickerBox3.Font = new System.Drawing.Font("Segoe UI", 9F);
yesNoPickerBox3.Location = new System.Drawing.Point(307, 107);
yesNoPickerBox3.Name = "yesNoPickerBox3";
yesNoPickerBox3.Padding = new Padding(4, 4, 3, 3);
yesNoPickerBox3.SelectedIndex = 1;
yesNoPickerBox3.Size = new System.Drawing.Size(84, 34);
yesNoPickerBox3.TabIndex = 185;
yesNoPickerBox3.TabStop = false;
yesNoPickerBox3.Value = true;
//
// label7
//
label7.AutoSize = true;
label7.BackColor = System.Drawing.Color.Transparent;
label7.ForeColor = System.Drawing.SystemColors.ControlText;
label7.Location = new System.Drawing.Point(1, 107);
label7.Margin = new Padding(0);
label7.Name = "label7";
label7.Padding = new Padding(0, 8, 0, 0);
label7.Size = new System.Drawing.Size(95, 23);
label7.TabIndex = 184;
label7.Text = "Hide On Execute";
label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// textBox1
//
textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
textBox1.BackColor = System.Drawing.Color.Transparent;
textBox1.EnableReactiveVisual = true;
textBox1.Font = new System.Drawing.Font("Segoe UI", 9F);
textBox1.Icon = "O";
textBox1.IconSize = 13F;
results1.IsAlt = false;
results1.IsCtrl = false;
results1.IsShift = false;
results1.Key = Keys.None;
textBox1.KeyCodeResults = results1;
textBox1.Location = new System.Drawing.Point(192, 21);
textBox1.Name = "textBox1";
textBox1.Padding = new Padding(4, 4, 3, 3);
textBox1.Size = new System.Drawing.Size(199, 32);
textBox1.TabIndex = 189;
textBox1.TabStop = false;
textBox1.UseSystemPasswordChar = false;
//
// numericBox1
//
numericBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
numericBox1.BackColor = System.Drawing.Color.Transparent;
numericBox1.EnableReactiveVisual = true;
numericBox1.Font = new System.Drawing.Font("Segoe UI", 9F);
numericBox1.Location = new System.Drawing.Point(252, 22);
numericBox1.Maximum = 100;
numericBox1.Minimum = 1;
numericBox1.Name = "numericBox1";
numericBox1.Padding = new Padding(4, 4, 3, 3);
numericBox1.Size = new System.Drawing.Size(139, 32);
numericBox1.TabIndex = 192;
numericBox1.TabStop = false;
numericBox1.Value = 1;
//
// label4
//
label4.AutoSize = true;
label4.BackColor = System.Drawing.Color.Transparent;
label4.ForeColor = System.Drawing.SystemColors.ControlText;
label4.Location = new System.Drawing.Point(1, 22);
label4.Margin = new Padding(0);
label4.Name = "label4";
label4.Padding = new Padding(0, 8, 0, 0);
label4.Size = new System.Drawing.Size(76, 23);
label4.TabIndex = 193;
label4.Text = "Tiles Per Row";
label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
// //
// flowLayoutPanel1 // flowLayoutPanel1
// //
flowLayoutPanel1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
flowLayoutPanel1.AutoScroll = true; flowLayoutPanel1.AutoScroll = true;
flowLayoutPanel1.BackColor = System.Drawing.Color.Transparent; flowLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
flowLayoutPanel1.Controls.Add(tTogglePanel1); flowLayoutPanel1.Controls.Add(togglePanel1);
flowLayoutPanel1.Controls.Add(tTogglePanel2); flowLayoutPanel1.Controls.Add(togglePanel2);
flowLayoutPanel1.Controls.Add(togglePanel3);
flowLayoutPanel1.Dock = DockStyle.Fill;
flowLayoutPanel1.FlowDirection = FlowDirection.TopDown; flowLayoutPanel1.FlowDirection = FlowDirection.TopDown;
flowLayoutPanel1.Location = new System.Drawing.Point(8, 12); flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
flowLayoutPanel1.Name = "flowLayoutPanel1"; flowLayoutPanel1.Name = "flowLayoutPanel1";
flowLayoutPanel1.Size = new System.Drawing.Size(436, 412); flowLayoutPanel1.Padding = new Padding(10, 0, 0, 0);
flowLayoutPanel1.TabIndex = 194; flowLayoutPanel1.Size = new System.Drawing.Size(444, 451);
flowLayoutPanel1.TabIndex = 195;
flowLayoutPanel1.WrapContents = false; flowLayoutPanel1.WrapContents = false;
flowLayoutPanel1.Resize += flowLayoutPanel1_Resize;
// //
// tTogglePanel1 // togglePanel1
// //
tTogglePanel1.AutoScrollMargin = new System.Drawing.Size(0, 0); togglePanel1.BackColor = System.Drawing.Color.FromArgb(252, 252, 252);
tTogglePanel1.AutoScrollMinSize = new System.Drawing.Size(0, 0); togglePanel1.CloseIcon = "H";
tTogglePanel1.Controls.Add(yesNoPickerBox1); togglePanel1.Controls.Add(yesNoPickerBox1);
tTogglePanel1.Controls.Add(label2); togglePanel1.Controls.Add(numericBox1);
tTogglePanel1.Controls.Add(label4); togglePanel1.Controls.Add(label2);
tTogglePanel1.Controls.Add(numericBox1); togglePanel1.Controls.Add(label4);
tTogglePanel1.ExpandedHeight = 119; togglePanel1.EnableMovable = false;
tTogglePanel1.ForeColor = System.Drawing.Color.FromArgb(99, 105, 119); togglePanel1.ExpandedHeight = 103;
tTogglePanel1.HeaderPadding = new Padding(4, 0, 0, 2); togglePanel1.HeaderPadding = new Padding(4, 0, 0, 2);
tTogglePanel1.IsOpen = true; togglePanel1.IconWidth = 20;
tTogglePanel1.Location = new System.Drawing.Point(0, 0); togglePanel1.Location = new System.Drawing.Point(10, 0);
tTogglePanel1.Margin = new Padding(0); togglePanel1.Name = "togglePanel1";
tTogglePanel1.Name = "tTogglePanel1"; togglePanel1.OpenIcon = "G";
tTogglePanel1.Padding = new Padding(0, 22, 0, 0); togglePanel1.Size = new System.Drawing.Size(401, 103);
tTogglePanel1.Size = new System.Drawing.Size(401, 119); togglePanel1.TabIndex = 0;
tTogglePanel1.TabIndex = 0; togglePanel1.Title = "Appearance";
tTogglePanel1.Title = "Appearance"; togglePanel1.TitleContextMenuStrip = null;
tTogglePanel1.TitleContextMenuStrip = null; togglePanel1.TitleCursor = Cursors.Default;
tTogglePanel1.TitleCursor = Cursors.Default;
// //
// yesNoPickerBox1 // yesNoPickerBox1
// //
yesNoPickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right; yesNoPickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
yesNoPickerBox1.BackColor = System.Drawing.Color.Transparent; yesNoPickerBox1.BackColor = System.Drawing.Color.Transparent;
yesNoPickerBox1.EnableReactiveVisual = true; yesNoPickerBox1.EnableMovable = false;
yesNoPickerBox1.Font = new System.Drawing.Font("Segoe UI", 9F); yesNoPickerBox1.Location = new System.Drawing.Point(311, 61);
yesNoPickerBox1.Location = new System.Drawing.Point(307, 64);
yesNoPickerBox1.Name = "yesNoPickerBox1"; yesNoPickerBox1.Name = "yesNoPickerBox1";
yesNoPickerBox1.Padding = new Padding(4, 4, 3, 3); yesNoPickerBox1.SelectedIndex = 0;
yesNoPickerBox1.SelectedIndex = 1; yesNoPickerBox1.Size = new System.Drawing.Size(80, 32);
yesNoPickerBox1.Size = new System.Drawing.Size(84, 34); yesNoPickerBox1.TabIndex = 197;
yesNoPickerBox1.TabIndex = 195;
yesNoPickerBox1.TabStop = false; yesNoPickerBox1.TabStop = false;
yesNoPickerBox1.Value = true; yesNoPickerBox1.Value = false;
//
// numericBox1
//
numericBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
numericBox1.BackColor = System.Drawing.Color.Transparent;
numericBox1.EnableMovable = false;
numericBox1.Location = new System.Drawing.Point(251, 19);
numericBox1.Maximum = 100;
numericBox1.Minimum = 1;
numericBox1.Name = "numericBox1";
numericBox1.Size = new System.Drawing.Size(140, 32);
numericBox1.TabIndex = 196;
numericBox1.TabStop = false;
numericBox1.Value = 1;
// //
// label2 // label2
// //
@ -267,53 +172,108 @@ namespace RokettoLaunch
label2.Text = "Show Big Icons"; label2.Text = "Show Big Icons";
label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
// //
// tTogglePanel2 // label4
// //
tTogglePanel2.AutoScrollMargin = new System.Drawing.Size(0, 0); label4.AutoSize = true;
tTogglePanel2.AutoScrollMinSize = new System.Drawing.Size(0, 0); label4.BackColor = System.Drawing.Color.Transparent;
tTogglePanel2.Controls.Add(yesNoPickerBox4); label4.ForeColor = System.Drawing.SystemColors.ControlText;
tTogglePanel2.Controls.Add(label3); label4.Location = new System.Drawing.Point(1, 22);
tTogglePanel2.Controls.Add(label1); label4.Margin = new Padding(0);
tTogglePanel2.Controls.Add(textBox1); label4.Name = "label4";
tTogglePanel2.Controls.Add(yesNoPickerBox2); label4.Padding = new Padding(0, 8, 0, 0);
tTogglePanel2.Controls.Add(yesNoPickerBox3); label4.Size = new System.Drawing.Size(76, 23);
tTogglePanel2.Controls.Add(label6); label4.TabIndex = 193;
tTogglePanel2.Controls.Add(label7); label4.Text = "Tiles Per Row";
tTogglePanel2.ExpandedHeight = 206; label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
tTogglePanel2.ForeColor = System.Drawing.Color.FromArgb(99, 105, 119); //
tTogglePanel2.HeaderPadding = new Padding(4, 0, 0, 2); // togglePanel2
tTogglePanel2.IsOpen = true; //
tTogglePanel2.Location = new System.Drawing.Point(0, 119); togglePanel2.BackColor = System.Drawing.Color.FromArgb(252, 252, 252);
tTogglePanel2.Margin = new Padding(0); togglePanel2.CloseIcon = "H";
tTogglePanel2.Name = "tTogglePanel2"; togglePanel2.Controls.Add(label6);
tTogglePanel2.Padding = new Padding(0, 22, 0, 0); togglePanel2.Controls.Add(yesNoPickerBox4);
tTogglePanel2.Size = new System.Drawing.Size(401, 206); togglePanel2.Controls.Add(textBox1);
tTogglePanel2.TabIndex = 1; togglePanel2.Controls.Add(yesNoPickerBox2);
tTogglePanel2.Title = "Behaviour"; togglePanel2.Controls.Add(label3);
tTogglePanel2.TitleContextMenuStrip = null; togglePanel2.Controls.Add(label1);
tTogglePanel2.TitleCursor = Cursors.Default; togglePanel2.EnableMovable = false;
togglePanel2.ExpandedHeight = 148;
togglePanel2.HeaderPadding = new Padding(4, 0, 0, 2);
togglePanel2.IconWidth = 20;
togglePanel2.Location = new System.Drawing.Point(10, 113);
togglePanel2.Name = "togglePanel2";
togglePanel2.OpenIcon = "G";
togglePanel2.Size = new System.Drawing.Size(401, 148);
togglePanel2.TabIndex = 1;
togglePanel2.Title = "Behaviour";
togglePanel2.TitleContextMenuStrip = null;
togglePanel2.TitleCursor = Cursors.Default;
//
// label6
//
label6.AutoSize = true;
label6.BackColor = System.Drawing.Color.Transparent;
label6.ForeColor = System.Drawing.SystemColors.ControlText;
label6.Location = new System.Drawing.Point(1, 106);
label6.Margin = new Padding(0);
label6.Name = "label6";
label6.Padding = new Padding(0, 8, 0, 0);
label6.Size = new System.Drawing.Size(116, 23);
label6.TabIndex = 182;
label6.Text = "Close To System Tray";
label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
// //
// yesNoPickerBox4 // yesNoPickerBox4
// //
yesNoPickerBox4.Anchor = AnchorStyles.Top | AnchorStyles.Right; yesNoPickerBox4.Anchor = AnchorStyles.Top | AnchorStyles.Right;
yesNoPickerBox4.BackColor = System.Drawing.Color.Transparent; yesNoPickerBox4.BackColor = System.Drawing.Color.Transparent;
yesNoPickerBox4.EnableReactiveVisual = true; yesNoPickerBox4.EnableMovable = false;
yesNoPickerBox4.Font = new System.Drawing.Font("Segoe UI", 9F); yesNoPickerBox4.Location = new System.Drawing.Point(311, 64);
yesNoPickerBox4.Location = new System.Drawing.Point(307, 151);
yesNoPickerBox4.Name = "yesNoPickerBox4"; yesNoPickerBox4.Name = "yesNoPickerBox4";
yesNoPickerBox4.Padding = new Padding(4, 4, 3, 3); yesNoPickerBox4.SelectedIndex = 0;
yesNoPickerBox4.SelectedIndex = 1; yesNoPickerBox4.Size = new System.Drawing.Size(80, 32);
yesNoPickerBox4.Size = new System.Drawing.Size(84, 34); yesNoPickerBox4.TabIndex = 195;
yesNoPickerBox4.TabIndex = 191;
yesNoPickerBox4.TabStop = false; yesNoPickerBox4.TabStop = false;
yesNoPickerBox4.Value = true; yesNoPickerBox4.Value = false;
//
// textBox1
//
textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
textBox1.BackColor = System.Drawing.Color.Transparent;
textBox1.EnableMovable = false;
textBox1.Icon = "O";
textBox1.IconSize = 13F;
results1.IsAlt = false;
results1.IsCtrl = false;
results1.IsShift = false;
results1.Key = Keys.None;
textBox1.KeyCodeResults = results1;
textBox1.Location = new System.Drawing.Point(211, 22);
textBox1.Name = "textBox1";
textBox1.Size = new System.Drawing.Size(180, 32);
textBox1.TabIndex = 194;
textBox1.TabStop = false;
textBox1.UseSystemPasswordChar = false;
//
// yesNoPickerBox2
//
yesNoPickerBox2.Anchor = AnchorStyles.Top | AnchorStyles.Right;
yesNoPickerBox2.BackColor = System.Drawing.Color.Transparent;
yesNoPickerBox2.EnableMovable = false;
yesNoPickerBox2.Location = new System.Drawing.Point(311, 106);
yesNoPickerBox2.Name = "yesNoPickerBox2";
yesNoPickerBox2.SelectedIndex = 0;
yesNoPickerBox2.Size = new System.Drawing.Size(80, 32);
yesNoPickerBox2.TabIndex = 192;
yesNoPickerBox2.TabStop = false;
yesNoPickerBox2.Value = false;
// //
// label3 // label3
// //
label3.AutoSize = true; label3.AutoSize = true;
label3.BackColor = System.Drawing.Color.Transparent; label3.BackColor = System.Drawing.Color.Transparent;
label3.ForeColor = System.Drawing.SystemColors.ControlText; label3.ForeColor = System.Drawing.SystemColors.ControlText;
label3.Location = new System.Drawing.Point(1, 151); label3.Location = new System.Drawing.Point(1, 64);
label3.Margin = new Padding(0); label3.Margin = new Padding(0);
label3.Name = "label3"; label3.Name = "label3";
label3.Padding = new Padding(0, 8, 0, 0); label3.Padding = new Padding(0, 8, 0, 0);
@ -322,16 +282,65 @@ namespace RokettoLaunch
label3.Text = "Always On Top"; label3.Text = "Always On Top";
label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
// //
// dialogFooter1 // label1
// //
dialogFooter1.BackColor = System.Drawing.Color.FromArgb(240, 240, 240); label1.AutoSize = true;
dialogFooter1.Button1Text = "&Save"; label1.BackColor = System.Drawing.Color.Transparent;
dialogFooter1.Dialog = this; label1.ForeColor = System.Drawing.SystemColors.ControlText;
dialogFooter1.Dock = DockStyle.Bottom; label1.Location = new System.Drawing.Point(1, 22);
dialogFooter1.IsBusy = false; label1.Margin = new Padding(0);
dialogFooter1.Location = new System.Drawing.Point(0, 437); label1.Name = "label1";
dialogFooter1.Name = "dialogFooter1"; label1.Padding = new Padding(0, 8, 0, 0);
dialogFooter1.Size = new System.Drawing.Size(444, 84); label1.Size = new System.Drawing.Size(115, 23);
label1.TabIndex = 153;
label1.Text = "Show Toggle Hotkey";
label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// togglePanel3
//
togglePanel3.BackColor = System.Drawing.Color.FromArgb(252, 252, 252);
togglePanel3.CloseIcon = "H";
togglePanel3.Controls.Add(label7);
togglePanel3.Controls.Add(yesNoPickerBox3);
togglePanel3.EnableMovable = false;
togglePanel3.ExpandedHeight = 64;
togglePanel3.HeaderPadding = new Padding(4, 0, 0, 2);
togglePanel3.IconWidth = 20;
togglePanel3.Location = new System.Drawing.Point(10, 271);
togglePanel3.Name = "togglePanel3";
togglePanel3.OpenIcon = "G";
togglePanel3.Size = new System.Drawing.Size(401, 64);
togglePanel3.TabIndex = 2;
togglePanel3.Title = "Action";
togglePanel3.TitleContextMenuStrip = null;
togglePanel3.TitleCursor = Cursors.Default;
//
// label7
//
label7.AutoSize = true;
label7.BackColor = System.Drawing.Color.Transparent;
label7.ForeColor = System.Drawing.SystemColors.ControlText;
label7.Location = new System.Drawing.Point(1, 22);
label7.Margin = new Padding(0);
label7.Name = "label7";
label7.Padding = new Padding(0, 8, 0, 0);
label7.Size = new System.Drawing.Size(95, 23);
label7.TabIndex = 184;
label7.Text = "Hide On Execute";
label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// yesNoPickerBox3
//
yesNoPickerBox3.Anchor = AnchorStyles.Top | AnchorStyles.Right;
yesNoPickerBox3.BackColor = System.Drawing.Color.Transparent;
yesNoPickerBox3.EnableMovable = false;
yesNoPickerBox3.Location = new System.Drawing.Point(311, 22);
yesNoPickerBox3.Name = "yesNoPickerBox3";
yesNoPickerBox3.SelectedIndex = 0;
yesNoPickerBox3.Size = new System.Drawing.Size(80, 32);
yesNoPickerBox3.TabIndex = 193;
yesNoPickerBox3.TabStop = false;
yesNoPickerBox3.Value = false;
// //
// OptionsForm // OptionsForm
// //
@ -339,52 +348,36 @@ namespace RokettoLaunch
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
BackColor = System.Drawing.Color.White; BackColor = System.Drawing.Color.White;
ClientSize = new System.Drawing.Size(444, 521); ClientSize = new System.Drawing.Size(444, 521);
Controls.Add(dialogFooter1);
Controls.Add(flowLayoutPanel1); Controls.Add(flowLayoutPanel1);
Controls.Add(dialogFooter1);
MinimumSize = new System.Drawing.Size(460, 560); MinimumSize = new System.Drawing.Size(460, 560);
Name = "OptionsForm"; Name = "OptionsForm";
Text = "Options"; Text = "Options";
flowLayoutPanel1.ResumeLayout(false); flowLayoutPanel1.ResumeLayout(false);
tTogglePanel1.ResumeLayout(false); togglePanel1.ResumeLayout(false);
tTogglePanel1.PerformLayout(); togglePanel1.PerformLayout();
tTogglePanel2.ResumeLayout(false); togglePanel2.ResumeLayout(false);
tTogglePanel2.PerformLayout(); togglePanel2.PerformLayout();
togglePanel3.ResumeLayout(false);
togglePanel3.PerformLayout();
ResumeLayout(false); ResumeLayout(false);
} }
protected override void OnLoad(EventArgs e) public App4Options Result
{
base.OnLoad(e);
flowLayoutPanel1_Resize(null, e);
}
private void flowLayoutPanel1_Resize(object sender, EventArgs e)
{
var width = flowLayoutPanel1.ClientRectangle.Width - SystemInformation.VerticalScrollBarWidth;
foreach (var item in flowLayoutPanel1.Controls.OfType<Control>())
{
item.Width = width;
}
}
public AppOptions Result
{ {
get get
{ {
if (_appSession == null) if (_appSession == null)
{ {
_appSession = new AppOptions(); _appSession = new App4Options();
} }
_appSession.TilesPerRow = numericBox1.Value; _appSession.TilesPerRow = numericBox1.Value;
_appSession.ShowBigIcons = yesNoPickerBox1.Value; _appSession.ShowBigIcons = yesNoPickerBox1.Value;
_appSession.ShowToggleHotkey = textBox1.KeyCodeResults; _appSession.ShowToggleHotkey = textBox1.KeyCodeResults;
_appSession.AlwaysOnTop = yesNoPickerBox4.Value;
_appSession.HideOnClose = yesNoPickerBox2.Value; _appSession.HideOnClose = yesNoPickerBox2.Value;
_appSession.HideOnExecute = yesNoPickerBox3.Value; _appSession.HideOnExecute = yesNoPickerBox3.Value;
_appSession.AlwaysOnTop = yesNoPickerBox4.Value;
return _appSession; return _appSession;
} }

View File

@ -1,5 +1,7 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using Microsoft.Extensions.DependencyInjection;
using RyzStudio.Windows.Forms;
namespace RokettoLaunch namespace RokettoLaunch
{ {
@ -11,10 +13,19 @@ 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>());
} }
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="feather feather-folder-minus"
version="1.1"
id="svg6"
sodipodi:docname="folder-minus.svg"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
inkscape:export-filename="N:\D\folder-minus.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs10" />
<sodipodi:namedview
id="namedview8"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="17.333333"
inkscape:cx="-3.4903846"
inkscape:cy="17.509615"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg6" />
<path
d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"
id="path2"
style="stroke:#808080;stroke-opacity:1" />
<line
x1="2.9674475"
y1="10"
x2="21.155149"
y2="10"
id="line4"
style="stroke-width:2;stroke-linecap:square;stroke-miterlimit:4;stroke-dasharray:none;stroke:#808080;stroke-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="feather feather-help-circle"
version="1.1"
id="svg8"
sodipodi:docname="help-circle.svg"
inkscape:export-filename="N:\D\help-circle.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs12" />
<sodipodi:namedview
id="namedview10"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="24.513035"
inkscape:cx="9.1583926"
inkscape:cy="15.318381"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg8" />
<circle
cx="12"
cy="12"
r="10"
id="circle2"
style="stroke:#808080;stroke-opacity:1" />
<path
d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"
id="path4"
style="stroke:#808080;stroke-opacity:1" />
<line
x1="12"
y1="17"
x2="12.01"
y2="17"
id="line6"
style="stroke:#808080;stroke-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
Resources/MainMenu/plus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

View File

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="feather feather-plus"
version="1.1"
id="svg6"
sodipodi:docname="plus.svg"
inkscape:export-filename="N:\D\plus.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs10" />
<sodipodi:namedview
id="namedview8"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="34.666667"
inkscape:cx="11.985577"
inkscape:cy="12.014423"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg6" />
<line
x1="12"
y1="5"
x2="12"
y2="19"
id="line2"
style="stroke:#808080;stroke-opacity:1" />
<line
x1="5"
y1="12"
x2="19"
y2="12"
id="line4"
style="stroke:#808080;stroke-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
Resources/MainMenu/save.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="feather feather-save"
version="1.1"
id="svg8"
sodipodi:docname="save.svg"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
inkscape:export-filename="N:\D\save.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs12" />
<sodipodi:namedview
id="namedview10"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="34.666667"
inkscape:cx="11.985577"
inkscape:cy="12.014423"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg8" />
<path
d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"
id="path2"
style="stroke:#808080;stroke-opacity:1" />
<polyline
points="17 21 17 13 7 13 7 21"
id="polyline4"
style="stroke:#808080;stroke-opacity:1" />
<polyline
points="7 3 7 8 15 8"
id="polyline6"
style="stroke:#808080;stroke-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="feather feather-settings"
version="1.1"
id="svg6"
sodipodi:docname="settings.svg"
inkscape:export-filename="N:\D\settings.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs10" />
<sodipodi:namedview
id="namedview8"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="34.666667"
inkscape:cx="11.985577"
inkscape:cy="12.014423"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg6" />
<circle
cx="12"
cy="12"
r="3"
id="circle2"
style="stroke:#808080;stroke-opacity:1" />
<path
d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"
id="path4"
style="stroke:#808080;stroke-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="feather feather-trash-2"
version="1.1"
id="svg10"
sodipodi:docname="trash-2.svg"
inkscape:export-filename="N:\D\trash-2.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs14" />
<sodipodi:namedview
id="namedview12"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="34.666667"
inkscape:cx="11.985577"
inkscape:cy="12.014423"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg10" />
<polyline
points="3 6 5 6 21 6"
id="polyline2"
style="stroke:#808080;stroke-opacity:1" />
<path
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"
id="path4"
style="stroke:#808080;stroke-opacity:1" />
<line
x1="10"
y1="11"
x2="10"
y2="17"
id="line6"
style="stroke:#808080;stroke-opacity:1" />
<line
x1="14"
y1="11"
x2="14"
y2="17"
id="line8"
style="stroke:#808080;stroke-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows8.0</TargetFramework> <TargetFramework>net10.0-windows8.0</TargetFramework>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<NoWin32Manifest>true</NoWin32Manifest> <NoWin32Manifest>true</NoWin32Manifest>
<ApplicationIcon>favicon.ico</ApplicationIcon> <ApplicationIcon>favicon.ico</ApplicationIcon>
@ -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.3.6.0604</Version> <Version>0.4.1.0202</Version>
<EnableNETAnalyzers>False</EnableNETAnalyzers> <EnableNETAnalyzers>False</EnableNETAnalyzers>
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<PackageIcon>icon-128.png</PackageIcon> <PackageIcon>icon-128.png</PackageIcon>
@ -79,16 +79,22 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="RyzStudio" Version="8.1.6.125" /> <PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.7" />
<PackageReference Include="RyzStudio.Windows.Forms" Version="8.1.6.25" /> <PackageReference Include="RyzStudio" Version="10.1.0.128" />
<PackageReference Include="RyzStudio.Windows.Forms" Version="10.1.0.140" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="AppResource.Designer.cs"> <Compile Update="AppResource.Designer.cs">
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DependentUpon>AppResource.resx</DependentUpon> <DependentUpon>AppResource.resx</DependentUpon>
</Compile> </Compile>
<Compile Update="CopyToTileForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="LoadingForm.cs">
<SubType>Form</SubType>
</Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -0,0 +1,146 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using RyzStudio.Windows.Forms;
namespace RokettoLaunch.Windows.Forms
{
public class TileLayoutPanel : System.Windows.Forms.TableLayoutPanel
{
public const int MIN_COLUMNS = 4;
public const int TILE_SIZE = 70;
public const int TILE_PADDING = 3;
public TileLayoutPanel() : base()
{
this.AllowDrop = true;
this.Margin = new Padding(0);
this.Padding = new Padding(0);
this.ColumnCount = 0;
this.RowCount = 0;
}
protected override void OnDragEnter(DragEventArgs e)
{
base.OnDragEnter(e);
if (e.Data.TryGetData<TilePanel>(out var data))
{
e.Effect = DragDropEffects.Move;
}
}
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Guid GroupId { get; set; } = Guid.Empty;
public void AddTilePanel(TilePanel tilePanel, int x, int y)
{
UIControl.Add(this, tilePanel, x, y);
}
public void SetGridSize(Size gridSize)
{
this.SetGridWidth(gridSize.Width);
this.SetGridHeight(gridSize.Height);
}
public void SetGridWidth(int width)
{
width = Math.Max(MIN_COLUMNS, width);
var diffColumns = width - this.ColumnCount;
var tileWidth = (TILE_SIZE + TILE_PADDING);
UIControl.Invoke(this, (x) =>
{
this.ColumnCount = width;
this.Width = (width * tileWidth);
// Resize columns
if (diffColumns == 0)
{
// Do nothing
}
else if (diffColumns > 0)
{
for (var i = 0; i < diffColumns; i++)
{
this.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, tileWidth));
}
}
else
{
for (var i = 0; i < (diffColumns * -1); i++)
{
this.ColumnStyles.RemoveAt((this.ColumnStyles.Count - 1));
}
}
// Update column width
foreach (ColumnStyle column in this.ColumnStyles)
{
column.SizeType = SizeType.Absolute;
column.Width = tileWidth;
}
});
}
public void SetGridHeight(int height)
{
var diffRows = height - this.RowCount;
var tileHeight = (TILE_SIZE + TILE_PADDING);
UIControl.Invoke(this, (x) =>
{
this.RowCount = height;
this.Height = (height * tileHeight) + TILE_PADDING;
// Resize rows
if (diffRows == 0)
{
// Do nothing
}
else if (diffRows > 0)
{
for (var i = 0; i < diffRows; i++)
{
this.RowStyles.Add(new RowStyle(SizeType.Absolute, tileHeight));
}
}
else
{
for (var i = 0; i < (diffRows * -1); i++)
{
this.RowStyles.RemoveAt((this.RowStyles.Count - 1));
}
}
// Update row height
foreach (RowStyle row in this.RowStyles)
{
row.SizeType = SizeType.Absolute;
row.Height = tileHeight;
}
});
}
public Point GetCellFromPoint(Point point)
{
var width = this.ClientSize.Width;
var height = this.ClientSize.Height;
var x = (int)((float)point.X / width * this.ColumnCount);
var y = (int)((float)point.Y / height * this.RowCount);
x = Math.Max(0, Math.Min(this.ColumnCount - 1, x));
y = Math.Max(0, Math.Min(this.RowCount - 1, y));
return new Point(x, y);
}
}
}

View File

@ -1,16 +1,18 @@
using System; using System;
using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.IO; using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using RokettoLaunch.Models;
using RyzStudio.Windows.Forms;
namespace RokettoLaunch.Windows.Forms namespace RokettoLaunch.Windows.Forms
{ {
public partial class TilePanel : RyzStudio.Windows.TileForms.Tile public partial class TilePanel : RyzStudio.Windows.TileForms.Tile
{ {
public delegate Task OnFileDropEvent(TilePanel sender, Keys keys, List<string> paths);
public TilePanel() public TilePanel()
{ {
InitializeComponent(); InitializeComponent();
@ -20,16 +22,20 @@ namespace RokettoLaunch.Windows.Forms
this.Size = new Size(70, 70); this.Size = new Size(70, 70);
this.AutoScaleMode = AutoScaleMode.None; this.AutoScaleMode = AutoScaleMode.None;
this.EnableMovable = true; this.EnableMovable = false;
} }
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Guid TileId { get; set; } = Guid.Empty;
[Browsable(false)] [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public TileModel ModelInfo { get; protected set; } = new TileModel(); public bool IsGroup { get; set; } = false;
public RyzStudio.Windows.TileForms.TileContainer TileContainer { get => UIControl.GetParentsUntil<RyzStudio.Windows.TileForms.TileContainer>(this); } [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ContextMenuStrip TileContextMenu { get; set; }
protected MainForm MainForm { get => UIControl.GetParentsUntil<MainForm>(this); } [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public OnFileDropEvent OnFileDrop { get; set; }
protected override void OnDragOver(DragEventArgs e) protected override void OnDragOver(DragEventArgs e)
@ -41,252 +47,31 @@ namespace RokettoLaunch.Windows.Forms
protected override void OnDragDrop(DragEventArgs e) protected override void OnDragDrop(DragEventArgs e)
{ {
string[] fileList = e.Data.GetData(DataFormats.FileDrop) as string[]; var fileList = e.Data.GetData(DataFormats.FileDrop) as string[];
fileList = fileList ?? new string[0]; if (fileList == null)
{
return;
}
if (fileList.Length <= 0) if (fileList.Length <= 0)
{ {
return; return;
} }
if (this.ModelInfo.IsGroup) if (this.OnFileDrop != null)
{ {
foreach (var item in fileList) this.OnFileDrop(this, Control.ModifierKeys, fileList.ToList());
{
var model = GetTileModel(item);
if (model == null)
{
continue;
}
this.ModelInfo.Items.Add(model);
}
InvalidateGroupMenu();
}
else
{
if (fileList.Length > 1)
{
var result = MessageBox.Show("Do you want to add this as a folder ?", "Convert to Folder", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
this.ModelInfo.Title = "New Folder";
this.ModelInfo.IsGroup = true;
foreach (var item in fileList)
{
var model = GetTileModel(item);
if (model == null)
{
continue;
}
this.ModelInfo.Items.Add(model);
}
InvalidateGroupMenu();
}
else if (result == DialogResult.No)
{
LoadInfo(fileList[0]);
}
}
else
{
LoadInfo(fileList[0]);
}
} }
} }
protected override void OnMouseClick(MouseEventArgs e) protected override void OnMouseDown(MouseEventArgs e)
{ {
if (Control.ModifierKeys == Keys.Control) base.OnMouseDown(e);
if (Control.ModifierKeys == Keys.Control && e.Button == MouseButtons.Right)
{ {
return; this.DoDragDrop(this, DragDropEffects.Move);
} }
if (this.ModelInfo == null)
{
return;
}
if (e.Button == MouseButtons.Left)
{
if (this.ModelInfo.IsGroup)
{
var iconSize = ((this.MainForm?.CurrentSession?.ShowBigIcons ?? true) ? 24 : 16);
this.LeftContextMenuStrip.ImageScalingSize = new Size(iconSize, iconSize);
this.LeftContextMenuStrip?.Show(this, e.Location);
}
else
{
OnMouseDoubleClick(e);
}
}
else if (e.Button == MouseButtons.Middle)
{
var mainForm = UIControl.GetParentsUntil<MainForm>(this);
if (mainForm == null)
{
return;
}
if (this.ModelInfo.IsGroup)
{
var result = MessageBox.Show("Are you sure you want to duplicate tile?", "Duplicate Tile", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
if (result != DialogResult.Yes)
{
return;
}
}
mainForm.DuplicateTile(this);
}
}
protected override void OnMouseDoubleClick(MouseEventArgs e)
{
base.OnMouseDoubleClick(e);
if (Control.ModifierKeys == Keys.Control)
{
return;
}
if (e.Button == MouseButtons.Left)
{
Execute(this.ModelInfo);
}
}
public void LoadInfo(TileModel model)
{
this.ModelInfo = model;
InvalidateGroupMenu();
}
public void LoadInfo(string filename)
{
var model = GetTileModel(filename);
if (model == null)
{
return;
}
LoadInfo(model);
}
private void Execute(TileModel model)
{
if (model == null)
{
return;
}
if (model.IsGroup)
{
return;
}
if (this.MainForm != null)
{
if (this.MainForm.CurrentSession?.HideOnExecute ?? true)
{
this.MainForm.Visible = false;
}
}
RyzStudio.Diagnostics.Process.Execute(model.CleanProcessFilename, model.CleanProcessWorkingDirectory, model.CleanProcessArgument, model.ProcessWindowStyle, model.ProcessAsAdmin);
}
private void InvalidateGroupMenu()
{
this.Title = this.ModelInfo.Title;
this.LargeIcon = (this.ModelInfo.IsGroup ? AppResource.folder_32 : RyzStudio.IO.File.GetIcon(this.ModelInfo.CleanProcessFilename));
if (this.ModelInfo.IsGroup)
{
this.ModelInfo.ProcessFilename = "";
this.ModelInfo.ProcessArgument = "";
this.ModelInfo.ProcessAsAdmin = false;
this.ModelInfo.ProcessWindowStyle = ProcessWindowStyle.Normal;
this.ModelInfo.ProcessWorkingDirectory = "";
this.ModelInfo.Version = "";
if (this.LeftContextMenuStrip == null) this.LeftContextMenuStrip = new ContextMenuStrip();
this.LeftContextMenuStrip.Items.Clear();
foreach (var item in this.ModelInfo?.Items ?? new System.Collections.Generic.List<TileModel>())
{
ToolStripItem toolItem = this.LeftContextMenuStrip.Items.Add(item.Title);
toolItem.Image = RyzStudio.IO.File.GetIcon(item.CleanProcessFilename);
toolItem.Tag = item;
toolItem.Click += (object sender, EventArgs e) =>
{
var menuItem = (System.Windows.Forms.ToolStripMenuItem)sender;
if (menuItem == null)
{
return;
}
var model = (menuItem.Tag as TileModel);
if (model == null)
{
return;
}
Execute(model);
};
}
}
toolTip1.SetToolTip(this, this.Title);
}
private TileModel GetTileModel(string filename)
{
if (string.IsNullOrWhiteSpace(filename))
{
return null;
}
TileModel model = new TileModel()
{
ProcessFilename = filename,
Title = Path.GetFileName(filename)
};
// exe
if (Path.GetExtension(filename).Equals(".exe", StringComparison.CurrentCultureIgnoreCase))
{
if (File.Exists(filename))
{
try
{
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(filename);
if (fvi != null)
{
model.Title = fvi.ProductName;
}
}
catch
{
// do nothing
}
}
if (string.IsNullOrWhiteSpace(model.Title))
{
model.Title = Path.GetFileNameWithoutExtension(filename);
}
}
return model;
} }
} }

View File

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 18
VisualStudioVersion = 17.4.33205.214 VisualStudioVersion = 18.5.11723.231
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RokettoLaunch", "RokettoLaunch.csproj", "{4833FB27-0817-4720-A54B-180369B0C374}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RokettoLaunch", "RokettoLaunch.csproj", "{4833FB27-0817-4720-A54B-180369B0C374}"
EndProject EndProject