Added: save session

This commit is contained in:
Ray committed 2020-05-03 15:53:15 +01:00
1 parent 4a83971868
commit 92ee5e8eed
13 files changed
+357 -52

No files matched your search

+414
View File
@@ -0,0 +1,414 @@
using AppLauncher.Models;
using RyzStudio.Windows.ThemedForms;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AppLauncher.Windows.Forms
{
public class AddTileForm : DialogForm
{
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private TextButtonBox textBox2;
private TextBox textBox3;
private TextButtonBox textBox4;
private Button button1;
private PickerBox pickerBox1;
private PickerBox pickerBox2;
private RyzStudio.Windows.Forms.HorizontalSeparator horizontalSeparator1;
private RyzStudio.Windows.Forms.HorizontalSeparator horizontalSeparator2;
private TextBox textBox1;
private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
protected TileLayoutPanel parentPanel = null;
public AddTileForm() : base()
{
InitializeComponent();
initialiseComponents2();
}
public AddTileForm(TileLayoutPanel panel) : base()
{
parentPanel = panel;
InitializeComponent();
initialiseComponents2();
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddTileForm));
this.textBox1 = new RyzStudio.Windows.ThemedForms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.textBox2 = new RyzStudio.Windows.ThemedForms.TextButtonBox();
this.textBox3 = new RyzStudio.Windows.ThemedForms.TextBox();
this.textBox4 = new RyzStudio.Windows.ThemedForms.TextButtonBox();
this.button1 = new RyzStudio.Windows.ThemedForms.Button();
this.pickerBox1 = new RyzStudio.Windows.ThemedForms.PickerBox();
this.pickerBox2 = new RyzStudio.Windows.ThemedForms.PickerBox();
this.horizontalSeparator1 = new RyzStudio.Windows.Forms.HorizontalSeparator();
this.horizontalSeparator2 = new RyzStudio.Windows.Forms.HorizontalSeparator();
this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).BeginInit();
this.SuspendLayout();
//
// imgbxClose
//
this.imgbxClose.Image = ((System.Drawing.Image)(resources.GetObject("imgbxClose.Image")));
this.imgbxClose.Location = new System.Drawing.Point(367, 5);
//
// lblDescription
//
this.lblDescription.Size = new System.Drawing.Size(359, 30);
this.lblDescription.Text = "Edit Tile";
//
// panel1
//
this.panel1.Location = new System.Drawing.Point(394, 474);
//
// area1
//
this.area1.Location = new System.Drawing.Point(1, 474);
this.area1.Size = new System.Drawing.Size(392, 5);
//
// textBox1
//
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox1.BackColor = System.Drawing.Color.Transparent;
this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.textBox1.Location = new System.Drawing.Point(159, 50);
this.textBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6);
this.textBox1.Name = "textBox1";
this.textBox1.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9);
this.textBox1.Size = new System.Drawing.Size(220, 32);
this.textBox1.SubmitButton = null;
this.textBox1.TabIndex = 152;
this.textBox1.UseSystemPasswordChar = false;
//
// label6
//
this.label6.BackColor = System.Drawing.Color.Transparent;
this.label6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104)))));
this.label6.Location = new System.Drawing.Point(18, 268);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(208, 32);
this.label6.TabIndex = 163;
this.label6.Text = "Run As Admin";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label7
//
this.label7.BackColor = System.Drawing.Color.Transparent;
this.label7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104)))));
this.label7.Location = new System.Drawing.Point(18, 227);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(208, 32);
this.label7.TabIndex = 161;
this.label7.Text = "Window Style";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label4
//
this.label4.BackColor = System.Drawing.Color.Transparent;
this.label4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104)))));
this.label4.Location = new System.Drawing.Point(18, 173);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(131, 32);
this.label4.TabIndex = 159;
this.label4.Text = "Working Directory";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label3
//
this.label3.BackColor = System.Drawing.Color.Transparent;
this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104)))));
this.label3.Location = new System.Drawing.Point(18, 132);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(131, 32);
this.label3.TabIndex = 157;
this.label3.Text = "Argument";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label2
//
this.label2.BackColor = System.Drawing.Color.Transparent;
this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104)))));
this.label2.Location = new System.Drawing.Point(18, 91);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(131, 32);
this.label2.TabIndex = 155;
this.label2.Text = "Filename";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label1
//
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104)))));
this.label1.Location = new System.Drawing.Point(18, 50);
this.label1.Margin = new System.Windows.Forms.Padding(0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(131, 32);
this.label1.TabIndex = 153;
this.label1.Text = "Title";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// textBox2
//
this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox2.BackColor = System.Drawing.Color.Transparent;
this.textBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.textBox2.HighlightImage = global::AppLauncher.Properties.Resources.button16_file_add2;
this.textBox2.Location = new System.Drawing.Point(159, 91);
this.textBox2.Margin = new System.Windows.Forms.Padding(10, 3, 3, 3);
this.textBox2.Name = "textBox2";
this.textBox2.NormalImage = global::AppLauncher.Properties.Resources.button16_file_add;
this.textBox2.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9);
this.textBox2.Size = new System.Drawing.Size(220, 32);
this.textBox2.SubmitButton = null;
this.textBox2.TabIndex = 170;
this.textBox2.UseSystemPasswordChar = false;
this.textBox2.OnButtonClick += new System.EventHandler(this.textBox2_OnButtonClick);
//
// textBox3
//
this.textBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox3.BackColor = System.Drawing.Color.Transparent;
this.textBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.textBox3.Location = new System.Drawing.Point(159, 132);
this.textBox3.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6);
this.textBox3.Name = "textBox3";
this.textBox3.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9);
this.textBox3.Size = new System.Drawing.Size(220, 32);
this.textBox3.SubmitButton = null;
this.textBox3.TabIndex = 171;
this.textBox3.UseSystemPasswordChar = false;
//
// textBox4
//
this.textBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox4.BackColor = System.Drawing.Color.Transparent;
this.textBox4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.textBox4.HighlightImage = global::AppLauncher.Properties.Resources.button16_folder_add2;
this.textBox4.Location = new System.Drawing.Point(159, 173);
this.textBox4.Margin = new System.Windows.Forms.Padding(10, 3, 3, 3);
this.textBox4.Name = "textBox4";
this.textBox4.NormalImage = global::AppLauncher.Properties.Resources.button16_folder_add;
this.textBox4.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9);
this.textBox4.Size = new System.Drawing.Size(220, 32);
this.textBox4.SubmitButton = null;
this.textBox4.TabIndex = 172;
this.textBox4.UseSystemPasswordChar = false;
this.textBox4.OnButtonClick += new System.EventHandler(this.textBox4_OnButtonClick);
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button1.BackColor = System.Drawing.Color.Transparent;
this.button1.DefaultImage = null;
this.button1.DownImage = null;
this.button1.LabelText = "&Save";
this.button1.Location = new System.Drawing.Point(251, 427);
this.button1.Name = "button1";
this.button1.OverImage = null;
this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3);
this.button1.Size = new System.Drawing.Size(128, 32);
this.button1.TabIndex = 173;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// pickerBox1
//
this.pickerBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pickerBox1.BackColor = System.Drawing.Color.Transparent;
this.pickerBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.pickerBox1.Location = new System.Drawing.Point(239, 227);
this.pickerBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6);
this.pickerBox1.Name = "pickerBox1";
this.pickerBox1.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5);
this.pickerBox1.Size = new System.Drawing.Size(140, 32);
this.pickerBox1.SubmitButton = null;
this.pickerBox1.TabIndex = 174;
//
// pickerBox2
//
this.pickerBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pickerBox2.BackColor = System.Drawing.Color.Transparent;
this.pickerBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.pickerBox2.Location = new System.Drawing.Point(239, 268);
this.pickerBox2.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6);
this.pickerBox2.Name = "pickerBox2";
this.pickerBox2.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5);
this.pickerBox2.Size = new System.Drawing.Size(140, 32);
this.pickerBox2.SubmitButton = null;
this.pickerBox2.TabIndex = 175;
//
// horizontalSeparator1
//
this.horizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.horizontalSeparator1.Location = new System.Drawing.Point(10, 215);
this.horizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2);
this.horizontalSeparator1.Name = "horizontalSeparator1";
this.horizontalSeparator1.Size = new System.Drawing.Size(380, 2);
this.horizontalSeparator1.TabIndex = 176;
//
// horizontalSeparator2
//
this.horizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.horizontalSeparator2.Location = new System.Drawing.Point(10, 310);
this.horizontalSeparator2.MaximumSize = new System.Drawing.Size(4920, 2);
this.horizontalSeparator2.Name = "horizontalSeparator2";
this.horizontalSeparator2.Size = new System.Drawing.Size(380, 2);
this.horizontalSeparator2.TabIndex = 177;
//
// folderBrowserDialog1
//
this.folderBrowserDialog1.Description = "Choose a directory";
//
// openFileDialog1
//
this.openFileDialog1.Filter = "All files|*";
this.openFileDialog1.Title = "Choose a file";
//
// AddTileForm
//
this.ClientSize = new System.Drawing.Size(400, 480);
this.Controls.Add(this.horizontalSeparator2);
this.Controls.Add(this.horizontalSeparator1);
this.Controls.Add(this.pickerBox2);
this.Controls.Add(this.pickerBox1);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox4);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.label6);
this.Controls.Add(this.label7);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox1);
this.Description = "Edit Tile";
this.Name = "AddTileForm";
this.Controls.SetChildIndex(this.imgbxClose, 0);
this.Controls.SetChildIndex(this.lblDescription, 0);
this.Controls.SetChildIndex(this.panel1, 0);
this.Controls.SetChildIndex(this.area1, 0);
this.Controls.SetChildIndex(this.textBox1, 0);
this.Controls.SetChildIndex(this.label1, 0);
this.Controls.SetChildIndex(this.label2, 0);
this.Controls.SetChildIndex(this.label3, 0);
this.Controls.SetChildIndex(this.label4, 0);
this.Controls.SetChildIndex(this.label7, 0);
this.Controls.SetChildIndex(this.label6, 0);
this.Controls.SetChildIndex(this.textBox2, 0);
this.Controls.SetChildIndex(this.textBox3, 0);
this.Controls.SetChildIndex(this.textBox4, 0);
this.Controls.SetChildIndex(this.button1, 0);
this.Controls.SetChildIndex(this.pickerBox1, 0);
this.Controls.SetChildIndex(this.pickerBox2, 0);
this.Controls.SetChildIndex(this.horizontalSeparator1, 0);
this.Controls.SetChildIndex(this.horizontalSeparator2, 0);
((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).EndInit();
this.ResumeLayout(false);
}
private void initialiseComponents2()
{
pickerBox1.ComboBox.Items.Clear();
pickerBox1.ComboBox.Items.AddRange(new string[] { "Normal", "Hidden", "Minimized", "Maximized" });
if (pickerBox1.ComboBox.Items.Count > 0) pickerBox1.ComboBox.SelectedIndex = 0;
pickerBox2.ComboBox.Items.Clear();
pickerBox2.ComboBox.Items.AddRange(new string[] { "No", "Yes" });
if (pickerBox2.ComboBox.Items.Count > 0) pickerBox2.ComboBox.SelectedIndex = 0;
}
//protected override void OnShown(EventArgs e)
//{
// base.OnShown(e);
// if (parentPanel != null)
// {
// textBox1.Text = parentPanel.ModelInfo.Title;
// textBox2.Text = parentPanel.ModelInfo.ProcessFilename;
// textBox3.Text = parentPanel.ModelInfo.ProcessArgument;
// textBox4.Text = parentPanel.ModelInfo.ProcessWorkingDirectory;
// pickerBox1.ComboBox.SelectedIndex = (int)parentPanel.ModelInfo.ProcessWindowStyle;
// pickerBox2.ComboBox.SelectedIndex = (parentPanel.ModelInfo.ProcessAsAdmin ? 1 : 0);
// }
//}
private void button1_Click(object sender, EventArgs e)
{
TileModel model = new TileModel()
{
Title = textBox1.Text?.Trim(),
ProcessFilename = textBox2.Text?.Trim(),
ProcessArgument = textBox3.Text?.Trim(),
ProcessWorkingDirectory = textBox4.Text?.Trim(),
ProcessWindowStyle = (System.Diagnostics.ProcessWindowStyle)pickerBox1.ComboBox.SelectedIndex,
ProcessAsAdmin = (pickerBox2.ComboBox.SelectedIndex == 1)
};
parentPanel.AddTile(model);
this.Close();
}
private void textBox2_OnButtonClick(object sender, EventArgs e)
{
if (!string.IsNullOrWhiteSpace(textBox2.Text))
{
if (File.Exists(textBox2.Text))
{
openFileDialog1.InitialDirectory = Path.GetDirectoryName(textBox2.Text);
}
}
if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
textBox2.Text = openFileDialog1.FileName;
}
}
private void textBox4_OnButtonClick(object sender, EventArgs e)
{
if (!string.IsNullOrWhiteSpace(textBox4.Text))
{
if (Directory.Exists(textBox4.Text))
{
folderBrowserDialog1.SelectedPath = textBox4.Text;
}
}
if (folderBrowserDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
textBox4.Text = folderBrowserDialog1.SelectedPath;
}
}
}
}
+137
View File
@@ -0,0 +1,137 @@
<?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>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="imgbxClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS4xYyqcSwAAANlJREFUOE+lU1sO
gjAQrHgRY6KemQ+VT9NrgAfgfRA+SawzdTAk2lhkkgm7s7vTAq0py/LUNM0dHEEXSfYWfd8fDQIOD23b
nvFMY6jeAcxpMFIwC1HX9YWzNOCWUunR4AxnvxpUVbV3zm2UGsbUlHoEDfBhdsgf4BWDCcmYGmtqCxtw
NeQcoJ6JjGn43hXy8CvIxDeIGbREZY+pHjLgtqeVHf7SzVq7VdmDM6x9GGj1/19h9UckVv3GWMwNRh5L
6dGYH+UCHCTQ9SfV+7pMvJIIaLL0Oudd1x2eUQ8MyeAeq0cAAAAASUVORK5CYII=
</value>
</data>
<metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>326, 17</value>
</metadata>
</root>
+422
View File
@@ -0,0 +1,422 @@
using AppLauncher.Models;
using RyzStudio.Windows.ThemedForms;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AppLauncher.Windows.Forms
{
public class EditTileForm : DialogForm
{
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private TextButtonBox textBox2;
private TextBox textBox3;
private TextButtonBox textBox4;
private Button button1;
private PickerBox pickerBox1;
private PickerBox pickerBox2;
private RyzStudio.Windows.Forms.HorizontalSeparator horizontalSeparator1;
private RyzStudio.Windows.Forms.HorizontalSeparator horizontalSeparator2;
private TextBox textBox1;
private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
protected TilePanel parentPanel = null;
public EditTileForm() : base()
{
InitializeComponent();
initialiseComponents2();
}
public EditTileForm(TilePanel panel) : base()
{
parentPanel = panel;
InitializeComponent();
initialiseComponents2();
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditTileForm));
this.textBox1 = new RyzStudio.Windows.ThemedForms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.textBox2 = new RyzStudio.Windows.ThemedForms.TextButtonBox();
this.textBox3 = new RyzStudio.Windows.ThemedForms.TextBox();
this.textBox4 = new RyzStudio.Windows.ThemedForms.TextButtonBox();
this.button1 = new RyzStudio.Windows.ThemedForms.Button();
this.pickerBox1 = new RyzStudio.Windows.ThemedForms.PickerBox();
this.pickerBox2 = new RyzStudio.Windows.ThemedForms.PickerBox();
this.horizontalSeparator1 = new RyzStudio.Windows.Forms.HorizontalSeparator();
this.horizontalSeparator2 = new RyzStudio.Windows.Forms.HorizontalSeparator();
this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).BeginInit();
this.SuspendLayout();
//
// imgbxClose
//
this.imgbxClose.Image = ((System.Drawing.Image)(resources.GetObject("imgbxClose.Image")));
this.imgbxClose.Location = new System.Drawing.Point(367, 5);
//
// lblDescription
//
this.lblDescription.Size = new System.Drawing.Size(359, 30);
this.lblDescription.Text = "Edit Tile";
//
// panel1
//
this.panel1.Location = new System.Drawing.Point(394, 474);
//
// area1
//
this.area1.Location = new System.Drawing.Point(1, 474);
this.area1.Size = new System.Drawing.Size(392, 5);
//
// textBox1
//
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox1.BackColor = System.Drawing.Color.Transparent;
this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.textBox1.Location = new System.Drawing.Point(159, 50);
this.textBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6);
this.textBox1.Name = "textBox1";
this.textBox1.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9);
this.textBox1.Size = new System.Drawing.Size(220, 32);
this.textBox1.SubmitButton = null;
this.textBox1.TabIndex = 152;
this.textBox1.UseSystemPasswordChar = false;
//
// label6
//
this.label6.BackColor = System.Drawing.Color.Transparent;
this.label6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104)))));
this.label6.Location = new System.Drawing.Point(18, 268);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(208, 32);
this.label6.TabIndex = 163;
this.label6.Text = "Run As Admin";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label7
//
this.label7.BackColor = System.Drawing.Color.Transparent;
this.label7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104)))));
this.label7.Location = new System.Drawing.Point(18, 227);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(208, 32);
this.label7.TabIndex = 161;
this.label7.Text = "Window Style";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label4
//
this.label4.BackColor = System.Drawing.Color.Transparent;
this.label4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104)))));
this.label4.Location = new System.Drawing.Point(18, 173);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(131, 32);
this.label4.TabIndex = 159;
this.label4.Text = "Working Directory";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label3
//
this.label3.BackColor = System.Drawing.Color.Transparent;
this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104)))));
this.label3.Location = new System.Drawing.Point(18, 132);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(131, 32);
this.label3.TabIndex = 157;
this.label3.Text = "Argument";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label2
//
this.label2.BackColor = System.Drawing.Color.Transparent;
this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104)))));
this.label2.Location = new System.Drawing.Point(18, 91);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(131, 32);
this.label2.TabIndex = 155;
this.label2.Text = "Filename";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label1
//
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(95)))), ((int)(((byte)(99)))), ((int)(((byte)(104)))));
this.label1.Location = new System.Drawing.Point(18, 50);
this.label1.Margin = new System.Windows.Forms.Padding(0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(131, 32);
this.label1.TabIndex = 153;
this.label1.Text = "Title";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// textBox2
//
this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox2.BackColor = System.Drawing.Color.Transparent;
this.textBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.textBox2.HighlightImage = global::AppLauncher.Properties.Resources.button16_file_add2;
this.textBox2.Location = new System.Drawing.Point(159, 91);
this.textBox2.Margin = new System.Windows.Forms.Padding(10, 3, 3, 3);
this.textBox2.Name = "textBox2";
this.textBox2.NormalImage = global::AppLauncher.Properties.Resources.button16_file_add;
this.textBox2.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9);
this.textBox2.Size = new System.Drawing.Size(220, 32);
this.textBox2.SubmitButton = null;
this.textBox2.TabIndex = 170;
this.textBox2.UseSystemPasswordChar = false;
this.textBox2.OnButtonClick += new System.EventHandler(this.textBox2_OnButtonClick);
//
// textBox3
//
this.textBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox3.BackColor = System.Drawing.Color.Transparent;
this.textBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.textBox3.Location = new System.Drawing.Point(159, 132);
this.textBox3.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6);
this.textBox3.Name = "textBox3";
this.textBox3.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9);
this.textBox3.Size = new System.Drawing.Size(220, 32);
this.textBox3.SubmitButton = null;
this.textBox3.TabIndex = 171;
this.textBox3.UseSystemPasswordChar = false;
//
// textBox4
//
this.textBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox4.BackColor = System.Drawing.Color.Transparent;
this.textBox4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.textBox4.HighlightImage = global::AppLauncher.Properties.Resources.button16_folder_add2;
this.textBox4.Location = new System.Drawing.Point(159, 173);
this.textBox4.Margin = new System.Windows.Forms.Padding(10, 3, 3, 3);
this.textBox4.Name = "textBox4";
this.textBox4.NormalImage = global::AppLauncher.Properties.Resources.button16_folder_add;
this.textBox4.Padding = new System.Windows.Forms.Padding(10, 10, 9, 9);
this.textBox4.Size = new System.Drawing.Size(220, 32);
this.textBox4.SubmitButton = null;
this.textBox4.TabIndex = 172;
this.textBox4.UseSystemPasswordChar = false;
this.textBox4.OnButtonClick += new System.EventHandler(this.textBox4_OnButtonClick);
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button1.BackColor = System.Drawing.Color.Transparent;
this.button1.DefaultImage = null;
this.button1.DownImage = null;
this.button1.LabelText = "&Save";
this.button1.Location = new System.Drawing.Point(251, 427);
this.button1.Name = "button1";
this.button1.OverImage = null;
this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3);
this.button1.Size = new System.Drawing.Size(128, 32);
this.button1.TabIndex = 173;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// pickerBox1
//
this.pickerBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pickerBox1.BackColor = System.Drawing.Color.Transparent;
this.pickerBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.pickerBox1.Location = new System.Drawing.Point(239, 227);
this.pickerBox1.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6);
this.pickerBox1.Name = "pickerBox1";
this.pickerBox1.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5);
this.pickerBox1.Size = new System.Drawing.Size(140, 32);
this.pickerBox1.SubmitButton = null;
this.pickerBox1.TabIndex = 174;
//
// pickerBox2
//
this.pickerBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pickerBox2.BackColor = System.Drawing.Color.Transparent;
this.pickerBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.pickerBox2.Location = new System.Drawing.Point(239, 268);
this.pickerBox2.Margin = new System.Windows.Forms.Padding(10, 6, 10, 6);
this.pickerBox2.Name = "pickerBox2";
this.pickerBox2.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5);
this.pickerBox2.Size = new System.Drawing.Size(140, 32);
this.pickerBox2.SubmitButton = null;
this.pickerBox2.TabIndex = 175;
//
// horizontalSeparator1
//
this.horizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.horizontalSeparator1.Location = new System.Drawing.Point(10, 215);
this.horizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2);
this.horizontalSeparator1.Name = "horizontalSeparator1";
this.horizontalSeparator1.Size = new System.Drawing.Size(380, 2);
this.horizontalSeparator1.TabIndex = 176;
//
// horizontalSeparator2
//
this.horizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.horizontalSeparator2.Location = new System.Drawing.Point(10, 310);
this.horizontalSeparator2.MaximumSize = new System.Drawing.Size(4920, 2);
this.horizontalSeparator2.Name = "horizontalSeparator2";
this.horizontalSeparator2.Size = new System.Drawing.Size(380, 2);
this.horizontalSeparator2.TabIndex = 177;
//
// folderBrowserDialog1
//
this.folderBrowserDialog1.Description = "Choose a directory";
//
// openFileDialog1
//
this.openFileDialog1.Filter = "All files|*";
this.openFileDialog1.Title = "Choose a file";
//
// EditTileForm
//
this.ClientSize = new System.Drawing.Size(400, 480);
this.Controls.Add(this.horizontalSeparator2);
this.Controls.Add(this.horizontalSeparator1);
this.Controls.Add(this.pickerBox2);
this.Controls.Add(this.pickerBox1);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox4);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.label6);
this.Controls.Add(this.label7);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox1);
this.Description = "Edit Tile";
this.Name = "EditTileForm";
this.Controls.SetChildIndex(this.imgbxClose, 0);
this.Controls.SetChildIndex(this.lblDescription, 0);
this.Controls.SetChildIndex(this.panel1, 0);
this.Controls.SetChildIndex(this.area1, 0);
this.Controls.SetChildIndex(this.textBox1, 0);
this.Controls.SetChildIndex(this.label1, 0);
this.Controls.SetChildIndex(this.label2, 0);
this.Controls.SetChildIndex(this.label3, 0);
this.Controls.SetChildIndex(this.label4, 0);
this.Controls.SetChildIndex(this.label7, 0);
this.Controls.SetChildIndex(this.label6, 0);
this.Controls.SetChildIndex(this.textBox2, 0);
this.Controls.SetChildIndex(this.textBox3, 0);
this.Controls.SetChildIndex(this.textBox4, 0);
this.Controls.SetChildIndex(this.button1, 0);
this.Controls.SetChildIndex(this.pickerBox1, 0);
this.Controls.SetChildIndex(this.pickerBox2, 0);
this.Controls.SetChildIndex(this.horizontalSeparator1, 0);
this.Controls.SetChildIndex(this.horizontalSeparator2, 0);
((System.ComponentModel.ISupportInitialize)(this.imgbxClose)).EndInit();
this.ResumeLayout(false);
}
private void initialiseComponents2()
{
pickerBox1.ComboBox.Items.Clear();
pickerBox1.ComboBox.Items.AddRange(new string[] { "Normal", "Hidden", "Minimized", "Maximized" });
if (pickerBox1.ComboBox.Items.Count > 0) pickerBox1.ComboBox.SelectedIndex = 0;
pickerBox2.ComboBox.Items.Clear();
pickerBox2.ComboBox.Items.AddRange(new string[] { "No", "Yes" });
if (pickerBox2.ComboBox.Items.Count > 0) pickerBox2.ComboBox.SelectedIndex = 0;
}
protected override void OnShown(EventArgs e)
{
base.OnShown(e);
if (parentPanel != null)
{
textBox1.Text = parentPanel.ModelInfo.Title;
textBox2.Text = parentPanel.ModelInfo.ProcessFilename;
textBox3.Text = parentPanel.ModelInfo.ProcessArgument;
textBox4.Text = parentPanel.ModelInfo.ProcessWorkingDirectory;
pickerBox1.ComboBox.SelectedIndex = (int)parentPanel.ModelInfo.ProcessWindowStyle;
pickerBox2.ComboBox.SelectedIndex = (parentPanel.ModelInfo.ProcessAsAdmin ? 1 : 0);
}
}
private void button1_Click(object sender, EventArgs e)
{
TileModel model = new TileModel()
{
Title = textBox1.Text?.Trim(),
ProcessFilename = textBox2.Text?.Trim(),
ProcessArgument = textBox3.Text?.Trim(),
ProcessWorkingDirectory = textBox4.Text?.Trim(),
ProcessWindowStyle = (System.Diagnostics.ProcessWindowStyle)pickerBox1.ComboBox.SelectedIndex,
ProcessAsAdmin = (pickerBox2.ComboBox.SelectedIndex == 1)
};
parentPanel.LoadInfo(model);
//parentPanel.Info.Title = textBox1.Text?.Trim();
//parentPanel.Info.ProcessFilename = textBox2.Text?.Trim();
//parentPanel.Info.ProcessArgument = textBox3.Text?.Trim();
//parentPanel.Info.ProcessWorkingDirectory = textBox4.Text?.Trim();
//parentPanel.Info.ProcessWindowStyle = (System.Diagnostics.ProcessWindowStyle) pickerBox1.ComboBox.SelectedIndex;
//parentPanel.Info.ProcessAsAdmin = (pickerBox2.ComboBox.SelectedIndex == 1);
this.Close();
}
private void textBox2_OnButtonClick(object sender, EventArgs e)
{
if (!string.IsNullOrWhiteSpace(textBox2.Text))
{
if (File.Exists(textBox2.Text))
{
openFileDialog1.InitialDirectory = Path.GetDirectoryName(textBox2.Text);
}
}
if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
textBox2.Text = openFileDialog1.FileName;
}
}
private void textBox4_OnButtonClick(object sender, EventArgs e)
{
if (!string.IsNullOrWhiteSpace(textBox4.Text))
{
if (Directory.Exists(textBox4.Text))
{
folderBrowserDialog1.SelectedPath = textBox4.Text;
}
}
if (folderBrowserDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
textBox4.Text = folderBrowserDialog1.SelectedPath;
}
}
}
}
+137
View File
@@ -0,0 +1,137 @@
<?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>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="imgbxClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMS4xYyqcSwAAANlJREFUOE+lU1sO
gjAQrHgRY6KemQ+VT9NrgAfgfRA+SawzdTAk2lhkkgm7s7vTAq0py/LUNM0dHEEXSfYWfd8fDQIOD23b
nvFMY6jeAcxpMFIwC1HX9YWzNOCWUunR4AxnvxpUVbV3zm2UGsbUlHoEDfBhdsgf4BWDCcmYGmtqCxtw
NeQcoJ6JjGn43hXy8CvIxDeIGbREZY+pHjLgtqeVHf7SzVq7VdmDM6x9GGj1/19h9UckVv3GWMwNRh5L
6dGYH+UCHCTQ9SfV+7pMvJIIaLL0Oudd1x2eUQ8MyeAeq0cAAAAASUVORK5CYII=
</value>
</data>
<metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>186, 17</value>
</metadata>
</root>
+18
View File
@@ -1,5 +1,6 @@
using AppLauncher.Models;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Threading;
using System.Threading.Tasks;
@@ -58,6 +59,23 @@ namespace AppLauncher.Windows.Forms
public bool IsAnimating => isAnimating;
public TileGroupModel Model
{
get
{
TileGroupModel rs = new TileGroupModel()
{
Title = label1.TitleText,
GridSize = new Size(panel1.GridSize.X, panel1.GridSize.Y),
IsExpanded = label1.Checked,
IsExclusive = groupInfo.IsExclusive,
Items = panel1.Tiles
};
return rs;
}
}
public async Task Collapse()
{
await Task.Run(() =>
+91
View File
@@ -1,8 +1,11 @@
using AppLauncher.Models;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;
namespace AppLauncher.Windows.Forms
{
@@ -24,9 +27,24 @@ namespace AppLauncher.Windows.Forms
public TileLayoutPanel() : base()
{
InitializeComponent();
this.AllowDrop = true;
this.BackColor = System.Drawing.Color.Transparent;
}
private void InitializeComponent()
{
this.SuspendLayout();
//
// TileLayoutPanel
//
this.Name = "TileLayoutPanel";
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.panel_DragDrop);
this.DragOver += new System.Windows.Forms.DragEventHandler(this.panel_DragOver);
this.ResumeLayout(false);
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
@@ -69,6 +87,20 @@ namespace AppLauncher.Windows.Forms
public int ExpandedHeight => expandedHeight;
public List<TileModel> Tiles
{
get
{
List<TileModel> rs = new List<TileModel>();
foreach (Item item in items)
{
rs.Add(item.Tile.ModelInfo);
}
return rs;
}
}
public void AddTile(TileModel tile)
{
Point gridSize = this.GridSize;
@@ -351,5 +383,64 @@ namespace AppLauncher.Windows.Forms
return true;
}
private void panel_DragOver(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
e.Effect = DragDropEffects.Link;
}
else
{
e.Effect = DragDropEffects.None;
}
}
private void panel_DragDrop(object sender, DragEventArgs e)
{
string[] fileList = e.Data.GetData(DataFormats.FileDrop) as string[];
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
}
}
}
this.AddTile(model);
}
}
}
+8 -9
View File
@@ -34,6 +34,7 @@
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.contextMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
@@ -50,8 +51,7 @@
this.label1.Size = new System.Drawing.Size(70, 13);
this.label1.TabIndex = 24;
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label1.Click += new System.EventHandler(this.TilePanel_Click);
this.label1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.TilePanel_MouseDoubleClick);
this.label1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseDoubleClick);
//
// contextMenuStrip1
//
@@ -59,19 +59,19 @@
this.editToolStripMenuItem,
this.removeToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(181, 70);
this.contextMenuStrip1.Size = new System.Drawing.Size(118, 48);
//
// editToolStripMenuItem
//
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
this.editToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
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(180, 22);
this.removeToolStripMenuItem.Size = new System.Drawing.Size(117, 22);
this.removeToolStripMenuItem.Text = "&Remove";
this.removeToolStripMenuItem.Click += new System.EventHandler(this.removeToolStripMenuItem_Click);
//
@@ -88,8 +88,7 @@
this.pictureBox1.Size = new System.Drawing.Size(70, 38);
this.pictureBox1.TabIndex = 25;
this.pictureBox1.TabStop = false;
this.pictureBox1.Click += new System.EventHandler(this.TilePanel_Click);
this.pictureBox1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.TilePanel_MouseDoubleClick);
this.pictureBox1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseDoubleClick);
//
// TilePanel
//
@@ -104,8 +103,7 @@
this.MinimumSize = new System.Drawing.Size(70, 70);
this.Name = "TilePanel";
this.Size = new System.Drawing.Size(70, 70);
this.Click += new System.EventHandler(this.TilePanel_Click);
this.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.TilePanel_MouseDoubleClick);
this.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.panel_MouseDoubleClick);
this.contextMenuStrip1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
@@ -119,5 +117,6 @@
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem;
private System.Windows.Forms.ToolTip toolTip1;
}
}
+7 -9
View File
@@ -82,6 +82,9 @@ namespace AppLauncher.Windows.Forms
}
}
toolTip1.SetToolTip(this, this.Title);
toolTip1.SetToolTip(pictureBox1, this.Title);
toolTip1.SetToolTip(label1, this.Title);
}
private void panel_MouseDown(object sender, MouseEventArgs e)
@@ -92,7 +95,7 @@ namespace AppLauncher.Windows.Forms
return;
}
if (e.Button != MouseButtons.Left)
if (e.Button != MouseButtons.Right)
{
return;
}
@@ -125,7 +128,7 @@ namespace AppLauncher.Windows.Forms
}
}
private void TilePanel_MouseDoubleClick(object sender, MouseEventArgs e)
private void panel_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (this.ModelInfo == null)
{
@@ -153,17 +156,12 @@ namespace AppLauncher.Windows.Forms
{
Process.Start(p);
}
catch
catch (Exception exc)
{
// do nothing
MessageBox.Show(exc.Message);
}
}
private void TilePanel_Click(object sender, EventArgs e)
{
// do nothing yet
}
private void editToolStripMenuItem_Click(object sender, EventArgs e)
{
if (editForm == null) editForm = new EditTileForm(this);
+3
View File
@@ -120,4 +120,7 @@
<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">
<value>172, 17</value>
</metadata>
</root>