Compare commits
No commits in common. "e9c0a7018ab4cc9b716d2b0b66c07d1e8fd933e4" and "39f54d5bba07bf440f63aa368753a4186c5c7d4f" have entirely different histories.
e9c0a7018a
...
39f54d5bba
44
MainForm.Designer.cs
generated
44
MainForm.Designer.cs
generated
@ -78,16 +78,10 @@ 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);
|
|
||||||
editToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
|
||||||
removeToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
|
||||||
toolStripMenuItem6 = new System.Windows.Forms.ToolStripMenuItem();
|
|
||||||
toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
|
|
||||||
contextMenuStrip2.SuspendLayout();
|
contextMenuStrip2.SuspendLayout();
|
||||||
menuStrip1.SuspendLayout();
|
menuStrip1.SuspendLayout();
|
||||||
tileContainerMenu1.SuspendLayout();
|
tileContainerMenu1.SuspendLayout();
|
||||||
panel1.SuspendLayout();
|
panel1.SuspendLayout();
|
||||||
tileMenu1.SuspendLayout();
|
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// saveFileDialog1
|
// saveFileDialog1
|
||||||
@ -416,38 +410,6 @@ namespace RokettoLaunch
|
|||||||
panel1.Size = new System.Drawing.Size(404, 417);
|
panel1.Size = new System.Drawing.Size(404, 417);
|
||||||
panel1.TabIndex = 9;
|
panel1.TabIndex = 9;
|
||||||
//
|
//
|
||||||
// tileMenu1
|
|
||||||
//
|
|
||||||
tileMenu1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { editToolStripMenuItem1, toolStripMenuItem6, toolStripSeparator4, removeToolStripMenuItem1 });
|
|
||||||
tileMenu1.Name = "tileMenu1";
|
|
||||||
tileMenu1.Size = new System.Drawing.Size(181, 98);
|
|
||||||
//
|
|
||||||
// editToolStripMenuItem1
|
|
||||||
//
|
|
||||||
editToolStripMenuItem1.Name = "editToolStripMenuItem1";
|
|
||||||
editToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
|
|
||||||
editToolStripMenuItem1.Text = "&Edit";
|
|
||||||
editToolStripMenuItem1.Click += editToolStripMenuItem1_Click;
|
|
||||||
//
|
|
||||||
// removeToolStripMenuItem1
|
|
||||||
//
|
|
||||||
removeToolStripMenuItem1.Name = "removeToolStripMenuItem1";
|
|
||||||
removeToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
|
|
||||||
removeToolStripMenuItem1.Text = "&Remove";
|
|
||||||
removeToolStripMenuItem1.Click += removeToolStripMenuItem1_Click;
|
|
||||||
//
|
|
||||||
// toolStripMenuItem6
|
|
||||||
//
|
|
||||||
toolStripMenuItem6.Name = "toolStripMenuItem6";
|
|
||||||
toolStripMenuItem6.Size = new System.Drawing.Size(180, 22);
|
|
||||||
toolStripMenuItem6.Text = "&Duplicate";
|
|
||||||
toolStripMenuItem6.Click += toolStripMenuItem6_Click;
|
|
||||||
//
|
|
||||||
// toolStripSeparator4
|
|
||||||
//
|
|
||||||
toolStripSeparator4.Name = "toolStripSeparator4";
|
|
||||||
toolStripSeparator4.Size = new System.Drawing.Size(177, 6);
|
|
||||||
//
|
|
||||||
// MainForm
|
// MainForm
|
||||||
//
|
//
|
||||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||||
@ -469,7 +431,6 @@ namespace RokettoLaunch
|
|||||||
menuStrip1.PerformLayout();
|
menuStrip1.PerformLayout();
|
||||||
tileContainerMenu1.ResumeLayout(false);
|
tileContainerMenu1.ResumeLayout(false);
|
||||||
panel1.ResumeLayout(false);
|
panel1.ResumeLayout(false);
|
||||||
tileMenu1.ResumeLayout(false);
|
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
PerformLayout();
|
PerformLayout();
|
||||||
}
|
}
|
||||||
@ -521,11 +482,6 @@ 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.ToolStripMenuItem editToolStripMenuItem1;
|
|
||||||
private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem1;
|
|
||||||
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem6;
|
|
||||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
144
MainForm.cs
144
MainForm.cs
@ -5,12 +5,10 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Xml.Linq;
|
|
||||||
using RokettoLaunch.Models;
|
using RokettoLaunch.Models;
|
||||||
using RyzStudio.Windows.Forms;
|
using RyzStudio.Windows.Forms;
|
||||||
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
|
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
|
||||||
using RyzStudio.Windows.TileForms;
|
using RyzStudio.Windows.TileForms;
|
||||||
using static RyzStudio.Windows.ThemedForms.ButtonTextBox.ThKeyCodeTextBox;
|
|
||||||
|
|
||||||
namespace RokettoLaunch
|
namespace RokettoLaunch
|
||||||
{
|
{
|
||||||
@ -158,41 +156,6 @@ namespace RokettoLaunch
|
|||||||
alwaysOnTopToolStripMenuItem.Checked = this.CurrentSession?.AlwaysOnTop ?? false;
|
alwaysOnTopToolStripMenuItem.Checked = this.CurrentSession?.AlwaysOnTop ?? false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void tileContainer_MouseClick(object sender, MouseEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.Button != MouseButtons.Middle)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var control = (sender as Control);
|
|
||||||
if (control == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var container = UIControl.GetParentsUntil<TileContainer>(sender as Control);
|
|
||||||
if (container == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var newCoord = container.GetNextCoord();
|
|
||||||
|
|
||||||
var tileModel = new TileModel()
|
|
||||||
{
|
|
||||||
Title = "New Tile",
|
|
||||||
IsGroup = false
|
|
||||||
};
|
|
||||||
|
|
||||||
var newTile = new RokettoLaunch.Windows.Forms.TilePanel();
|
|
||||||
newTile.ContextMenuStrip = tileMenu1;
|
|
||||||
newTile.LoadInfo(tileModel);
|
|
||||||
|
|
||||||
container.Add(newTile, newCoord.X, newCoord.Y);
|
|
||||||
|
|
||||||
_fileSessionManager.HasChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Main Menu
|
#region Main Menu
|
||||||
|
|
||||||
@ -581,7 +544,6 @@ namespace RokettoLaunch
|
|||||||
var newCoord = container.GetNextCoord();
|
var newCoord = container.GetNextCoord();
|
||||||
|
|
||||||
var newTile = new RokettoLaunch.Windows.Forms.TilePanel();
|
var newTile = new RokettoLaunch.Windows.Forms.TilePanel();
|
||||||
newTile.ContextMenuStrip = tileMenu1;
|
|
||||||
newTile.LoadInfo(result);
|
newTile.LoadInfo(result);
|
||||||
|
|
||||||
container.Add(newTile, newCoord.X, newCoord.Y);
|
container.Add(newTile, newCoord.X, newCoord.Y);
|
||||||
@ -610,7 +572,6 @@ namespace RokettoLaunch
|
|||||||
var newCoord = container.GetNextCoord();
|
var newCoord = container.GetNextCoord();
|
||||||
|
|
||||||
var newTile = new RokettoLaunch.Windows.Forms.TilePanel();
|
var newTile = new RokettoLaunch.Windows.Forms.TilePanel();
|
||||||
newTile.ContextMenuStrip = tileMenu1;
|
|
||||||
newTile.LoadInfo(result);
|
newTile.LoadInfo(result);
|
||||||
|
|
||||||
container.Add(newTile, newCoord.X, newCoord.Y);
|
container.Add(newTile, newCoord.X, newCoord.Y);
|
||||||
@ -798,99 +759,6 @@ namespace RokettoLaunch
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Tile
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Edit
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void editToolStripMenuItem1_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
var tile = UIControl.GetOwner<RokettoLaunch.Windows.Forms.TilePanel>((ToolStripMenuItem)sender);
|
|
||||||
if (tile == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tile.ModelInfo.IsGroup)
|
|
||||||
{
|
|
||||||
var form = new EditTileFolderForm(tile.ModelInfo);
|
|
||||||
if (form.ShowDialog() == DialogResult.OK)
|
|
||||||
{
|
|
||||||
tile.LoadInfo(form.Result);
|
|
||||||
|
|
||||||
_fileSessionManager.HasChanged = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var form = new EditTileForm(tile.ModelInfo);
|
|
||||||
if (form.ShowDialog() == DialogResult.OK)
|
|
||||||
{
|
|
||||||
tile.LoadInfo(form.Result);
|
|
||||||
|
|
||||||
_fileSessionManager.HasChanged = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Duplicate
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void toolStripMenuItem6_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
var tile = UIControl.GetOwner<RokettoLaunch.Windows.Forms.TilePanel>((ToolStripMenuItem)sender);
|
|
||||||
if (tile == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var container = UIControl.GetParentsUntil<TileContainer>(tile);
|
|
||||||
if (container == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var newCoord = container.GetNextCoord();
|
|
||||||
|
|
||||||
var newTile = new RokettoLaunch.Windows.Forms.TilePanel();
|
|
||||||
newTile.ContextMenuStrip = tileMenu1;
|
|
||||||
newTile.LoadInfo(tile.ModelInfo);
|
|
||||||
|
|
||||||
container.Add(newTile, newCoord.X, newCoord.Y);
|
|
||||||
|
|
||||||
_fileSessionManager.HasChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Remove
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void removeToolStripMenuItem1_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
var tile = UIControl.GetOwner<RokettoLaunch.Windows.Forms.TilePanel>((ToolStripMenuItem)sender);
|
|
||||||
if (tile == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var container = UIControl.GetParentsUntil<TileContainer>(tile);
|
|
||||||
if (container == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
container.Controls?.Remove(tile);
|
|
||||||
|
|
||||||
_fileSessionManager.HasChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
private async Task AddNewTileGroup()
|
private async Task AddNewTileGroup()
|
||||||
{
|
{
|
||||||
@ -912,24 +780,20 @@ namespace RokettoLaunch
|
|||||||
panel.Title = model.Title;
|
panel.Title = model.Title;
|
||||||
panel.IsOpen = model.IsExpanded;
|
panel.IsOpen = model.IsExpanded;
|
||||||
panel.TitleContextMenuStrip = tileContainerMenu1;
|
panel.TitleContextMenuStrip = tileContainerMenu1;
|
||||||
panel.PaddingBottom = 0;
|
|
||||||
panel.AutoSizeHeight = true;
|
panel.AutoSizeHeight = true;
|
||||||
panel.Tag = model;
|
panel.Tag = model;
|
||||||
panel.AutoSize(model.GridSize.Width, model.GridSize.Height);
|
|
||||||
panel.Height += 4;
|
|
||||||
|
|
||||||
panel.MouseClick += tileContainer_MouseClick;
|
panel.AutoSize(model.GridSize.Width, model.GridSize.Height);
|
||||||
|
|
||||||
UIControl.Add(flowLayoutPanel1, panel);
|
UIControl.Add(flowLayoutPanel1, panel);
|
||||||
|
|
||||||
// Load tiles
|
// Load tiles
|
||||||
foreach (var item2 in model.Items ?? new List<TileModel>())
|
foreach (var item2 in model.Items ?? new List<TileModel>())
|
||||||
{
|
{
|
||||||
var newTile = new RokettoLaunch.Windows.Forms.TilePanel();
|
var tile = new RokettoLaunch.Windows.Forms.TilePanel();
|
||||||
newTile.ContextMenuStrip = tileMenu1;
|
tile.LoadInfo(item2);
|
||||||
newTile.LoadInfo(item2);
|
|
||||||
|
|
||||||
panel.Add(newTile, item2.Position.X, item2.Position.Y);
|
panel.Add(tile, item2.Position.X, item2.Position.Y);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -433,9 +433,6 @@
|
|||||||
<metadata name="tileContainerMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="tileContainerMenu1.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">
|
|
||||||
<value>990, 17</value>
|
|
||||||
</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">
|
||||||
<value>
|
<value>
|
||||||
AAABAAQAMDAAAAEAIACoJQAARgAAACAgAAABACAAqBAAAO4lAAAYGAAAAQAgAIgJAACWNgAAEBAAAAEA
|
AAABAAQAMDAAAAEAIACoJQAARgAAACAgAAABACAAqBAAAO4lAAAYGAAAAQAgAIgJAACWNgAAEBAAAAEA
|
||||||
|
@ -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.2.017</Version>
|
<Version>0.3.1.042</Version>
|
||||||
<EnableNETAnalyzers>False</EnableNETAnalyzers>
|
<EnableNETAnalyzers>False</EnableNETAnalyzers>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<PackageIcon>icon-128.png</PackageIcon>
|
<PackageIcon>icon-128.png</PackageIcon>
|
||||||
|
41
Windows/Forms/TilePanel.Designer.cs
generated
41
Windows/Forms/TilePanel.Designer.cs
generated
@ -28,17 +28,48 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
components = new System.ComponentModel.Container();
|
this.components = new System.ComponentModel.Container();
|
||||||
toolTip1 = new System.Windows.Forms.ToolTip(components);
|
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||||
SuspendLayout();
|
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
||||||
|
this.contextMenuStrip1.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// contextMenuStrip1
|
||||||
|
//
|
||||||
|
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
|
this.editToolStripMenuItem,
|
||||||
|
this.removeToolStripMenuItem});
|
||||||
|
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||||
|
this.contextMenuStrip1.Size = new System.Drawing.Size(118, 48);
|
||||||
|
//
|
||||||
|
// editToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
|
||||||
|
this.editToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
|
||||||
|
this.editToolStripMenuItem.Text = "&Edit";
|
||||||
|
this.editToolStripMenuItem.Click += new System.EventHandler(this.editToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// removeToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.removeToolStripMenuItem.Name = "removeToolStripMenuItem";
|
||||||
|
this.removeToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
|
||||||
|
this.removeToolStripMenuItem.Text = "&Remove";
|
||||||
|
this.removeToolStripMenuItem.Click += new System.EventHandler(this.removeToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// TilePanel
|
// TilePanel
|
||||||
//
|
//
|
||||||
Name = "TilePanel";
|
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||||
ResumeLayout(false);
|
this.Name = "TilePanel";
|
||||||
|
this.contextMenuStrip1.ResumeLayout(false);
|
||||||
|
this.ResumeLayout(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolTip toolTip1;
|
private System.Windows.Forms.ToolTip toolTip1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
|
using System;
|
||||||
using System;
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
@ -20,6 +19,7 @@ namespace RokettoLaunch.Windows.Forms
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
this.AllowDrop = true;
|
this.AllowDrop = true;
|
||||||
|
this.ContextMenuStrip = contextMenuStrip1;
|
||||||
this.Font = new Font(this.Font.FontFamily, 8.25F);
|
this.Font = new Font(this.Font.FontFamily, 8.25F);
|
||||||
this.Size = new Size(70, 70);
|
this.Size = new Size(70, 70);
|
||||||
this.AutoScaleMode = AutoScaleMode.None;
|
this.AutoScaleMode = AutoScaleMode.None;
|
||||||
@ -49,30 +49,10 @@ namespace RokettoLaunch.Windows.Forms
|
|||||||
|
|
||||||
if (this.ModelInfo.IsGroup)
|
if (this.ModelInfo.IsGroup)
|
||||||
{
|
{
|
||||||
foreach (var item in fileList ?? new string[0])
|
this.DropFileList(fileList);
|
||||||
{
|
|
||||||
var model = GetTileModel(item);
|
|
||||||
if (model == null)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.ModelInfo.Items.Add(model);
|
|
||||||
}
|
|
||||||
|
|
||||||
InvalidateGroupMenu(this.ModelInfo);
|
InvalidateGroupMenu(this.ModelInfo);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if ((fileList?.Length ?? 0) > 0)
|
|
||||||
{
|
|
||||||
var model = GetTileModel(fileList[0]);
|
|
||||||
if (model != null)
|
|
||||||
{
|
|
||||||
LoadInfo(model);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnMouseClick(MouseEventArgs e)
|
protected override void OnMouseClick(MouseEventArgs e)
|
||||||
@ -116,6 +96,97 @@ namespace RokettoLaunch.Windows.Forms
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region Context Menu
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Edit
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void editToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (this.ModelInfo.IsGroup)
|
||||||
|
{
|
||||||
|
var form = new EditTileFolderForm(this.ModelInfo);
|
||||||
|
if (form.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
this.LoadInfo(form.Result);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var form = new EditTileForm(this.ModelInfo);
|
||||||
|
if (form.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
this.LoadInfo(form.Result);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void removeToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
this.TileContainer?.Controls?.Remove(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
public void DropFileList(string[] fileList)
|
||||||
|
{
|
||||||
|
if (fileList == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fileList.Length <= 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(fileList[0]))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
TileModel model = new TileModel()
|
||||||
|
{
|
||||||
|
ProcessFilename = fileList[0],
|
||||||
|
Title = Path.GetFileName(fileList[0])
|
||||||
|
};
|
||||||
|
|
||||||
|
// exe
|
||||||
|
if (Path.GetExtension(fileList[0]).Equals(".exe", StringComparison.CurrentCultureIgnoreCase))
|
||||||
|
{
|
||||||
|
if (File.Exists(fileList[0]))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(fileList[0]);
|
||||||
|
if (fvi != null)
|
||||||
|
{
|
||||||
|
model.Title = fvi.ProductName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(model.Title))
|
||||||
|
{
|
||||||
|
model.Title = Path.GetFileNameWithoutExtension(fileList[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.ModelInfo.Items.Add(model);
|
||||||
|
}
|
||||||
|
|
||||||
public void LoadInfo(TileModel model)
|
public void LoadInfo(TileModel model)
|
||||||
{
|
{
|
||||||
this.modelInfo = model;
|
this.modelInfo = model;
|
||||||
@ -137,7 +208,7 @@ namespace RokettoLaunch.Windows.Forms
|
|||||||
toolTip1.SetToolTip(this, this.Title);
|
toolTip1.SetToolTip(this, this.Title);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Execute(TileModel model)
|
protected void Execute(TileModel model)
|
||||||
{
|
{
|
||||||
if (model == null)
|
if (model == null)
|
||||||
{
|
{
|
||||||
@ -160,7 +231,7 @@ namespace RokettoLaunch.Windows.Forms
|
|||||||
RyzStudio.Diagnostics.Process.Execute(model.CleanProcessFilename, model.CleanProcessWorkingDirectory, model.CleanProcessArgument, model.ProcessWindowStyle, model.ProcessAsAdmin);
|
RyzStudio.Diagnostics.Process.Execute(model.CleanProcessFilename, model.CleanProcessWorkingDirectory, model.CleanProcessArgument, model.ProcessWindowStyle, model.ProcessAsAdmin);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InvalidateGroupMenu(TileModel model)
|
protected void InvalidateGroupMenu(TileModel model)
|
||||||
{
|
{
|
||||||
var iconSize = ((this.MainForm?.CurrentSession?.ShowBigIcons ?? true) ? 24 : 16);
|
var iconSize = ((this.MainForm?.CurrentSession?.ShowBigIcons ?? true) ? 24 : 16);
|
||||||
|
|
||||||
@ -196,46 +267,5 @@ namespace RokettoLaunch.Windows.Forms
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,64 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<root>
|
||||||
<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: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:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
@ -117,6 +57,9 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
|
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>17, 17</value>
|
||||||
|
</metadata>
|
||||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>172, 17</value>
|
<value>172, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
Reference in New Issue
Block a user