release/0.4.2 #5
@ -182,13 +182,13 @@ namespace RokettoLaunch.DTOs.SaveFile
|
||||
public string ResolvedStartPath { get; private set; }
|
||||
|
||||
|
||||
public Item CopyOf()
|
||||
public Item CopyOf(bool addPrefix = true)
|
||||
{
|
||||
var json = JsonSerializer.Serialize(this);
|
||||
|
||||
var newTileInfo = JsonSerializer.Deserialize<Item>(json);
|
||||
newTileInfo.Id = Guid.NewGuid();
|
||||
newTileInfo.Title = "Copy of " + newTileInfo.Title;
|
||||
newTileInfo.Title = (addPrefix ? "Copy of " : "") + newTileInfo.Title;
|
||||
newTileInfo.Position = new Point(-1, -1);
|
||||
|
||||
if (newTileInfo.IsGroup)
|
||||
|
||||
@ -10,7 +10,7 @@ namespace RokettoLaunch.DTOs.SaveFile
|
||||
|
||||
public bool ShowBigIcons { get; set; } = true;
|
||||
|
||||
public RyzStudio.Windows.ThemedForms.ButtonTextBox.ThKeyCodeTextBox.Results ShowToggleHotkey { get; set; } = null;
|
||||
public RyzStudio.Windows.FontForms.TextBox.T4KeyTextBox.Results ShowToggleHotkey { get; set; } = null;
|
||||
|
||||
public bool HideOnClose { get; set; } = true;
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ namespace RokettoLaunch.Forms
|
||||
public class CopyToTileForm : Form
|
||||
{
|
||||
private Label label1;
|
||||
private ThPickerBox pickerBox1;
|
||||
private RyzStudio.Windows.ThemedForms.T3PickerBox pickerBox1;
|
||||
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ namespace RokettoLaunch.Forms
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
UISetup.Dialog(this, true);
|
||||
this.SetupDialog();
|
||||
|
||||
this.Text = "Copy To...";
|
||||
|
||||
@ -40,7 +40,7 @@ namespace RokettoLaunch.Forms
|
||||
private void InitializeComponent()
|
||||
{
|
||||
label1 = new Label();
|
||||
pickerBox1 = new ThPickerBox();
|
||||
pickerBox1 = new RyzStudio.Windows.ThemedForms.T3PickerBox();
|
||||
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
|
||||
SuspendLayout();
|
||||
//
|
||||
|
||||
@ -1,22 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using RokettoLaunch.DTOs.SaveFile;
|
||||
using RyzStudio.Windows.Forms;
|
||||
using RyzStudio.Windows.ThemedForms;
|
||||
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
|
||||
|
||||
namespace RokettoLaunch.Forms
|
||||
{
|
||||
public class EditFolderForm : Form
|
||||
{
|
||||
private Label label1;
|
||||
private ThClearableTextBox textBox1;
|
||||
private ThListBox listBox1;
|
||||
private RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox textBox1;
|
||||
private RyzStudio.Windows.ThemedForms.T3ListBox listBox1;
|
||||
private Label label2;
|
||||
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
|
||||
|
||||
@ -24,11 +20,18 @@ namespace RokettoLaunch.Forms
|
||||
private App4Options.Item result = null;
|
||||
|
||||
|
||||
public EditFolderForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.SetupDialog();
|
||||
}
|
||||
|
||||
public EditFolderForm(App4Options.Item model = null)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
UISetup.Dialog(this, true);
|
||||
this.SetupDialog();
|
||||
|
||||
this.Text = (result == null) ? "Add Folder" : "Edit Folder";
|
||||
|
||||
@ -54,9 +57,9 @@ namespace RokettoLaunch.Forms
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
textBox1 = new ThClearableTextBox();
|
||||
textBox1 = new RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox();
|
||||
label1 = new Label();
|
||||
listBox1 = new ThListBox();
|
||||
listBox1 = new RyzStudio.Windows.ThemedForms.T3ListBox();
|
||||
label2 = new Label();
|
||||
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
|
||||
SuspendLayout();
|
||||
@ -92,6 +95,7 @@ namespace RokettoLaunch.Forms
|
||||
//
|
||||
// listBox1
|
||||
//
|
||||
listBox1.AllowDrop = true;
|
||||
listBox1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
listBox1.BackColor = Color.Transparent;
|
||||
listBox1.EnableMovable = false;
|
||||
|
||||
@ -3,8 +3,6 @@ using System.Windows.Forms;
|
||||
using RokettoLaunch.DTOs.SaveFile;
|
||||
using RokettoLaunch.Windows.Forms;
|
||||
using RyzStudio.Windows.Forms;
|
||||
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
|
||||
using RyzStudio.Windows.ThemedForms.PickerBox;
|
||||
|
||||
namespace RokettoLaunch.Forms
|
||||
{
|
||||
@ -12,13 +10,13 @@ namespace RokettoLaunch.Forms
|
||||
{
|
||||
private Label label2;
|
||||
private Label label1;
|
||||
private ThYesNoPickerBox pickerBox1;
|
||||
private ThClearableTextBox textBox1;
|
||||
private RyzStudio.Windows.ThemedForms.T3YnPickerBox pickerBox1;
|
||||
private RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox textBox1;
|
||||
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
|
||||
private THorizontalSeparator horizontalSeparator1;
|
||||
private RyzStudio.Windows.ThemedForms.ThNumericBox numericBox1;
|
||||
private RyzStudio.Windows.ThemedForms.T4NumericBox numericBox1;
|
||||
private Label label4;
|
||||
private RyzStudio.Windows.ThemedForms.ThNumericBox numericBox2;
|
||||
private RyzStudio.Windows.ThemedForms.T4NumericBox numericBox2;
|
||||
private Label label3;
|
||||
private App4Options.Group result = null;
|
||||
|
||||
@ -27,7 +25,7 @@ namespace RokettoLaunch.Forms
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
UISetup.Dialog(this, true);
|
||||
this.SetupDialog();
|
||||
|
||||
this.Text = (result == null) ? "Add Group" : "Edit Group";
|
||||
|
||||
@ -53,15 +51,15 @@ namespace RokettoLaunch.Forms
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
textBox1 = new ThClearableTextBox();
|
||||
textBox1 = new RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox();
|
||||
label2 = new Label();
|
||||
label1 = new Label();
|
||||
pickerBox1 = new ThYesNoPickerBox();
|
||||
pickerBox1 = new RyzStudio.Windows.ThemedForms.T3YnPickerBox();
|
||||
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
|
||||
horizontalSeparator1 = new THorizontalSeparator();
|
||||
numericBox1 = new RyzStudio.Windows.ThemedForms.ThNumericBox();
|
||||
numericBox1 = new RyzStudio.Windows.ThemedForms.T4NumericBox();
|
||||
label4 = new Label();
|
||||
numericBox2 = new RyzStudio.Windows.ThemedForms.ThNumericBox();
|
||||
numericBox2 = new RyzStudio.Windows.ThemedForms.T4NumericBox();
|
||||
label3 = new Label();
|
||||
SuspendLayout();
|
||||
//
|
||||
|
||||
@ -4,9 +4,6 @@ using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using RokettoLaunch.DTOs.SaveFile;
|
||||
using RyzStudio.Windows.Forms;
|
||||
using RyzStudio.Windows.ThemedForms;
|
||||
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
|
||||
using RyzStudio.Windows.ThemedForms.PickerBox;
|
||||
|
||||
namespace RokettoLaunch.Forms
|
||||
{
|
||||
@ -18,13 +15,13 @@ namespace RokettoLaunch.Forms
|
||||
private Label label3;
|
||||
private Label label2;
|
||||
private Label label1;
|
||||
private ThPathTextBox textBox2;
|
||||
private ThClearableTextBox textBox3;
|
||||
private ThPathTextBox textBox4;
|
||||
private ThPickerBox pickerBox1;
|
||||
private ThYesNoPickerBox pickerBox2;
|
||||
private RyzStudio.Windows.FontForms.TextBox.T4PathTextBox textBox2;
|
||||
private RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox textBox3;
|
||||
private RyzStudio.Windows.FontForms.TextBox.T4PathTextBox textBox4;
|
||||
private RyzStudio.Windows.ThemedForms.T3PickerBox pickerBox1;
|
||||
private RyzStudio.Windows.ThemedForms.T3YnPickerBox pickerBox2;
|
||||
private THorizontalSeparator horizontalSeparator1;
|
||||
private ThClearableTextBox textBox1;
|
||||
private RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox textBox1;
|
||||
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
|
||||
|
||||
|
||||
@ -35,7 +32,7 @@ namespace RokettoLaunch.Forms
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
UISetup.Dialog(this, true);
|
||||
this.SetupDialog();
|
||||
|
||||
this.Text = (result == null) ? "Add Tile" : "Edit Tile";
|
||||
|
||||
@ -58,18 +55,18 @@ namespace RokettoLaunch.Forms
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
textBox1 = new ThClearableTextBox();
|
||||
textBox1 = new RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox();
|
||||
label6 = new Label();
|
||||
label7 = new Label();
|
||||
label4 = new Label();
|
||||
label3 = new Label();
|
||||
label2 = new Label();
|
||||
label1 = new Label();
|
||||
textBox2 = new ThPathTextBox();
|
||||
textBox3 = new ThClearableTextBox();
|
||||
textBox4 = new ThPathTextBox();
|
||||
pickerBox1 = new ThPickerBox();
|
||||
pickerBox2 = new ThYesNoPickerBox();
|
||||
textBox2 = new RyzStudio.Windows.FontForms.TextBox.T4PathTextBox();
|
||||
textBox3 = new RyzStudio.Windows.FontForms.TextBox.T4ClearTextBox();
|
||||
textBox4 = new RyzStudio.Windows.FontForms.TextBox.T4PathTextBox();
|
||||
pickerBox1 = new RyzStudio.Windows.ThemedForms.T3PickerBox();
|
||||
pickerBox2 = new RyzStudio.Windows.ThemedForms.T3YnPickerBox();
|
||||
horizontalSeparator1 = new THorizontalSeparator();
|
||||
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
|
||||
SuspendLayout();
|
||||
@ -177,7 +174,7 @@ namespace RokettoLaunch.Forms
|
||||
//
|
||||
textBox2.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||
textBox2.BackColor = Color.Transparent;
|
||||
textBox2.DialogMode = ThPathTextBox.DialogType.OpenFile;
|
||||
textBox2.DialogMode = RyzStudio.Windows.FontForms.TextBox.T4PathTextBox.DialogType.OpenFile;
|
||||
textBox2.EnableMovable = false;
|
||||
textBox2.FolderBrowserDialog = null;
|
||||
textBox2.Icon = "D";
|
||||
@ -208,7 +205,7 @@ namespace RokettoLaunch.Forms
|
||||
//
|
||||
textBox4.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||
textBox4.BackColor = Color.Transparent;
|
||||
textBox4.DialogMode = ThPathTextBox.DialogType.FolderBrowser;
|
||||
textBox4.DialogMode = RyzStudio.Windows.FontForms.TextBox.T4PathTextBox.DialogType.FolderBrowser;
|
||||
textBox4.EnableMovable = false;
|
||||
textBox4.FolderBrowserDialog = null;
|
||||
textBox4.Icon = "D";
|
||||
|
||||
@ -11,8 +11,8 @@ namespace RokettoLaunch.Forms
|
||||
public class LoadingForm : Form
|
||||
{
|
||||
private TProgressBar progressBar1;
|
||||
private RyzStudio.Windows.ThemedForms.ThUserControl userControl1;
|
||||
private RyzStudio.Windows.ThemedForms.ThUserControl userControl2;
|
||||
private RyzStudio.Windows.ThemedForms.T3UserControl userControl1;
|
||||
private RyzStudio.Windows.ThemedForms.T3UserControl userControl2;
|
||||
private TProgressBar progressBar2;
|
||||
|
||||
private App4Options result = null;
|
||||
@ -25,7 +25,7 @@ namespace RokettoLaunch.Forms
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
UISetup.Dialog(this, true);
|
||||
this.SetupDialog();
|
||||
|
||||
this.Text = "Loading";
|
||||
}
|
||||
@ -34,8 +34,8 @@ namespace RokettoLaunch.Forms
|
||||
private void InitializeComponent()
|
||||
{
|
||||
progressBar1 = new TProgressBar();
|
||||
userControl1 = new RyzStudio.Windows.ThemedForms.ThUserControl();
|
||||
userControl2 = new RyzStudio.Windows.ThemedForms.ThUserControl();
|
||||
userControl1 = new RyzStudio.Windows.ThemedForms.T3UserControl();
|
||||
userControl2 = new RyzStudio.Windows.ThemedForms.T3UserControl();
|
||||
progressBar2 = new TProgressBar();
|
||||
label1 = new Label();
|
||||
label2 = new Label();
|
||||
@ -137,8 +137,8 @@ namespace RokettoLaunch.Forms
|
||||
{
|
||||
this.Clear();
|
||||
|
||||
UIControl.SetText(label1, "Loading...");
|
||||
UIControl.SetText(label2, "... " + Path.GetFileName(loadFilename));
|
||||
label1.SetText("Loading...");
|
||||
label2.SetText("... " + Path.GetFileName(loadFilename));
|
||||
|
||||
var newSession = await LoadSaveSessionWithVersion(loadFilename);
|
||||
|
||||
@ -146,12 +146,12 @@ namespace RokettoLaunch.Forms
|
||||
progressBar1.Maximum = newSession.Groups?.Count ?? 0;
|
||||
progressBar2.Maximum = 0;
|
||||
|
||||
UIControl.SetText(label1, "Counting...");
|
||||
UIControl.SetText(label2, "");
|
||||
label1.SetText("Counting...");
|
||||
label2.SetText("");
|
||||
|
||||
foreach (var group in newSession?.Groups ?? new List<App4Options.Group>())
|
||||
{
|
||||
UIControl.SetText(label2, "... " + group.Title);
|
||||
label2.SetText("... " + group.Title);
|
||||
|
||||
foreach (var item in group?.Items ?? new List<App4Options.Item>())
|
||||
{
|
||||
@ -169,8 +169,8 @@ namespace RokettoLaunch.Forms
|
||||
// Resolve paths
|
||||
progressBar2.Value = 0;
|
||||
|
||||
UIControl.SetText(label1, "Seeking...");
|
||||
UIControl.SetText(label2, "");
|
||||
label1.SetText("Seeking...");
|
||||
label2.SetText("");
|
||||
|
||||
// Resolve paths
|
||||
foreach (var group in newSession?.Groups ?? new List<App4Options.Group>())
|
||||
@ -179,7 +179,7 @@ namespace RokettoLaunch.Forms
|
||||
{
|
||||
progressBar1.Value++;
|
||||
|
||||
UIControl.SetText(label2, "... " + group.Title);
|
||||
label2.SetText("... " + group.Title);
|
||||
|
||||
if (item.IsGroup)
|
||||
{
|
||||
@ -187,7 +187,7 @@ namespace RokettoLaunch.Forms
|
||||
{
|
||||
progressBar2.Value++;
|
||||
|
||||
UIControl.SetText(label2, "... " + subItem.Title);
|
||||
label2.SetText("... " + subItem.Title);
|
||||
|
||||
subItem.ResolvePaths();
|
||||
}
|
||||
@ -196,7 +196,7 @@ namespace RokettoLaunch.Forms
|
||||
{
|
||||
progressBar2.Value++;
|
||||
|
||||
UIControl.SetText(label2, "... " + item.Title);
|
||||
label2.SetText("... " + item.Title);
|
||||
|
||||
item.ResolvePaths();
|
||||
}
|
||||
@ -205,8 +205,8 @@ namespace RokettoLaunch.Forms
|
||||
|
||||
result = newSession;
|
||||
|
||||
UIControl.SetText(label1, "Done");
|
||||
UIControl.SetText(label2, "Done");
|
||||
label1.SetText("Done");
|
||||
label2.SetText("Done");
|
||||
});
|
||||
|
||||
this.DialogResult = DialogResult.OK;
|
||||
@ -237,8 +237,8 @@ namespace RokettoLaunch.Forms
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
UIControl.SetText(label1, "Ready");
|
||||
UIControl.SetText(label2, "");
|
||||
label1.SetText("Ready");
|
||||
label2.SetText("");
|
||||
|
||||
progressBar1.Value = progressBar1.Maximum = 0;
|
||||
progressBar2.Value = progressBar2.Maximum = 0;
|
||||
|
||||
@ -2,9 +2,6 @@
|
||||
using System.Windows.Forms;
|
||||
using RokettoLaunch.DTOs.SaveFile;
|
||||
using RyzStudio.Windows.Forms;
|
||||
using RyzStudio.Windows.ThemedForms;
|
||||
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
|
||||
using RyzStudio.Windows.ThemedForms.PickerBox;
|
||||
|
||||
namespace RokettoLaunch.Forms
|
||||
{
|
||||
@ -20,12 +17,12 @@ namespace RokettoLaunch.Forms
|
||||
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 RyzStudio.Windows.ThemedForms.T3YnPickerBox yesNoPickerBox1;
|
||||
private RyzStudio.Windows.ThemedForms.T4NumericBox numericBox1;
|
||||
private RyzStudio.Windows.ThemedForms.T3YnPickerBox yesNoPickerBox4;
|
||||
private RyzStudio.Windows.FontForms.TextBox.T4KeyTextBox textBox1;
|
||||
private RyzStudio.Windows.ThemedForms.T3YnPickerBox yesNoPickerBox2;
|
||||
private RyzStudio.Windows.ThemedForms.T3YnPickerBox yesNoPickerBox3;
|
||||
private TTogglePanel togglePanel3;
|
||||
|
||||
private App4Options _appSession = null;
|
||||
@ -35,11 +32,11 @@ namespace RokettoLaunch.Forms
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
UISetup.Dialog(this, true);
|
||||
UISetup.AutoSizeChildren(flowLayoutPanel1);
|
||||
this.SetupDialog();
|
||||
|
||||
_appSession = appSession;
|
||||
|
||||
flowLayoutPanel1.AutoSizeChildren();
|
||||
numericBox1.Minimum = 4;
|
||||
numericBox1.Maximum = 24;
|
||||
}
|
||||
@ -50,7 +47,7 @@ namespace RokettoLaunch.Forms
|
||||
|
||||
numericBox1.Value = _appSession?.TilesPerRow ?? 4;
|
||||
yesNoPickerBox1.Value = _appSession?.ShowBigIcons ?? true;
|
||||
textBox1.UpdateKeyCode(_appSession?.ShowToggleHotkey ?? new ThKeyCodeTextBox.Results());
|
||||
textBox1.UpdateKeyCode(_appSession?.ShowToggleHotkey ?? new RyzStudio.Windows.FontForms.TextBox.T4KeyTextBox.Results());
|
||||
yesNoPickerBox4.Value = _appSession?.AlwaysOnTop ?? true;
|
||||
yesNoPickerBox2.Value = _appSession?.HideOnClose ?? true;
|
||||
yesNoPickerBox3.Value = _appSession?.HideOnExecute ?? true;
|
||||
@ -58,24 +55,24 @@ namespace RokettoLaunch.Forms
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
ThKeyCodeTextBox.Results results1 = new ThKeyCodeTextBox.Results();
|
||||
RyzStudio.Windows.FontForms.TextBox.T4KeyTextBox.Results results1 = new RyzStudio.Windows.FontForms.TextBox.T4KeyTextBox.Results();
|
||||
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
|
||||
flowLayoutPanel1 = new FlowLayoutPanel();
|
||||
togglePanel1 = new TTogglePanel();
|
||||
yesNoPickerBox1 = new ThYesNoPickerBox();
|
||||
numericBox1 = new ThNumericBox();
|
||||
yesNoPickerBox1 = new RyzStudio.Windows.ThemedForms.T3YnPickerBox();
|
||||
numericBox1 = new RyzStudio.Windows.ThemedForms.T4NumericBox();
|
||||
label2 = new Label();
|
||||
label4 = new Label();
|
||||
togglePanel2 = new TTogglePanel();
|
||||
label6 = new Label();
|
||||
yesNoPickerBox4 = new ThYesNoPickerBox();
|
||||
textBox1 = new ThKeyCodeTextBox();
|
||||
yesNoPickerBox2 = new ThYesNoPickerBox();
|
||||
yesNoPickerBox4 = new RyzStudio.Windows.ThemedForms.T3YnPickerBox();
|
||||
textBox1 = new RyzStudio.Windows.FontForms.TextBox.T4KeyTextBox();
|
||||
yesNoPickerBox2 = new RyzStudio.Windows.ThemedForms.T3YnPickerBox();
|
||||
label3 = new Label();
|
||||
label1 = new Label();
|
||||
togglePanel3 = new TTogglePanel();
|
||||
label7 = new Label();
|
||||
yesNoPickerBox3 = new ThYesNoPickerBox();
|
||||
yesNoPickerBox3 = new RyzStudio.Windows.ThemedForms.T3YnPickerBox();
|
||||
flowLayoutPanel1.SuspendLayout();
|
||||
togglePanel1.SuspendLayout();
|
||||
togglePanel2.SuspendLayout();
|
||||
|
||||
303
MainForm.cs
303
MainForm.cs
@ -10,9 +10,9 @@ using RokettoLaunch.DTOs.SaveFile;
|
||||
using RokettoLaunch.Forms;
|
||||
using RokettoLaunch.Windows.Forms;
|
||||
using RyzStudio;
|
||||
using RyzStudio.Services;
|
||||
using RyzStudio.Windows.FontForms.TextBox;
|
||||
using RyzStudio.Windows.Forms;
|
||||
using RyzStudio.Windows.ThemedForms;
|
||||
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
|
||||
|
||||
namespace RokettoLaunch
|
||||
{
|
||||
@ -49,15 +49,23 @@ namespace RokettoLaunch
|
||||
{
|
||||
base.OnShown(e);
|
||||
|
||||
var args = WinApplication.GetCommandLine();
|
||||
var args = this.GetCommandLine();
|
||||
|
||||
string jsonfigFilename = null;
|
||||
if (!args.TryGetValue("open", out jsonfigFilename))
|
||||
{
|
||||
if (!args.TryGetValue("o", out jsonfigFilename))
|
||||
{
|
||||
jsonfigFilename = null;
|
||||
}
|
||||
}
|
||||
|
||||
string jsonfigFilename = args.Where(x => (x.Key.Equals("o") || x.Key.Equals("open"))).Select(x => x.Value).FirstOrDefault();
|
||||
if (string.IsNullOrWhiteSpace(jsonfigFilename))
|
||||
{
|
||||
jsonfigFilename = Path.ChangeExtension(Application.ExecutablePath, "jsonfig");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(jsonfigFilename) && File.Exists(jsonfigFilename))
|
||||
if (File.Exists(jsonfigFilename))
|
||||
{
|
||||
await _fileSessionManager.OpenSession(jsonfigFilename);
|
||||
}
|
||||
@ -66,7 +74,7 @@ namespace RokettoLaunch
|
||||
//await _fileSessionManager.NewSession();
|
||||
}
|
||||
|
||||
UIControl.SetFocus(this);
|
||||
UIControl.Invoke(this, (x) => this.Focus());
|
||||
}
|
||||
|
||||
protected async override void OnFormClosing(FormClosingEventArgs e)
|
||||
@ -95,7 +103,7 @@ namespace RokettoLaunch
|
||||
return;
|
||||
}
|
||||
|
||||
if ((this.CurrentSession?.ShowToggleHotkey ?? new ThKeyCodeTextBox.Results()).Key != Keys.None)
|
||||
if ((this.CurrentSession?.ShowToggleHotkey ?? new T4KeyTextBox.Results()).Key != Keys.None)
|
||||
{
|
||||
#if !DEBUG
|
||||
RyzStudio.Runtime.InteropServices.User32.UnregisterHotKey((IntPtr)Handle, 1);
|
||||
@ -149,17 +157,17 @@ namespace RokettoLaunch
|
||||
{
|
||||
if (!this.CurrentSession.StartPosition.IsEmpty)
|
||||
{
|
||||
UIControl.SetLocation(this, this.CurrentSession.StartPosition);
|
||||
UIControl.Invoke(this, (x) => this.Location = this.CurrentSession.StartPosition);
|
||||
}
|
||||
|
||||
if (this.CurrentSession.Width > 0)
|
||||
{
|
||||
UIControl.SetClientWidth(this, this.CurrentSession.Width);
|
||||
UIControl.Invoke(this, (x) => this.Width = this.CurrentSession.Width);
|
||||
}
|
||||
|
||||
if (this.CurrentSession.Height > 0)
|
||||
{
|
||||
UIControl.SetClientHeight(this, this.CurrentSession.Height);
|
||||
UIControl.Invoke(this, (x) => this.Height = this.CurrentSession.Height);
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,7 +179,7 @@ namespace RokettoLaunch
|
||||
RyzStudio.Runtime.InteropServices.User32.UnregisterHotKey((IntPtr)Handle, 1);
|
||||
});
|
||||
|
||||
if ((this.CurrentSession?.ShowToggleHotkey ?? new ThKeyCodeTextBox.Results()).Key != Keys.None)
|
||||
if ((this.CurrentSession?.ShowToggleHotkey ?? new RyzStudio.Windows.FontForms.TextBox.T4KeyTextBox.Results()).Key != Keys.None)
|
||||
{
|
||||
UIControl.Invoke(this, (x) =>
|
||||
{
|
||||
@ -180,7 +188,7 @@ namespace RokettoLaunch
|
||||
}
|
||||
#endif
|
||||
|
||||
UIControl.SetTopMost(this, this.CurrentSession.AlwaysOnTop);
|
||||
UIControl.Invoke(this, (x) => this.TopMost = this.CurrentSession.AlwaysOnTop);
|
||||
}
|
||||
|
||||
private void MainMenuStrip_MenuActivate(object sender, EventArgs e)
|
||||
@ -381,7 +389,7 @@ namespace RokettoLaunch
|
||||
/// <param name="e"></param>
|
||||
private void AboutToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var form = new RyzStudio.Windows.ThemedForms.AboutForm();
|
||||
var form = new RyzStudio.Forms.T3AboutForm();
|
||||
form.ProductURL = AppResource.AppProductURL;
|
||||
form.AuthorURL = AppResource.AppAuthorURL;
|
||||
form.CompanyURL = AppResource.AppCompanyURL;
|
||||
@ -425,7 +433,7 @@ namespace RokettoLaunch
|
||||
// Enforce minimum number of rows
|
||||
this.CurrentSession.TilesPerRow = Math.Max(this.CurrentSession.TilesPerRow, TileLayoutPanel.MIN_COLUMNS);
|
||||
|
||||
UIControl.Clear(flowLayoutPanel1);
|
||||
UIControl.Invoke(flowLayoutPanel1, (x) => flowLayoutPanel1.Controls.Clear());
|
||||
|
||||
AddGroupToolStripMenuItem_Click(null, null);
|
||||
|
||||
@ -490,7 +498,7 @@ namespace RokettoLaunch
|
||||
this.CurrentSession.Width = this.DisplayRectangle.Width;
|
||||
this.CurrentSession.Height = this.DisplayRectangle.Height;
|
||||
|
||||
var result = GenericResult.Create();
|
||||
var result = MethodResult.Create();
|
||||
|
||||
switch (Path.GetExtension(filename?.ToLower()?.Trim() ?? string.Empty))
|
||||
{
|
||||
@ -511,34 +519,34 @@ namespace RokettoLaunch
|
||||
result = await RyzStudio.IO.Compression.ZFile.WriteFile(filename, "Document.json", this.CurrentSession);
|
||||
break;
|
||||
default:
|
||||
result = GenericResult.Fault("Format not supported");
|
||||
result = MethodResult.Error("Format not supported");
|
||||
break;
|
||||
}
|
||||
|
||||
if (result.IsSuccess)
|
||||
if (result.Success)
|
||||
{
|
||||
if (showNotices)
|
||||
{
|
||||
ThMessageBox.Show(this, "Session saved!", "Save session", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
RyzStudio.Forms.T3MessageBox.Show(this, "Session saved!", "Save session", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (showNotices)
|
||||
{
|
||||
ThMessageBox.Show(this, "Session saved!", "Save session");
|
||||
RyzStudio.Forms.T3MessageBox.Show(this, "Session saved!", "Save session");
|
||||
}
|
||||
}
|
||||
|
||||
isBusy = false;
|
||||
|
||||
return result.IsSuccess;
|
||||
return result.Success;
|
||||
});
|
||||
}
|
||||
|
||||
private async Task<bool> fileSessionManager_OnClearSession(FileSessionManager sender)
|
||||
{
|
||||
UIControl.Clear(flowLayoutPanel1);
|
||||
UIControl.Invoke(flowLayoutPanel1, (x) => flowLayoutPanel1.Controls.Clear());
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -550,13 +558,13 @@ namespace RokettoLaunch
|
||||
switch (sender.SessionState)
|
||||
{
|
||||
case FileSessionManager.SessionStateEnum.New:
|
||||
UIControl.SetText(this, "New Session - " + Application.ProductName);
|
||||
this.SetText("New Session - " + Application.ProductName);
|
||||
break;
|
||||
case FileSessionManager.SessionStateEnum.Open:
|
||||
UIControl.SetText(this, Path.GetFileNameWithoutExtension(filename) + " - " + Application.ProductName);
|
||||
this.SetText(Path.GetFileNameWithoutExtension(filename) + " - " + Application.ProductName);
|
||||
break;
|
||||
case FileSessionManager.SessionStateEnum.Close:
|
||||
UIControl.SetText(this, Application.ProductName);
|
||||
this.SetText(Application.ProductName);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -575,7 +583,7 @@ namespace RokettoLaunch
|
||||
/// <param name="e"></param>
|
||||
private void AddTileToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var panel = UIControl.GetOwner<TToggleHeaderPanel>((ToolStripMenuItem)sender);
|
||||
var panel = ((ToolStripMenuItem)sender).GetOwner<TToggleHeaderPanel>();
|
||||
if (panel == null)
|
||||
{
|
||||
return;
|
||||
@ -586,32 +594,35 @@ namespace RokettoLaunch
|
||||
return;
|
||||
}
|
||||
|
||||
var groupInfo = this.CurrentSession.Groups.Where(x => x.Id == panel.ToggleControlId.Value).FirstOrDefault();
|
||||
if (groupInfo == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
AddNewTile(panel.ToggleControlId.Value, (TileLayoutPanel)panel.ToggleControl);
|
||||
|
||||
var newTileInfo = new App4Options.Item()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Title = "New Tile",
|
||||
IsGroup = false,
|
||||
Position = new Point(-1, -1)
|
||||
};
|
||||
//var groupInfo = this.CurrentSession.Groups.Where(x => x.Id == panel.ToggleControlId.Value).FirstOrDefault();
|
||||
//if (groupInfo == null)
|
||||
//{
|
||||
// return;
|
||||
//}
|
||||
|
||||
newTileInfo = groupInfo.AddItem(newTileInfo);
|
||||
//var newTileInfo = new App4Options.Item()
|
||||
//{
|
||||
// Id = Guid.NewGuid(),
|
||||
// Title = "New Tile",
|
||||
// IsGroup = false,
|
||||
// Position = new Point(-1, -1)
|
||||
//};
|
||||
|
||||
// Update table layout
|
||||
var newTilePanel = CreateTile(newTileInfo);
|
||||
//newTileInfo = groupInfo.AddItem(newTileInfo);
|
||||
|
||||
var tableLayout = (TileLayoutPanel)panel.ToggleControl;
|
||||
tableLayout.AddTilePanel(newTilePanel, newTileInfo.Position.X, newTileInfo.Position.Y);
|
||||
tableLayout.SetGridSize(groupInfo.GridSize);
|
||||
//// Update table layout
|
||||
//var newTilePanel = CreateTile(newTileInfo);
|
||||
|
||||
//var tableLayout = (TileLayoutPanel)panel.ToggleControl;
|
||||
//tableLayout.AddTilePanel(newTilePanel, newTileInfo.Position.X, newTileInfo.Position.Y);
|
||||
//tableLayout.SetGridSize(groupInfo.GridSize);
|
||||
|
||||
_fileSessionManager.HasChanged = true;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Add Folder
|
||||
/// </summary>
|
||||
@ -619,7 +630,7 @@ namespace RokettoLaunch
|
||||
/// <param name="e"></param>
|
||||
private void AddFolderToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var panel = UIControl.GetOwner<TToggleHeaderPanel>((ToolStripMenuItem)sender);
|
||||
var panel = ((ToolStripMenuItem)sender).GetOwner<TToggleHeaderPanel>();
|
||||
if (panel == null)
|
||||
{
|
||||
return;
|
||||
@ -663,7 +674,7 @@ namespace RokettoLaunch
|
||||
/// <param name="e"></param>
|
||||
private void EditGroupToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var panel = UIControl.GetOwner<TToggleHeaderPanel>((ToolStripMenuItem)sender);
|
||||
var panel = ((ToolStripMenuItem)sender).GetOwner<TToggleHeaderPanel>();
|
||||
if (panel == null)
|
||||
{
|
||||
return;
|
||||
@ -707,7 +718,7 @@ namespace RokettoLaunch
|
||||
/// <param name="e"></param>
|
||||
private async void toolStripMenuItem5_Click(object sender, EventArgs e)
|
||||
{
|
||||
var panel = UIControl.GetOwner<TToggleHeaderPanel>((ToolStripMenuItem)sender);
|
||||
var panel = ((ToolStripMenuItem)sender).GetOwner<TToggleHeaderPanel>();
|
||||
if (panel == null)
|
||||
{
|
||||
return;
|
||||
@ -745,19 +756,19 @@ namespace RokettoLaunch
|
||||
/// <param name="e"></param>
|
||||
private void MoveTopToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var panel = UIControl.GetOwner<TToggleHeaderPanel>((ToolStripDropDownItem)sender);
|
||||
var panel = ((ToolStripDropDownItem)sender).GetOwner<TToggleHeaderPanel>();
|
||||
if (panel == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Move header
|
||||
UIControl.MoveTop(flowLayoutPanel1, panel);
|
||||
flowLayoutPanel1.MoveTop(panel);
|
||||
|
||||
// Move sidecar
|
||||
if (panel.ToggleControl != null)
|
||||
{
|
||||
UIControl.MoveNext(flowLayoutPanel1, panel, panel.ToggleControl);
|
||||
flowLayoutPanel1.MoveNext(panel, panel.ToggleControl);
|
||||
}
|
||||
|
||||
// Move group
|
||||
@ -780,19 +791,19 @@ namespace RokettoLaunch
|
||||
/// <param name="e"></param>
|
||||
private void MoveUpToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var panel = UIControl.GetOwner<TToggleHeaderPanel>((ToolStripDropDownItem)sender);
|
||||
var panel = ((ToolStripDropDownItem)sender).GetOwner<TToggleHeaderPanel>();
|
||||
if (panel == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Move header
|
||||
UIControl.MovePos(flowLayoutPanel1, panel, -2);
|
||||
flowLayoutPanel1.MovePos(panel, -2);
|
||||
|
||||
// Move sidecar
|
||||
if (panel.ToggleControl != null)
|
||||
{
|
||||
UIControl.MoveNext(flowLayoutPanel1, panel, panel.ToggleControl);
|
||||
flowLayoutPanel1.MoveNext(panel, panel.ToggleControl);
|
||||
}
|
||||
|
||||
// Move group
|
||||
@ -815,19 +826,19 @@ namespace RokettoLaunch
|
||||
/// <param name="e"></param>
|
||||
private void MoveDownToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var panel = UIControl.GetOwner<TToggleHeaderPanel>((ToolStripDropDownItem)sender);
|
||||
var panel = ((ToolStripDropDownItem)sender).GetOwner<TToggleHeaderPanel>();
|
||||
if (panel == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Move header
|
||||
UIControl.MovePos(flowLayoutPanel1, panel, 3);
|
||||
flowLayoutPanel1.MovePos(panel, 3);
|
||||
|
||||
// Move sidecar
|
||||
if (panel.ToggleControl != null)
|
||||
{
|
||||
UIControl.MovePos(flowLayoutPanel1, panel.ToggleControl, 3);
|
||||
flowLayoutPanel1.MovePos(panel.ToggleControl, 3);
|
||||
}
|
||||
|
||||
// Move group
|
||||
@ -850,19 +861,19 @@ namespace RokettoLaunch
|
||||
/// <param name="e"></param>
|
||||
private void MoveBottomToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var panel = UIControl.GetOwner<TToggleHeaderPanel>((ToolStripDropDownItem)sender);
|
||||
var panel = ((ToolStripDropDownItem)sender).GetOwner<TToggleHeaderPanel>();
|
||||
if (panel == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Move header
|
||||
UIControl.MoveBottom(flowLayoutPanel1, panel);
|
||||
flowLayoutPanel1.MoveBottom(panel);
|
||||
|
||||
// Move sidecar
|
||||
if (panel.ToggleControl != null)
|
||||
{
|
||||
UIControl.MoveNext(flowLayoutPanel1, panel, panel.ToggleControl);
|
||||
flowLayoutPanel1.MoveNext(panel, panel.ToggleControl);
|
||||
}
|
||||
|
||||
// Move group
|
||||
@ -892,7 +903,7 @@ namespace RokettoLaunch
|
||||
return;
|
||||
}
|
||||
|
||||
var panel = UIControl.GetOwner<TToggleHeaderPanel>((ToolStripMenuItem)sender);
|
||||
var panel = ((ToolStripMenuItem)sender).GetOwner<TToggleHeaderPanel>();
|
||||
if (panel?.Parent == null)
|
||||
{
|
||||
return;
|
||||
@ -929,7 +940,7 @@ namespace RokettoLaunch
|
||||
/// <param name="e"></param>
|
||||
private void EditTileToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var tilePanel = UIControl.GetOwner<TilePanel>((ToolStripMenuItem)sender);
|
||||
var tilePanel = ((ToolStripMenuItem)sender).GetOwner<TilePanel>();
|
||||
|
||||
var tileInfo = this.GetTileInfo(tilePanel);
|
||||
if (tileInfo == null)
|
||||
@ -976,7 +987,7 @@ namespace RokettoLaunch
|
||||
/// <param name="e"></param>
|
||||
private async void CopyToTileToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var tilePanel = UIControl.GetOwner<TilePanel>((ToolStripMenuItem)sender);
|
||||
var tilePanel = ((ToolStripMenuItem)sender).GetOwner<TilePanel>();
|
||||
|
||||
var tileInfo = this.GetTileInfo(tilePanel);
|
||||
if (tileInfo == null)
|
||||
@ -1009,8 +1020,6 @@ namespace RokettoLaunch
|
||||
var tableLayout = (TileLayoutPanel)headers[n].ToggleControl;
|
||||
tableLayout.AddTilePanel(newTilePanel, newTileInfo.Position.X, newTileInfo.Position.Y);
|
||||
tableLayout.SetGridSize(this.CurrentSession.Groups[n].GridSize);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1027,7 +1036,7 @@ namespace RokettoLaunch
|
||||
/// <param name="e"></param>
|
||||
private void RemoveTileToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var tilePanel = UIControl.GetOwner<TilePanel>((ToolStripMenuItem)sender);
|
||||
var tilePanel = ((ToolStripMenuItem)sender).GetOwner<TilePanel>();
|
||||
|
||||
var tileInfo = this.GetTileInfo(tilePanel);
|
||||
if (tileInfo == null)
|
||||
@ -1056,6 +1065,32 @@ namespace RokettoLaunch
|
||||
|
||||
#endregion
|
||||
|
||||
private TilePanel AddNewTile(Guid groupId, TileLayoutPanel tableLayout)
|
||||
{
|
||||
var groupInfo = this.CurrentSession.Groups.Where(x => x.Id == groupId).FirstOrDefault();
|
||||
if (groupInfo == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var newTileInfo = new App4Options.Item()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Title = "New Tile",
|
||||
IsGroup = false,
|
||||
Position = new Point(-1, -1)
|
||||
};
|
||||
|
||||
newTileInfo = groupInfo.AddItem(newTileInfo);
|
||||
|
||||
// Update table layout
|
||||
var newTilePanel = CreateTile(newTileInfo);
|
||||
|
||||
tableLayout.AddTilePanel(newTilePanel, newTileInfo.Position.X, newTileInfo.Position.Y);
|
||||
tableLayout.SetGridSize(groupInfo.GridSize);
|
||||
|
||||
return newTilePanel;
|
||||
}
|
||||
|
||||
private void AddGroup(App4Options.Group groupInfo)
|
||||
{
|
||||
@ -1067,8 +1102,8 @@ namespace RokettoLaunch
|
||||
header.ToggleControl = tableLayout;
|
||||
header.IsOpen = groupInfo.IsOpen;
|
||||
|
||||
UIControl.Add(flowLayoutPanel1, header);
|
||||
UIControl.Add(flowLayoutPanel1, tableLayout);
|
||||
UIControl.Invoke(flowLayoutPanel1, (x) => flowLayoutPanel1.Controls.Add(header));
|
||||
UIControl.Invoke(flowLayoutPanel1, (x) => flowLayoutPanel1.Controls.Add(tableLayout));
|
||||
|
||||
foreach (var item in groupInfo.Items ?? new List<App4Options.Item>())
|
||||
{
|
||||
@ -1105,10 +1140,33 @@ namespace RokettoLaunch
|
||||
}
|
||||
}
|
||||
|
||||
private void ConvertToFolder(App4Options.Item tileInfo)
|
||||
{
|
||||
if (tileInfo.IsGroup)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var newTileInfo = tileInfo.CopyOf(false);
|
||||
|
||||
tileInfo.Title = "New Folder";
|
||||
tileInfo.IsGroup = true;
|
||||
tileInfo.TargetPath = string.Empty;
|
||||
tileInfo.StartPath = string.Empty;
|
||||
tileInfo.Argument = string.Empty;
|
||||
tileInfo.RunAsAdmin = false;
|
||||
|
||||
tileInfo.Items.Clear();
|
||||
tileInfo.Items.Add(newTileInfo);
|
||||
|
||||
tileInfo.ResolvePaths();
|
||||
}
|
||||
|
||||
private TileLayoutPanel CreateTable(Size gridSize)
|
||||
{
|
||||
var layoutPanel = new TileLayoutPanel();
|
||||
layoutPanel.DragDrop += LayoutPanel_DragDrop;
|
||||
layoutPanel.DragDrop += LayoutPanel_TileDragDrop;
|
||||
layoutPanel.DragDrop += LayoutPanel_FileDragDrop;
|
||||
layoutPanel.SetGridSize(gridSize);
|
||||
|
||||
return layoutPanel;
|
||||
@ -1222,8 +1280,13 @@ namespace RokettoLaunch
|
||||
return contextMenu;
|
||||
}
|
||||
|
||||
private async void LayoutPanel_DragDrop(object sender, DragEventArgs e)
|
||||
private async void LayoutPanel_TileDragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
if (e.Effect != DragDropEffects.Move)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!e.Data.TryGetData<TilePanel>(out var tilePanel))
|
||||
{
|
||||
return;
|
||||
@ -1260,6 +1323,72 @@ namespace RokettoLaunch
|
||||
_fileSessionManager.HasChanged = true;
|
||||
}
|
||||
|
||||
private async void LayoutPanel_FileDragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
if (e.Effect != DragDropEffects.Link)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var fileList = e.Data.GetData(DataFormats.FileDrop) as string[];
|
||||
if (fileList == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (fileList.Length <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var tableLayout = (sender as TileLayoutPanel);
|
||||
if (tableLayout == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (tableLayout.GroupId == Guid.Empty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var newTilePanel = AddNewTile(tableLayout.GroupId, tableLayout);
|
||||
var tileInfo = this.CurrentSession.FindById(newTilePanel.TileId);
|
||||
|
||||
if (fileList.Length <= 1)
|
||||
{
|
||||
tileInfo.IsGroup = false;
|
||||
tileInfo.TargetPath = fileList[0];
|
||||
tileInfo.StartPath = string.Empty;
|
||||
tileInfo.Argument = string.Empty;
|
||||
tileInfo.RunAsAdmin = false;
|
||||
|
||||
tileInfo.Items.Clear();
|
||||
tileInfo.ResolvePaths();
|
||||
|
||||
tileInfo.Title = RyzStudio.IO.File.GetName(tileInfo.ResolvedTargetPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
tileInfo.Title = "New Folder";
|
||||
tileInfo.IsGroup = true;
|
||||
tileInfo.TargetPath = string.Empty;
|
||||
tileInfo.StartPath = string.Empty;
|
||||
tileInfo.Argument = string.Empty;
|
||||
tileInfo.RunAsAdmin = false;
|
||||
|
||||
tileInfo.Items.Clear();
|
||||
|
||||
this.AddToFolder(tileInfo, fileList.ToList(), false);
|
||||
|
||||
tileInfo.ResolvePaths();
|
||||
}
|
||||
|
||||
this.UpdateTile(newTilePanel, tileInfo);
|
||||
|
||||
_fileSessionManager.HasChanged = true;
|
||||
}
|
||||
|
||||
|
||||
private void TilePanel_MouseClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
@ -1306,34 +1435,29 @@ namespace RokettoLaunch
|
||||
var tileInfo = this.CurrentSession.FindById(sender.TileId);
|
||||
|
||||
// Append
|
||||
if (keys.HasFlag(Keys.Shift))
|
||||
if (keys.HasFlag(Keys.Shift) || ((Control.ModifierKeys & Keys.Shift) == Keys.Shift))
|
||||
{
|
||||
if (tileInfo.IsGroup)
|
||||
{
|
||||
this.AddToFolder(tileInfo, paths, true);
|
||||
if (MessageBox.Show("Do you want to add shortcut to the folder?", "Add Item", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
{
|
||||
AddToFolder(tileInfo, paths, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var newTileInfo = tileInfo.CopyOf();
|
||||
|
||||
tileInfo.Title = "New Folder";
|
||||
tileInfo.IsGroup = true;
|
||||
tileInfo.TargetPath = string.Empty;
|
||||
tileInfo.StartPath = string.Empty;
|
||||
tileInfo.Argument = string.Empty;
|
||||
tileInfo.RunAsAdmin = false;
|
||||
|
||||
tileInfo.Items.Clear();
|
||||
tileInfo.Items.Add(newTileInfo);
|
||||
|
||||
this.AddToFolder(tileInfo, paths, true);
|
||||
|
||||
tileInfo.ResolvePaths();
|
||||
if (MessageBox.Show("Do you want to convert this shortcut to a folder, then add shortcut to the folder?", "Add Item (Convert)", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
{
|
||||
ConvertToFolder(tileInfo);
|
||||
AddToFolder(tileInfo, paths, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (paths.Count <= 1)
|
||||
{
|
||||
if (MessageBox.Show("Do you want to replace this shortcut?", "Replace Item", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
{
|
||||
tileInfo.IsGroup = false;
|
||||
tileInfo.TargetPath = paths[0];
|
||||
@ -1346,7 +1470,10 @@ namespace RokettoLaunch
|
||||
|
||||
tileInfo.Title = RyzStudio.IO.File.GetName(tileInfo.ResolvedTargetPath);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (MessageBox.Show("Do you want to replace this shortcut with a folder?", "Replace Item (Folder)", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
{
|
||||
tileInfo.Title = "New Folder";
|
||||
tileInfo.IsGroup = true;
|
||||
@ -1362,6 +1489,7 @@ namespace RokettoLaunch
|
||||
tileInfo.ResolvePaths();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.UpdateTile(sender, tileInfo);
|
||||
});
|
||||
@ -1381,6 +1509,11 @@ namespace RokettoLaunch
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(model.TargetPath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.CurrentSession.HideOnExecute)
|
||||
{
|
||||
this.Visible = false;
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<Copyright>Ray Lam</Copyright>
|
||||
<AssemblyVersion>1.0.0.0</AssemblyVersion>
|
||||
<FileVersion>1.0.0.0</FileVersion>
|
||||
<Version>0.4.1.0217</Version>
|
||||
<Version>0.4.2.204</Version>
|
||||
<EnableNETAnalyzers>False</EnableNETAnalyzers>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<PackageIcon>icon-128.png</PackageIcon>
|
||||
@ -47,6 +47,7 @@
|
||||
<ItemGroup>
|
||||
<Compile Remove="UIResource.Designer.cs" />
|
||||
<Compile Remove="Windows\Forms\TileContainer.cs" />
|
||||
<Compile Remove="Windows\Forms\TileForms\TileContainer.cs" />
|
||||
<Compile Remove="Windows\Forms\TilePanelLayout.cs" />
|
||||
<Compile Remove="Windows\Forms\TilePanelLayout.Designer.cs" />
|
||||
<Compile Remove="Windows\GridTableLayout.cs" />
|
||||
@ -64,6 +65,7 @@
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Remove="UIResource.resx" />
|
||||
<EmbeddedResource Remove="Windows\Forms\TileContainer.resx" />
|
||||
<EmbeddedResource Remove="Windows\Forms\TileForms\TileContainer.resx" />
|
||||
<EmbeddedResource Remove="Windows\Forms\TilePanelLayout.resx" />
|
||||
<EmbeddedResource Remove="Windows\GridTableLayout.resx" />
|
||||
<EmbeddedResource Remove="Windows\TileGridPanel.resx" />
|
||||
@ -79,8 +81,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="RyzStudio" Version="10.1.0.128" />
|
||||
<PackageReference Include="RyzStudio.Windows.Forms" Version="10.1.0.140" />
|
||||
<PackageReference Include="RyzStudio" Version="10.1.1.261" />
|
||||
<PackageReference Include="RyzStudio.Windows.Forms" Version="10.3.0.41" />
|
||||
<PackageReference Include="RyzStudio.Windows.Forms.Themed" Version="10.3.0.41" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="AppResource.Designer.cs">
|
||||
|
||||
55
Windows/Forms/TileForms/DefaultVisualStyle.cs
Normal file
55
Windows/Forms/TileForms/DefaultVisualStyle.cs
Normal file
@ -0,0 +1,55 @@
|
||||
using System.Drawing;
|
||||
using RyzStudio.Drawing;
|
||||
|
||||
namespace RyzStudio.Windows.TileForms
|
||||
{
|
||||
public class DefaultVisualStyle
|
||||
{
|
||||
//private static FontProvider _fontProvider;
|
||||
|
||||
//public static FontProvider FontProvider
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// if (_fontProvider == null)
|
||||
// {
|
||||
// _fontProvider = new FontProvider();
|
||||
// _fontProvider.AddFont(Resource2.RyzStudio8);
|
||||
// }
|
||||
|
||||
// return _fontProvider;
|
||||
// }
|
||||
//}
|
||||
|
||||
//public static FontFamily[] Fonts
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// return FontProvider.Collection.Families;
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
public class StyleSet
|
||||
{
|
||||
public BorderStyle Border { get; set; } = new BorderStyle();
|
||||
|
||||
public Color BackColour { get; set; }
|
||||
|
||||
public Color ForeColour { get; set; }
|
||||
|
||||
//public Color IconColour { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static StyleSet Default = new StyleSet()
|
||||
{
|
||||
Border = BorderStyle.Create(1, Color.FromArgb(204, 206, 218), 0, 2),
|
||||
BackColour = Color.FromArgb(250, 250, 250),
|
||||
ForeColour = Color.FromArgb(99, 105, 119),
|
||||
//IconColour = Color.FromArgb(86, 86, 149)
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
43
Windows/Forms/TileForms/Tile.Designer.cs
generated
Normal file
43
Windows/Forms/TileForms/Tile.Designer.cs
generated
Normal file
@ -0,0 +1,43 @@
|
||||
namespace RyzStudio.Windows.TileForms
|
||||
{
|
||||
partial class Tile
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
SuspendLayout();
|
||||
//
|
||||
// Tile
|
||||
//
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
Name = "Tile";
|
||||
Size = new System.Drawing.Size(82, 81);
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
130
Windows/Forms/TileForms/Tile.cs
Normal file
130
Windows/Forms/TileForms/Tile.cs
Normal file
@ -0,0 +1,130 @@
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace RyzStudio.Windows.TileForms
|
||||
{
|
||||
public partial class Tile : RyzStudio.Windows.Forms.TUserControl
|
||||
{
|
||||
private int _imageLeft = 0;
|
||||
private int _imageTop = 11;
|
||||
private int _labelMargin = 3;
|
||||
private int _labelTop = 47;
|
||||
private Rectangle _labelRectangle = new Rectangle();
|
||||
|
||||
private string _title = "";
|
||||
private Image _largeIcon = null;
|
||||
|
||||
|
||||
public Tile()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.AutoScaleMode = AutoScaleMode.None;
|
||||
this.BackColor = DefaultVisualStyle.Default.BackColour;
|
||||
this.DoubleBuffered = true;
|
||||
this.Font = new Font(this.Font.FontFamily, 8.25F);
|
||||
this.ForeColor = DefaultVisualStyle.Default.ForeColour;
|
||||
//this.Size = new Size(70, 70);
|
||||
|
||||
this.EnableMovable = true;
|
||||
}
|
||||
|
||||
#region encapsulated properties
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public override bool AutoSize { get => base.AutoSize; set => base.AutoSize = false; }
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public new AutoScaleMode AutoScaleMode { get => base.AutoScaleMode; set => base.AutoScaleMode = AutoScaleMode.None; }
|
||||
|
||||
//[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
//public new Padding Margin { get => base.Margin; set => base.Margin = new Padding(0); }
|
||||
|
||||
//[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
//public new Padding Padding { get => base.Padding; set => base.Padding = new Padding(0); }
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public override Size MaximumSize { get => base.MaximumSize; set => this.Size = value; }
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public override Size MinimumSize { get => base.MinimumSize; set => this.Size = value; }
|
||||
|
||||
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public new Size Size { get => base.Size; set => base.MaximumSize = base.MinimumSize = base.Size = value; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region public properties
|
||||
|
||||
[Category("Appearance"), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
public Image LargeIcon
|
||||
{
|
||||
get => _largeIcon;
|
||||
set
|
||||
{
|
||||
_largeIcon = value;
|
||||
|
||||
if (_largeIcon == null)
|
||||
{
|
||||
_imageLeft = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
_imageLeft = (this.Width - _largeIcon.Width) / 2;
|
||||
}
|
||||
|
||||
this.Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Appearance"), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
public string Title
|
||||
{
|
||||
get => _title;
|
||||
set
|
||||
{
|
||||
_title = value;
|
||||
|
||||
_labelRectangle = new Rectangle(_labelMargin, _labelTop, (this.Width - (_labelMargin * 2)), (this.Height - _labelTop - 1));
|
||||
|
||||
this.Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Behaviour"), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
public ContextMenuStrip LeftContextMenuStrip { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
||||
Graphics g = e.Graphics;
|
||||
|
||||
if (this.LargeIcon != null)
|
||||
{
|
||||
g.DrawImage(this.LargeIcon, new Point(_imageLeft, _imageTop));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(this.Title))
|
||||
{
|
||||
TextRenderer.DrawText(e.Graphics, this.Title, this.Font, _labelRectangle, this.ForeColor, TextFormatFlags.HorizontalCenter | TextFormatFlags.NoPadding | TextFormatFlags.EndEllipsis);
|
||||
}
|
||||
|
||||
g.DrawRectangle(new Pen(DefaultVisualStyle.Default.Border.Colour, DefaultVisualStyle.Default.Border.Width), new Rectangle(this.DisplayRectangle.X, this.DisplayRectangle.Y, (this.DisplayRectangle.Width - 1), (this.DisplayRectangle.Height - 1)));
|
||||
}
|
||||
|
||||
protected override void OnMouseClick(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseClick(e);
|
||||
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
this.LeftContextMenuStrip?.Show(this, e.Location);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
120
Windows/Forms/TileForms/Tile.resx
Normal file
120
Windows/Forms/TileForms/Tile.resx
Normal 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>
|
||||
@ -22,6 +22,13 @@ namespace RokettoLaunch.Windows.Forms
|
||||
this.RowCount = 0;
|
||||
}
|
||||
|
||||
//protected override void OnDragOver(DragEventArgs e)
|
||||
//{
|
||||
// base.OnDragDrop(e);
|
||||
|
||||
// e.Effect = (e.Data.GetDataPresent(DataFormats.FileDrop)) ? DragDropEffects.Link : DragDropEffects.None;
|
||||
//}
|
||||
|
||||
protected override void OnDragEnter(DragEventArgs e)
|
||||
{
|
||||
base.OnDragEnter(e);
|
||||
@ -30,6 +37,14 @@ namespace RokettoLaunch.Windows.Forms
|
||||
{
|
||||
e.Effect = DragDropEffects.Move;
|
||||
}
|
||||
else if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
||||
{
|
||||
e.Effect = DragDropEffects.Link;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Effect = DragDropEffects.None;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -39,7 +54,7 @@ namespace RokettoLaunch.Windows.Forms
|
||||
|
||||
public void AddTilePanel(TilePanel tilePanel, int x, int y)
|
||||
{
|
||||
UIControl.Add(this, tilePanel, x, y);
|
||||
UIControl.Invoke(this, (_) => this.Controls.Add(tilePanel, x, y));
|
||||
}
|
||||
|
||||
public void SetGridSize(Size gridSize)
|
||||
|
||||
@ -42,7 +42,14 @@ namespace RokettoLaunch.Windows.Forms
|
||||
{
|
||||
base.OnDragDrop(e);
|
||||
|
||||
e.Effect = (e.Data.GetDataPresent(DataFormats.FileDrop)) ? DragDropEffects.Link : DragDropEffects.None;
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
||||
{
|
||||
e.Effect = ((Control.ModifierKeys & Keys.Shift) == Keys.Shift) ? DragDropEffects.Copy : DragDropEffects.Link;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Effect = DragDropEffects.None;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnDragDrop(DragEventArgs e)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user