Update about Manager.

This commit is contained in:
Bruce
2026-02-06 18:12:21 +08:00
parent d91948eaff
commit d85fbb8de8
52 changed files with 4949 additions and 50 deletions

85
Manager/BridgeExt.cs Normal file
View File

@@ -0,0 +1,85 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DataUtils;
using Newtonsoft.Json;
namespace Manager
{
[ComVisible (true)]
[ClassInterface (ClassInterfaceType.AutoDual)]
public class BridgeExt: Bridge._I_BridgeBase
{
Form currentWnd = null;
public BridgeExt (Form wnd, IScriptBridge isc, IWebBrowserPageScale iwbps, ITaskbarProgress itp) : base (wnd, isc, iwbps, itp)
{
currentWnd = wnd;
}
private static void CallJS (object jsFunc, params object [] args)
{
if (jsFunc == null) return;
try
{
// 这里固定第一个参数为 thisArg比如 1
object [] realArgs = new object [args.Length + 1];
realArgs [0] = jsFunc; // thisArg
Array.Copy (args, 0, realArgs, 1, args.Length);
jsFunc.GetType ().InvokeMember (
"call",
BindingFlags.InvokeMethod,
null,
jsFunc,
realArgs
);
}
catch
{
// ignore errors in callback invocation
}
}
public Task CreateAppShortcut (string installLocation, string appUserModelId, object successCallback, object failedCallback)
{
var tcs = new TaskCompletionSource<bool> ();
var scf = new ShortcutCreateForm ();
scf.Owner = currentWnd;
scf.FormClosed += (s, e) =>
{
bool success = scf.IsSuccess;
tcs.TrySetResult (success);
var data = new
{
succeeded = scf.IsSuccess,
message = scf.Message
};
string json = JsonConvert.SerializeObject (data);
if (currentWnd.InvokeRequired)
{
currentWnd.BeginInvoke (new Action (() =>
{
if (success)
CallJS (successCallback, json);
else
CallJS (failedCallback, json);
}));
}
else
{
if (success)
CallJS (successCallback, json);
else
CallJS (failedCallback, json);
}
scf.Dispose ();
};
scf.Show (currentWnd);
scf.InitCreater (installLocation, appUserModelId);
return tcs.Task;
}
}
}

2
Manager/ClassDiagram1.cd Normal file
View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram />

126
Manager/ImageDisplay.Designer.cs generated Normal file
View File

@@ -0,0 +1,126 @@
namespace Manager
{
partial class ImageDisplay
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose (bool disposing)
{
if (disposing && (components != null))
{
components.Dispose ();
}
base.Dispose (disposing);
}
#region
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent ()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ImageDisplay));
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.sizeDisplay = new System.Windows.Forms.Label();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.backgroundPanel = new System.Windows.Forms.Panel();
this.foregroundPicture = new System.Windows.Forms.PictureBox();
this.tableLayoutPanel1.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
this.backgroundPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.foregroundPicture)).BeginInit();
this.SuspendLayout();
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Controls.Add(this.sizeDisplay, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(30, 60);
this.tableLayoutPanel1.TabIndex = 0;
//
// sizeDisplay
//
this.sizeDisplay.AutoSize = true;
this.sizeDisplay.Dock = System.Windows.Forms.DockStyle.Fill;
this.sizeDisplay.Location = new System.Drawing.Point(3, 0);
this.sizeDisplay.Name = "sizeDisplay";
this.sizeDisplay.Size = new System.Drawing.Size(24, 15);
this.sizeDisplay.TabIndex = 0;
this.sizeDisplay.Text = "16";
this.sizeDisplay.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("flowLayoutPanel1.BackgroundImage")));
this.flowLayoutPanel1.Controls.Add(this.backgroundPanel);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 15);
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(30, 45);
this.flowLayoutPanel1.TabIndex = 1;
//
// backgroundPanel
//
this.backgroundPanel.BackColor = System.Drawing.Color.Transparent;
this.backgroundPanel.Controls.Add(this.foregroundPicture);
this.backgroundPanel.Location = new System.Drawing.Point(0, 0);
this.backgroundPanel.Margin = new System.Windows.Forms.Padding(0);
this.backgroundPanel.Name = "backgroundPanel";
this.backgroundPanel.Size = new System.Drawing.Size(24, 24);
this.backgroundPanel.TabIndex = 0;
//
// foregroundPicture
//
this.foregroundPicture.BackColor = System.Drawing.Color.Transparent;
this.foregroundPicture.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.foregroundPicture.Location = new System.Drawing.Point(3, 4);
this.foregroundPicture.Name = "foregroundPicture";
this.foregroundPicture.Size = new System.Drawing.Size(16, 16);
this.foregroundPicture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.foregroundPicture.TabIndex = 0;
this.foregroundPicture.TabStop = false;
//
// ImageDisplay
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.tableLayoutPanel1);
this.MinimumSize = new System.Drawing.Size(30, 0);
this.Name = "ImageDisplay";
this.Size = new System.Drawing.Size(30, 60);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.flowLayoutPanel1.ResumeLayout(false);
this.backgroundPanel.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.foregroundPicture)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label sizeDisplay;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.Panel backgroundPanel;
private System.Windows.Forms.PictureBox foregroundPicture;
}
}

69
Manager/ImageDisplay.cs Normal file
View File

@@ -0,0 +1,69 @@
using System.Drawing;
using System.Windows.Forms;
namespace Manager
{
public partial class ImageDisplay: UserControl
{
public ImageDisplay ()
{
InitializeComponent ();
IconSize = 16;
Ratio = (decimal)(8.0 / 7.0);
}
private Size iconSize = new Size (16, 16);
private decimal ratio = (decimal)(8.0 / 7.0);
private bool originImgSize = false;
public void RefreshPictureDisplay ()
{
if (originImgSize)
{
var backSizeWidth = (foregroundPicture.Image?.Size.Width ?? 0) * ratio;
var backSizeHeight = (foregroundPicture.Image?.Size.Width ?? 0) * ratio;
foregroundPicture.Size = ForegroundImage.Size;
backgroundPanel.Size = new Size ((int)backSizeWidth, (int)backSizeHeight);
sizeDisplay.Text = backgroundPanel.Size.ToString ();
}
else
{
foregroundPicture.Size = new Size (
(int)(iconSize.Width / ratio),
(int)(iconSize.Height / ratio)
);
backgroundPanel.Size = iconSize;
}
foregroundPicture.Left = (int)((backgroundPanel.Width - foregroundPicture.Width) * 0.5);
foregroundPicture.Top = (int)((backgroundPanel.Height - foregroundPicture.Height) * 0.5);
this.Size = new Size (
(int)(iconSize.Width * 1),
(int)((iconSize.Height + sizeDisplay.Height) * 1)
);
}
public decimal Ratio
{
get { return ratio; }
set
{
ratio = value;
RefreshPictureDisplay ();
}
}
public int IconSize
{
get { return iconSize.Width; }
set
{
sizeDisplay.Text = value.ToString ();
iconSize = new Size (value, value);
RefreshPictureDisplay ();
}
}
public bool IsOriginPicSize
{
get { return originImgSize; }
set { originImgSize = true; RefreshPictureDisplay (); }
}
public Color BackgroundColor { get { return backgroundPanel.BackColor; } set { backgroundPanel.BackColor = value; } }
public Image ForegroundImage { get { return foregroundPicture.Image; } set { foregroundPicture.Image = value; } }
}
}

129
Manager/ImageDisplay.resx Normal file
View File

@@ -0,0 +1,129 @@
<?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="flowLayoutPanel1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAS
dAAAEnQB3mYfeAAAAGdJREFUWEftzrENgFAQw9C//1qscv2tQBMGsEiBkF+TLvLZnqvHLMIswizCLMIs
wizCLMIswizCLOK/WfPIZYNZxMk2pG4mvS+YRTSzctlgFmEWYRZhFmEWYRZhFmEWYRZhFvHJrN0bfh7U
g5LtRRcAAAAASUVORK5CYII=
</value>
</data>
</root>

323
Manager/ImageSetForm.Designer.cs generated Normal file
View File

@@ -0,0 +1,323 @@
namespace Manager
{
partial class ImageSetForm
{
/// <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 Windows Form 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 ()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ImageSetForm));
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.label1 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.panel1 = new System.Windows.Forms.Panel();
this.initImgsSizeList = new System.Windows.Forms.FlowLayoutPanel();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.label2 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.label4 = new System.Windows.Forms.Label();
this.tableLayoutPanel1.SuspendLayout();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.tableLayoutPanel2.SuspendLayout();
this.SuspendLayout();
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 5;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 109F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.Controls.Add(this.label1, 1, 1);
this.tableLayoutPanel1.Controls.Add(this.textBox1, 2, 1);
this.tableLayoutPanel1.Controls.Add(this.radioButton1, 1, 2);
this.tableLayoutPanel1.Controls.Add(this.panel1, 1, 3);
this.tableLayoutPanel1.Controls.Add(this.radioButton2, 1, 4);
this.tableLayoutPanel1.Controls.Add(this.label2, 1, 5);
this.tableLayoutPanel1.Controls.Add(this.textBox2, 2, 5);
this.tableLayoutPanel1.Controls.Add(this.label3, 1, 6);
this.tableLayoutPanel1.Controls.Add(this.button1, 3, 5);
this.tableLayoutPanel1.Controls.Add(this.pictureBox1, 1, 7);
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 1, 9);
this.tableLayoutPanel1.Controls.Add(this.label4, 3, 6);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 11;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 60F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 36F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 10F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(454, 439);
this.tableLayoutPanel1.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label1.Location = new System.Drawing.Point(23, 20);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(97, 32);
this.label1.TabIndex = 0;
this.label1.Text = "Current Size";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// textBox1
//
this.tableLayoutPanel1.SetColumnSpan(this.textBox1, 2);
this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox1.Location = new System.Drawing.Point(126, 24);
this.textBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.textBox1.Name = "textBox1";
this.textBox1.ReadOnly = true;
this.textBox1.Size = new System.Drawing.Size(305, 27);
this.textBox1.TabIndex = 1;
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.tableLayoutPanel1.SetColumnSpan(this.radioButton1, 3);
this.radioButton1.Dock = System.Windows.Forms.DockStyle.Fill;
this.radioButton1.Location = new System.Drawing.Point(23, 56);
this.radioButton1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(408, 24);
this.radioButton1.TabIndex = 2;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "Use Default Resources";
this.radioButton1.UseVisualStyleBackColor = true;
this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
//
// panel1
//
this.tableLayoutPanel1.SetColumnSpan(this.panel1, 3);
this.panel1.Controls.Add(this.initImgsSizeList);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(23, 88);
this.panel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(408, 52);
this.panel1.TabIndex = 3;
//
// initImgsSizeList
//
this.initImgsSizeList.AutoScroll = true;
this.initImgsSizeList.Dock = System.Windows.Forms.DockStyle.Fill;
this.initImgsSizeList.Location = new System.Drawing.Point(0, 0);
this.initImgsSizeList.Margin = new System.Windows.Forms.Padding(0);
this.initImgsSizeList.Name = "initImgsSizeList";
this.initImgsSizeList.Size = new System.Drawing.Size(408, 52);
this.initImgsSizeList.TabIndex = 0;
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.tableLayoutPanel1.SetColumnSpan(this.radioButton2, 3);
this.radioButton2.Dock = System.Windows.Forms.DockStyle.Fill;
this.radioButton2.Location = new System.Drawing.Point(23, 148);
this.radioButton2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(408, 24);
this.radioButton2.TabIndex = 4;
this.radioButton2.TabStop = true;
this.radioButton2.Text = "Use File";
this.radioButton2.UseVisualStyleBackColor = true;
this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
this.label2.Location = new System.Drawing.Point(23, 176);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(97, 36);
this.label2.TabIndex = 5;
this.label2.Text = "File Path";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// textBox2
//
this.textBox2.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox2.Location = new System.Drawing.Point(126, 180);
this.textBox2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(196, 27);
this.textBox2.TabIndex = 6;
this.textBox2.TextChanged += new System.EventHandler(this.textBox2_TextChanged);
//
// label3
//
this.label3.AutoSize = true;
this.tableLayoutPanel1.SetColumnSpan(this.label3, 2);
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
this.label3.Location = new System.Drawing.Point(23, 212);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(299, 20);
this.label3.TabIndex = 7;
this.label3.Text = "Preview";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// button1
//
this.button1.Dock = System.Windows.Forms.DockStyle.Fill;
this.button1.Location = new System.Drawing.Point(325, 176);
this.button1.Margin = new System.Windows.Forms.Padding(0);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(109, 36);
this.button1.TabIndex = 8;
this.button1.Text = "Browse...";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// pictureBox1
//
this.pictureBox1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.BackgroundImage")));
this.tableLayoutPanel1.SetColumnSpan(this.pictureBox1, 3);
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.pictureBox1.Location = new System.Drawing.Point(23, 236);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(408, 129);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 9;
this.pictureBox1.TabStop = false;
this.pictureBox1.LoadCompleted += new System.ComponentModel.AsyncCompletedEventHandler(this.pictureBox1_LoadCompleted);
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.ColumnCount = 5;
this.tableLayoutPanel1.SetColumnSpan(this.tableLayoutPanel2, 3);
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 80F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 80F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel2.Controls.Add(this.button2, 1, 1);
this.tableLayoutPanel2.Controls.Add(this.button3, 3, 1);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.Location = new System.Drawing.Point(20, 379);
this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 3;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 36F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(414, 40);
this.tableLayoutPanel2.TabIndex = 10;
//
// button2
//
this.button2.Dock = System.Windows.Forms.DockStyle.Fill;
this.button2.Location = new System.Drawing.Point(84, 2);
this.button2.Margin = new System.Windows.Forms.Padding(0);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(80, 36);
this.button2.TabIndex = 0;
this.button2.Text = "Set";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.Dock = System.Windows.Forms.DockStyle.Fill;
this.button3.Location = new System.Drawing.Point(248, 2);
this.button3.Margin = new System.Windows.Forms.Padding(0);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(80, 36);
this.button3.TabIndex = 1;
this.button3.Text = "Cancel";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
this.label4.Location = new System.Drawing.Point(328, 212);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(103, 20);
this.label4.TabIndex = 11;
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// ImageSetForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(454, 439);
this.Controls.Add(this.tableLayoutPanel1);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Name = "ImageSetForm";
this.Text = "Setting Current Image";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ImageSetForm_FormClosing);
this.Load += new System.EventHandler(this.ImageSetForm_Load);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.tableLayoutPanel2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.FlowLayoutPanel initImgsSizeList;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Label label4;
}
}

178
Manager/ImageSetForm.cs Normal file
View File

@@ -0,0 +1,178 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using Bridge;
namespace Manager
{
public partial class ImageSetForm: Form
{
public ImageSetForm ()
{
InitializeComponent ();
Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_SETIMG_TITLE");
label1.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_SETIMG_CURRSIZE");
radioButton1.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_SETIMG_USEDEF");
radioButton2.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_SETIMG_USEFILE");
label2.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_SETIMG_FILEPATH");
button1.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_BROWSE");
label3.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_PREVIEW");
button2.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_SETIMG_SET");
button3.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_CANCEL");
}
private Dictionary<int, Image> defimages = new Dictionary<int, Image> ();
private void RefreshDefaultImagesSettings ()
{
try
{
initImgsSizeList.Controls.Clear ();
foreach (var kv in defimages)
{
RadioButton rb = new RadioButton ();
rb.Text = kv.Key.ToString ();
rb.CheckedChanged += DefaultImgsRadio_CheckedChanged;
initImgsSizeList.Controls.Add (rb);
}
}
catch { }
}
public Dictionary <int, Image> DefaultImages
{
get { return defimages; }
set { defimages = value; RefreshDefaultImagesSettings (); }
}
public int CurrentSize { set { textBox1.Text = value.ToString (); } }
private void RefreshImagesType ()
{
initImgsSizeList.Enabled = radioButton1.Checked;
textBox2.Enabled = button1.Enabled = radioButton2.Checked;
}
private Image finalUse = null;
private void RefreshImagesPreview ()
{
pictureBox1.Image = null;
try
{
if (radioButton1.Checked)
{
foreach (RadioButton ctrl in initImgsSizeList.Controls)
{
if (ctrl.Checked)
{
int value = int.Parse (ctrl.Text);
pictureBox1.Image = defimages [value];
}
}
}
else
{
try
{
pictureBox1.Image = Image.FromFile (textBox2.Text);
}
catch { }
}
}
catch { pictureBox1.Image = null; }
finally
{
try
{
label4.Text = $"{pictureBox1.Image.Width} x {pictureBox1.Image.Height}";
}
catch { label4.Text = ""; }
}
}
private void DefaultImgsRadio_CheckedChanged (object sender, EventArgs e)
{
RefreshImagesPreview ();
}
private void ImageSetForm_Load (object sender, EventArgs e)
{
RefreshImagesType ();
//RefreshImagesPreview ();
}
private void textBox2_TextChanged (object sender, EventArgs e)
{
RefreshImagesPreview ();
}
private void radioButton1_CheckedChanged (object sender, EventArgs e)
{
RefreshImagesType ();
RefreshImagesPreview ();
}
private void radioButton2_CheckedChanged (object sender, EventArgs e)
{
RefreshImagesType ();
RefreshImagesPreview ();
}
public Image FinalImage
{
set
{
pictureBox1.Image = value;
try
{
label4.Text = $"{pictureBox1.Image.Width} x {pictureBox1.Image.Height}";
}
catch { label4.Text = ""; }
}
get { return finalUse; }
}
private void button3_Click (object sender, EventArgs e)
{
this.Close ();
}
private void button2_Click (object sender, EventArgs e)
{
try
{
if (radioButton1.Checked)
{
foreach (RadioButton ctrl in initImgsSizeList.Controls)
{
if (ctrl.Checked)
{
int value = int.Parse (ctrl.Text);
finalUse = defimages [value];
}
}
}
else
{
finalUse = Image.FromFile (textBox2.Text);
}
if (finalUse == null) throw new Exception ("Error: none valid image.");
this.Close ();
}
catch (Exception ex)
{
MessageBox.Show (ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ImageSetForm_FormClosing (object sender, FormClosingEventArgs e)
{
}
private void pictureBox1_LoadCompleted (object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
label4.Text = $"{pictureBox1.Image.Width} x {pictureBox1.Image.Height}";
}
private void button1_Click (object sender, EventArgs e)
{
using (OpenFileDialog ofd = new OpenFileDialog ())
{
ofd.Title = "Please select the image file: ";
ofd.Filter = "Image Files (*.png;*.bmp;*.jpg;*.jpeg)|*.png;*.bmp;*.jpg;*.jpeg";
ofd.Multiselect = false;
ofd.CheckFileExists = true;
ofd.CheckPathExists = true;
if (ofd.ShowDialog (this) == DialogResult.OK)
{
textBox2.Text = ofd.FileName;
radioButton2.Checked = true;
}
}
}
}
}

129
Manager/ImageSetForm.resx Normal file
View File

@@ -0,0 +1,129 @@
<?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="pictureBox1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAS
dAAAEnQB3mYfeAAAAGlJREFUWEftzrENACEQA0H6r4SG6OAKAfHXwOodEOwkzqwdlTNzzCLMIswizCLM
IswizCLMIswizCLMIjJZ6+rLhFezehO+uKNjfzCLSGb1ZYJZhFmEWYRZhFmEWYRZhFmEWYRZxJNZVRvc
pafKc4vMkgAAAABJRU5ErkJggg==
</value>
</data>
</root>

89
Manager/LoadingStatusForm.Designer.cs generated Normal file
View File

@@ -0,0 +1,89 @@
namespace Manager
{
partial class LoadingStatusForm
{
/// <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 Windows Form 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 ()
{
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.label1 = new System.Windows.Forms.Label();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 3;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Controls.Add(this.label1, 1, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 3;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(241, 123);
this.tableLayoutPanel1.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(55, 48);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(131, 27);
this.label1.TabIndex = 1;
this.label1.Text = "Please wait...";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// LoadingStatusForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(241, 123);
this.ControlBox = false;
this.Controls.Add(this.tableLayoutPanel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MaximizeBox = false;
this.Name = "LoadingStatusForm";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Please wait...";
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label label1;
}
}

View File

@@ -0,0 +1,19 @@
using System.Windows.Forms;
using Bridge;
namespace Manager
{
public partial class LoadingStatusForm: Form
{
public LoadingStatusForm ()
{
InitializeComponent ();
label1.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_LOADING");
}
public string TipText
{
get { return label1.Text; }
set { label1.Text = value; }
}
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -53,8 +53,13 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net40\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.DirectoryServices" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@@ -65,6 +70,25 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="BridgeExt.cs" />
<Compile Include="ImageDisplay.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="ImageDisplay.Designer.cs">
<DependentUpon>ImageDisplay.cs</DependentUpon>
</Compile>
<Compile Include="ImageSetForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ImageSetForm.Designer.cs">
<DependentUpon>ImageSetForm.cs</DependentUpon>
</Compile>
<Compile Include="LoadingStatusForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="LoadingStatusForm.Designer.cs">
<DependentUpon>LoadingStatusForm.cs</DependentUpon>
</Compile>
<Compile Include="ManagerShell.cs">
<SubType>Form</SubType>
</Compile>
@@ -74,7 +98,22 @@
<Compile Include="Polyfill.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ShortcutCreateForm.cs" />
<Compile Include="ShortcutCreateForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ShortcutCreateForm.Designer.cs">
<DependentUpon>ShortcutCreateForm.cs</DependentUpon>
</Compile>
<Compile Include="ShortcutHelper.cs" />
<EmbeddedResource Include="ImageDisplay.resx">
<DependentUpon>ImageDisplay.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ImageSetForm.resx">
<DependentUpon>ImageSetForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="LoadingStatusForm.resx">
<DependentUpon>LoadingStatusForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ManagerShell.resx">
<DependentUpon>ManagerShell.cs</DependentUpon>
</EmbeddedResource>
@@ -88,7 +127,12 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="ShortcutCreateForm.resx">
<DependentUpon>ShortcutCreateForm.cs</DependentUpon>
</EmbeddedResource>
<None Include="app.manifest" />
<None Include="ClassDiagram1.cd" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>

View File

@@ -9,6 +9,7 @@ namespace Manager
public ManagerShell ()
{
InitializeComponent ();
this.PublicObjectForScripting = new BridgeExt (this, this, this, this);
try
{
var relativePath = DataUtils.VisualElementsStore.Vemanifest.SplashScreenImage (Program.g_appId);
@@ -23,6 +24,7 @@ namespace Manager
}
catch { }
InitSize ();
Text = Bridge.ResXmlStore.StringRes.Get ("MANAGER_APPTITLE");
}
private void InitSize ()
{

View File

@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Windows.Forms;
namespace Manager
@@ -15,7 +14,13 @@ namespace Manager
[STAThread]
static void Main ()
{
Directory.SetCurrentDirectory (AppDomain.CurrentDomain.BaseDirectory);
//System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo ("en-US");
//System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo ("en-US");
AppxPackage.PackageReader.AddApplicationItem ("SmallLogo");
AppxPackage.PackageReader.AddApplicationItem ("Square30x30Logo");
AppxPackage.PackageReader.AddApplicationItem ("Logo");
AppxPackage.PackageReader.AddApplicationItem ("Square44x44Logo");
DataUtils.BrowserEmulation.SetWebBrowserEmulation ();
Application.EnableVisualStyles ();
Application.SetCompatibleTextRenderingDefault (false);

662
Manager/ShortcutCreateForm.Designer.cs generated Normal file
View File

@@ -0,0 +1,662 @@
namespace Manager
{
partial class ShortcutCreateForm
{
/// <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 Windows Form 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 ()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShortcutCreateForm));
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.label3 = new System.Windows.Forms.Label();
this.iconSetGen = new System.Windows.Forms.RadioButton();
this.iconSetFromFile = new System.Windows.Forms.RadioButton();
this.label4 = new System.Windows.Forms.Label();
this.iconFileInput = new System.Windows.Forms.TextBox();
this.iconFileBrowser = new System.Windows.Forms.Button();
this.label7 = new System.Windows.Forms.Label();
this.customIconDisplay = new System.Windows.Forms.PictureBox();
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.label5 = new System.Windows.Forms.Label();
this.colorPickerButton = new System.Windows.Forms.Button();
this.colorInputAndPreview = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.ratio8_7 = new System.Windows.Forms.RadioButton();
this.ratio3_2 = new System.Windows.Forms.RadioButton();
this.ratio1_1 = new System.Windows.Forms.RadioButton();
this.ratioCustom = new System.Windows.Forms.RadioButton();
this.label10 = new System.Windows.Forms.Label();
this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel();
this.ratioCustomBack = new System.Windows.Forms.TextBox();
this.ratioCustomFore = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.shortcutNameInput = new System.Windows.Forms.TextBox();
this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.imageSizeList = new System.Windows.Forms.DataGridView();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column2 = new System.Windows.Forms.DataGridViewImageColumn();
this.imagesPreview = new System.Windows.Forms.FlowLayoutPanel();
this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel();
this.buttonGen = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.tableLayoutPanel1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.customIconDisplay)).BeginInit();
this.tableLayoutPanel3.SuspendLayout();
this.tableLayoutPanel6.SuspendLayout();
this.tableLayoutPanel4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.imageSizeList)).BeginInit();
this.tableLayoutPanel5.SuspendLayout();
this.SuspendLayout();
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 7;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 24F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 5F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 5F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25F));
this.tableLayoutPanel1.Controls.Add(this.label1, 1, 1);
this.tableLayoutPanel1.Controls.Add(this.label2, 1, 3);
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 1, 5);
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel3, 3, 5);
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel4, 5, 5);
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel5, 1, 7);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 9;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 10F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 10F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 10F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(782, 553);
this.tableLayoutPanel1.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.tableLayoutPanel1.SetColumnSpan(this.label1, 5);
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Font = new System.Drawing.Font("微软雅黑 Light", 20F);
this.label1.Location = new System.Drawing.Point(27, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(727, 45);
this.label1.TabIndex = 0;
this.label1.Text = "Create Desktop Shortcut";
//
// label2
//
this.label2.AutoSize = true;
this.tableLayoutPanel1.SetColumnSpan(this.label2, 5);
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
this.label2.Location = new System.Drawing.Point(27, 79);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(727, 60);
this.label2.TabIndex = 1;
this.label2.Text = resources.GetString("label2.Text");
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.ColumnCount = 2;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 103F));
this.tableLayoutPanel2.Controls.Add(this.label3, 0, 0);
this.tableLayoutPanel2.Controls.Add(this.iconSetGen, 0, 2);
this.tableLayoutPanel2.Controls.Add(this.iconSetFromFile, 0, 3);
this.tableLayoutPanel2.Controls.Add(this.label4, 0, 5);
this.tableLayoutPanel2.Controls.Add(this.iconFileInput, 0, 6);
this.tableLayoutPanel2.Controls.Add(this.iconFileBrowser, 1, 7);
this.tableLayoutPanel2.Controls.Add(this.label7, 0, 8);
this.tableLayoutPanel2.Controls.Add(this.customIconDisplay, 0, 9);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.Location = new System.Drawing.Point(27, 152);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 10;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 8F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 8F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 34F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 39F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 18F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 13F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(235, 324);
this.tableLayoutPanel2.TabIndex = 2;
//
// label3
//
this.label3.AutoSize = true;
this.tableLayoutPanel2.SetColumnSpan(this.label3, 2);
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
this.label3.Location = new System.Drawing.Point(3, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(229, 40);
this.label3.TabIndex = 0;
this.label3.Text = "Please select the method for setting the icon.";
//
// iconSetGen
//
this.iconSetGen.AutoSize = true;
this.iconSetGen.Checked = true;
this.tableLayoutPanel2.SetColumnSpan(this.iconSetGen, 2);
this.iconSetGen.Dock = System.Windows.Forms.DockStyle.Fill;
this.iconSetGen.Location = new System.Drawing.Point(3, 51);
this.iconSetGen.Name = "iconSetGen";
this.iconSetGen.Size = new System.Drawing.Size(229, 24);
this.iconSetGen.TabIndex = 1;
this.iconSetGen.TabStop = true;
this.iconSetGen.Text = "Generate an icon";
this.iconSetGen.UseVisualStyleBackColor = true;
this.iconSetGen.CheckedChanged += new System.EventHandler(this.iconSetGen_CheckedChanged);
//
// iconSetFromFile
//
this.iconSetFromFile.AutoSize = true;
this.tableLayoutPanel2.SetColumnSpan(this.iconSetFromFile, 2);
this.iconSetFromFile.Dock = System.Windows.Forms.DockStyle.Fill;
this.iconSetFromFile.Location = new System.Drawing.Point(3, 81);
this.iconSetFromFile.Name = "iconSetFromFile";
this.iconSetFromFile.Size = new System.Drawing.Size(229, 24);
this.iconSetFromFile.TabIndex = 2;
this.iconSetFromFile.Text = "Use existing icons";
this.iconSetFromFile.UseVisualStyleBackColor = true;
this.iconSetFromFile.CheckedChanged += new System.EventHandler(this.iconSetFromFile_CheckedChanged);
//
// label4
//
this.label4.AutoSize = true;
this.tableLayoutPanel2.SetColumnSpan(this.label4, 2);
this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
this.label4.Location = new System.Drawing.Point(3, 116);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(229, 20);
this.label4.TabIndex = 3;
this.label4.Text = "Custom icon file path:";
//
// iconFileInput
//
this.tableLayoutPanel2.SetColumnSpan(this.iconFileInput, 2);
this.iconFileInput.Dock = System.Windows.Forms.DockStyle.Fill;
this.iconFileInput.Location = new System.Drawing.Point(3, 139);
this.iconFileInput.Name = "iconFileInput";
this.iconFileInput.Size = new System.Drawing.Size(229, 27);
this.iconFileInput.TabIndex = 4;
this.iconFileInput.TextChanged += new System.EventHandler(this.iconFileInput_TextChanged);
//
// iconFileBrowser
//
this.iconFileBrowser.Dock = System.Windows.Forms.DockStyle.Fill;
this.iconFileBrowser.Location = new System.Drawing.Point(135, 173);
this.iconFileBrowser.Name = "iconFileBrowser";
this.iconFileBrowser.Size = new System.Drawing.Size(97, 33);
this.iconFileBrowser.TabIndex = 5;
this.iconFileBrowser.Text = "Browser...";
this.iconFileBrowser.UseVisualStyleBackColor = true;
this.iconFileBrowser.Click += new System.EventHandler(this.iconFileBrowser_Click);
//
// label7
//
this.label7.AutoSize = true;
this.label7.Dock = System.Windows.Forms.DockStyle.Fill;
this.label7.Location = new System.Drawing.Point(3, 209);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(126, 18);
this.label7.TabIndex = 6;
this.label7.Text = "Preview:";
//
// customIconDisplay
//
this.customIconDisplay.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.tableLayoutPanel2.SetColumnSpan(this.customIconDisplay, 2);
this.customIconDisplay.Dock = System.Windows.Forms.DockStyle.Fill;
this.customIconDisplay.Location = new System.Drawing.Point(3, 230);
this.customIconDisplay.Name = "customIconDisplay";
this.customIconDisplay.Size = new System.Drawing.Size(229, 91);
this.customIconDisplay.TabIndex = 7;
this.customIconDisplay.TabStop = false;
//
// tableLayoutPanel3
//
this.tableLayoutPanel3.ColumnCount = 2;
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 97F));
this.tableLayoutPanel3.Controls.Add(this.label5, 0, 0);
this.tableLayoutPanel3.Controls.Add(this.colorPickerButton, 1, 1);
this.tableLayoutPanel3.Controls.Add(this.colorInputAndPreview, 0, 1);
this.tableLayoutPanel3.Controls.Add(this.label6, 0, 2);
this.tableLayoutPanel3.Controls.Add(this.ratio8_7, 0, 3);
this.tableLayoutPanel3.Controls.Add(this.ratio3_2, 0, 4);
this.tableLayoutPanel3.Controls.Add(this.ratio1_1, 0, 5);
this.tableLayoutPanel3.Controls.Add(this.ratioCustom, 0, 6);
this.tableLayoutPanel3.Controls.Add(this.label10, 0, 7);
this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel6, 0, 8);
this.tableLayoutPanel3.Controls.Add(this.label12, 0, 9);
this.tableLayoutPanel3.Controls.Add(this.shortcutNameInput, 0, 10);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel3.Location = new System.Drawing.Point(273, 152);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 11;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 18F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(235, 324);
this.tableLayoutPanel3.TabIndex = 3;
//
// label5
//
this.label5.AutoSize = true;
this.tableLayoutPanel3.SetColumnSpan(this.label5, 2);
this.label5.Dock = System.Windows.Forms.DockStyle.Fill;
this.label5.Location = new System.Drawing.Point(3, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(229, 20);
this.label5.TabIndex = 0;
this.label5.Text = "Background Color:";
//
// colorPickerButton
//
this.colorPickerButton.Dock = System.Windows.Forms.DockStyle.Fill;
this.colorPickerButton.Location = new System.Drawing.Point(141, 23);
this.colorPickerButton.Name = "colorPickerButton";
this.colorPickerButton.Size = new System.Drawing.Size(91, 29);
this.colorPickerButton.TabIndex = 1;
this.colorPickerButton.Text = "Select";
this.colorPickerButton.UseVisualStyleBackColor = true;
this.colorPickerButton.Click += new System.EventHandler(this.colorPickerButton_Click);
//
// colorInputAndPreview
//
this.colorInputAndPreview.Dock = System.Windows.Forms.DockStyle.Fill;
this.colorInputAndPreview.Location = new System.Drawing.Point(3, 23);
this.colorInputAndPreview.Name = "colorInputAndPreview";
this.colorInputAndPreview.Size = new System.Drawing.Size(132, 27);
this.colorInputAndPreview.TabIndex = 2;
this.colorInputAndPreview.TextChanged += new System.EventHandler(this.colorInputAndPreview_TextChanged);
//
// label6
//
this.label6.AutoSize = true;
this.tableLayoutPanel3.SetColumnSpan(this.label6, 2);
this.label6.Dock = System.Windows.Forms.DockStyle.Fill;
this.label6.Location = new System.Drawing.Point(3, 55);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(229, 40);
this.label6.TabIndex = 3;
this.label6.Text = "Background-to-foreground edge ratio";
//
// ratio8_7
//
this.ratio8_7.AutoSize = true;
this.ratio8_7.Checked = true;
this.tableLayoutPanel3.SetColumnSpan(this.ratio8_7, 2);
this.ratio8_7.Dock = System.Windows.Forms.DockStyle.Fill;
this.ratio8_7.Location = new System.Drawing.Point(3, 98);
this.ratio8_7.Name = "ratio8_7";
this.ratio8_7.Size = new System.Drawing.Size(229, 24);
this.ratio8_7.TabIndex = 4;
this.ratio8_7.TabStop = true;
this.ratio8_7.Text = "8:7";
this.ratio8_7.UseVisualStyleBackColor = true;
this.ratio8_7.CheckedChanged += new System.EventHandler(this.ratio8_7_CheckedChanged);
//
// ratio3_2
//
this.ratio3_2.AutoSize = true;
this.tableLayoutPanel3.SetColumnSpan(this.ratio3_2, 2);
this.ratio3_2.Dock = System.Windows.Forms.DockStyle.Fill;
this.ratio3_2.Location = new System.Drawing.Point(3, 128);
this.ratio3_2.Name = "ratio3_2";
this.ratio3_2.Size = new System.Drawing.Size(229, 24);
this.ratio3_2.TabIndex = 5;
this.ratio3_2.Text = "3:2";
this.ratio3_2.UseVisualStyleBackColor = true;
this.ratio3_2.CheckedChanged += new System.EventHandler(this.ratio3_2_CheckedChanged);
//
// ratio1_1
//
this.ratio1_1.AutoSize = true;
this.tableLayoutPanel3.SetColumnSpan(this.ratio1_1, 2);
this.ratio1_1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ratio1_1.Location = new System.Drawing.Point(3, 158);
this.ratio1_1.Name = "ratio1_1";
this.ratio1_1.Size = new System.Drawing.Size(229, 24);
this.ratio1_1.TabIndex = 6;
this.ratio1_1.Text = "1:1";
this.ratio1_1.UseVisualStyleBackColor = true;
this.ratio1_1.CheckedChanged += new System.EventHandler(this.ratio1_1_CheckedChanged);
//
// ratioCustom
//
this.ratioCustom.AutoSize = true;
this.tableLayoutPanel3.SetColumnSpan(this.ratioCustom, 2);
this.ratioCustom.Dock = System.Windows.Forms.DockStyle.Fill;
this.ratioCustom.Location = new System.Drawing.Point(3, 188);
this.ratioCustom.Name = "ratioCustom";
this.ratioCustom.Size = new System.Drawing.Size(229, 24);
this.ratioCustom.TabIndex = 7;
this.ratioCustom.Text = "Custom";
this.ratioCustom.UseVisualStyleBackColor = true;
this.ratioCustom.CheckedChanged += new System.EventHandler(this.ratioCustom_CheckedChanged);
//
// label10
//
this.label10.AutoSize = true;
this.tableLayoutPanel3.SetColumnSpan(this.label10, 2);
this.label10.Dock = System.Windows.Forms.DockStyle.Fill;
this.label10.Location = new System.Drawing.Point(3, 215);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(229, 20);
this.label10.TabIndex = 8;
this.label10.Text = "Custom Ratio:";
//
// tableLayoutPanel6
//
this.tableLayoutPanel6.ColumnCount = 3;
this.tableLayoutPanel3.SetColumnSpan(this.tableLayoutPanel6, 2);
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel6.Controls.Add(this.ratioCustomBack, 0, 0);
this.tableLayoutPanel6.Controls.Add(this.ratioCustomFore, 2, 0);
this.tableLayoutPanel6.Controls.Add(this.label11, 1, 0);
this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel6.Location = new System.Drawing.Point(0, 235);
this.tableLayoutPanel6.Margin = new System.Windows.Forms.Padding(0);
this.tableLayoutPanel6.Name = "tableLayoutPanel6";
this.tableLayoutPanel6.RowCount = 1;
this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel6.Size = new System.Drawing.Size(235, 32);
this.tableLayoutPanel6.TabIndex = 9;
//
// ratioCustomBack
//
this.ratioCustomBack.Dock = System.Windows.Forms.DockStyle.Fill;
this.ratioCustomBack.Location = new System.Drawing.Point(3, 3);
this.ratioCustomBack.Name = "ratioCustomBack";
this.ratioCustomBack.Size = new System.Drawing.Size(101, 27);
this.ratioCustomBack.TabIndex = 0;
this.ratioCustomBack.Text = "8";
this.ratioCustomBack.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// ratioCustomFore
//
this.ratioCustomFore.Dock = System.Windows.Forms.DockStyle.Fill;
this.ratioCustomFore.Location = new System.Drawing.Point(130, 3);
this.ratioCustomFore.Name = "ratioCustomFore";
this.ratioCustomFore.Size = new System.Drawing.Size(102, 27);
this.ratioCustomFore.TabIndex = 1;
this.ratioCustomFore.Text = "7";
this.ratioCustomFore.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label11
//
this.label11.AutoSize = true;
this.label11.Dock = System.Windows.Forms.DockStyle.Fill;
this.label11.Location = new System.Drawing.Point(110, 0);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(14, 32);
this.label11.TabIndex = 2;
this.label11.Text = ":";
this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label12
//
this.label12.AutoSize = true;
this.tableLayoutPanel3.SetColumnSpan(this.label12, 2);
this.label12.Dock = System.Windows.Forms.DockStyle.Fill;
this.label12.Location = new System.Drawing.Point(3, 267);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(229, 20);
this.label12.TabIndex = 10;
this.label12.Text = "Shortcut Display Name";
//
// shortcutNameInput
//
this.tableLayoutPanel3.SetColumnSpan(this.shortcutNameInput, 2);
this.shortcutNameInput.Dock = System.Windows.Forms.DockStyle.Fill;
this.shortcutNameInput.Location = new System.Drawing.Point(3, 290);
this.shortcutNameInput.Name = "shortcutNameInput";
this.shortcutNameInput.Size = new System.Drawing.Size(229, 27);
this.shortcutNameInput.TabIndex = 11;
//
// tableLayoutPanel4
//
this.tableLayoutPanel4.ColumnCount = 1;
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel4.Controls.Add(this.label8, 0, 0);
this.tableLayoutPanel4.Controls.Add(this.label9, 0, 2);
this.tableLayoutPanel4.Controls.Add(this.imageSizeList, 0, 1);
this.tableLayoutPanel4.Controls.Add(this.imagesPreview, 0, 3);
this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel4.Location = new System.Drawing.Point(519, 152);
this.tableLayoutPanel4.Name = "tableLayoutPanel4";
this.tableLayoutPanel4.RowCount = 4;
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel4.Size = new System.Drawing.Size(235, 324);
this.tableLayoutPanel4.TabIndex = 4;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Dock = System.Windows.Forms.DockStyle.Fill;
this.label8.Location = new System.Drawing.Point(3, 0);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(229, 20);
this.label8.TabIndex = 0;
this.label8.Text = "Image List:";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Dock = System.Windows.Forms.DockStyle.Fill;
this.label9.Location = new System.Drawing.Point(3, 162);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(229, 20);
this.label9.TabIndex = 1;
this.label9.Text = "Preview:";
//
// imageSizeList
//
this.imageSizeList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.imageSizeList.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column1,
this.Column2});
this.imageSizeList.Dock = System.Windows.Forms.DockStyle.Fill;
this.imageSizeList.Location = new System.Drawing.Point(3, 23);
this.imageSizeList.Name = "imageSizeList";
this.imageSizeList.RowTemplate.Height = 27;
this.imageSizeList.Size = new System.Drawing.Size(229, 136);
this.imageSizeList.TabIndex = 2;
this.imageSizeList.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.imageSizeList_CellDoubleClick);
//
// Column1
//
this.Column1.HeaderText = "Size";
this.Column1.Name = "Column1";
this.Column1.Width = 50;
//
// Column2
//
this.Column2.HeaderText = "Image";
this.Column2.Name = "Column2";
//
// imagesPreview
//
this.imagesPreview.AutoScroll = true;
this.imagesPreview.Dock = System.Windows.Forms.DockStyle.Fill;
this.imagesPreview.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.imagesPreview.Location = new System.Drawing.Point(3, 185);
this.imagesPreview.Name = "imagesPreview";
this.imagesPreview.Size = new System.Drawing.Size(229, 136);
this.imagesPreview.TabIndex = 3;
//
// tableLayoutPanel5
//
this.tableLayoutPanel5.ColumnCount = 5;
this.tableLayoutPanel1.SetColumnSpan(this.tableLayoutPanel5, 5);
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 172F));
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel5.Controls.Add(this.buttonGen, 1, 1);
this.tableLayoutPanel5.Controls.Add(this.buttonCancel, 3, 1);
this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel5.Location = new System.Drawing.Point(24, 489);
this.tableLayoutPanel5.Margin = new System.Windows.Forms.Padding(0);
this.tableLayoutPanel5.Name = "tableLayoutPanel5";
this.tableLayoutPanel5.RowCount = 3;
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F));
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel5.Size = new System.Drawing.Size(733, 40);
this.tableLayoutPanel5.TabIndex = 5;
//
// buttonGen
//
this.buttonGen.Dock = System.Windows.Forms.DockStyle.Fill;
this.buttonGen.Location = new System.Drawing.Point(180, 4);
this.buttonGen.Margin = new System.Windows.Forms.Padding(0);
this.buttonGen.Name = "buttonGen";
this.buttonGen.Size = new System.Drawing.Size(100, 32);
this.buttonGen.TabIndex = 0;
this.buttonGen.Text = "Generate";
this.buttonGen.UseVisualStyleBackColor = true;
this.buttonGen.Click += new System.EventHandler(this.buttonGen_Click);
//
// buttonCancel
//
this.buttonCancel.Dock = System.Windows.Forms.DockStyle.Fill;
this.buttonCancel.Location = new System.Drawing.Point(452, 4);
this.buttonCancel.Margin = new System.Windows.Forms.Padding(0);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(100, 32);
this.buttonCancel.TabIndex = 1;
this.buttonCancel.Text = "Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
//
// ShortcutCreateForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(782, 553);
this.Controls.Add(this.tableLayoutPanel1);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Name = "ShortcutCreateForm";
this.Text = "ShortcutCreateForm";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ShortcutCreateForm_FormClosing);
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ShortcutCreateForm_FormClosed);
this.Load += new System.EventHandler(this.ShortcutCreateForm_Load);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.tableLayoutPanel2.ResumeLayout(false);
this.tableLayoutPanel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.customIconDisplay)).EndInit();
this.tableLayoutPanel3.ResumeLayout(false);
this.tableLayoutPanel3.PerformLayout();
this.tableLayoutPanel6.ResumeLayout(false);
this.tableLayoutPanel6.PerformLayout();
this.tableLayoutPanel4.ResumeLayout(false);
this.tableLayoutPanel4.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.imageSizeList)).EndInit();
this.tableLayoutPanel5.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.RadioButton iconSetGen;
private System.Windows.Forms.RadioButton iconSetFromFile;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox iconFileInput;
private System.Windows.Forms.Button iconFileBrowser;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.PictureBox customIconDisplay;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Button colorPickerButton;
private System.Windows.Forms.TextBox colorInputAndPreview;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.RadioButton ratio8_7;
private System.Windows.Forms.RadioButton ratio3_2;
private System.Windows.Forms.RadioButton ratio1_1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.RadioButton ratioCustom;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel6;
private System.Windows.Forms.TextBox ratioCustomBack;
private System.Windows.Forms.TextBox ratioCustomFore;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.DataGridView imageSizeList;
private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
private System.Windows.Forms.DataGridViewImageColumn Column2;
private System.Windows.Forms.FlowLayoutPanel imagesPreview;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5;
private System.Windows.Forms.Button buttonGen;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.TextBox shortcutNameInput;
}
}

View File

@@ -1,11 +1,571 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Bridge;
namespace Manager
{
class ShortcutCreateForm
public partial class ShortcutCreateForm: Form
{
public ShortcutCreateForm ()
{
InitializeComponent ();
Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_TITLE");
label1.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_TITLE");
label2.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_DESC");
label3.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_ICONTYPE");
iconSetGen.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_ICONTYPE_GEN");
iconSetFromFile.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_ICONTYPE_SEL");
label4.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_ICONTYPE_SEL_ICONPATH");
iconFileBrowser.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_BROWSE");
label7.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_PREVIEW");
label5.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_BACKGROUNDCOLOR");
colorPickerButton.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_SELECT");
label6.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_RATIO");
ratioCustom.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_RATIO_CUSTOM");
label10.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_RATIO_CUSTOMRATIO");
label12.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_DISPLAYNAME");
label8.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_IMAGELIST");
label9.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_PREVIEW");
buttonGen.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_GENERATE");
buttonCancel.Text = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_CANCEL");
Column1.HeaderText = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_SIZE");
Column2.HeaderText = ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_IMAGE");
_imageItems.ListChanged += ImageItems_ListChanged;
RefreshCustomRatioStatus ();
RefreshIconSourceMode ();
}
private void ImageItems_ListChanged (object sender, ListChangedEventArgs e) { RefreshImagePreview (); }
void RefreshImagePreview ()
{
imagesPreview.SuspendLayout ();
imagesPreview.Controls.Clear ();
foreach (var item in _imageItems.OrderBy (i => i.Size))
{
var display = new ImageDisplay
{
IconSize = item.Size,
ForegroundImage = item.Image,
BackgroundColor = GetCurrentBackgroundColor (),
Ratio = GetCurrentRatio ()
};
imagesPreview.Controls.Add (display);
}
imagesPreview.ResumeLayout ();
}
void UpdateRatio (decimal ratio)
{
foreach (ImageDisplay d in imagesPreview.Controls) d.Ratio = ratio;
}
void UpdateBackgroundColor (Color color)
{
foreach (ImageDisplay d in imagesPreview.Controls) d.BackgroundColor = color;
}
public Color GetCurrentBackgroundColor () => DataUtils.UITheme.StringToColor (colorInputAndPreview.Text);
public decimal GetCurrentRatio ()
{
if (ratio8_7.Checked) return (decimal)(8m / 7m);
if (ratio3_2.Checked) return 1.5m;
if (ratio1_1.Checked) return 1m;
try
{
if (ratioCustom.Checked)
{
decimal l = 0m, r = 0m;
decimal.TryParse (ratioCustomBack.Text, out l);
decimal.TryParse (ratioCustomFore.Text, out r);
return l / r;
}
} catch { }
return 0m;
}
class ImageItem
{
public int Size { get; set; }
public Image Image { get; set; }
}
private BindingList<ImageItem> _imageItems = new BindingList<ImageItem>();
Dictionary<int, string> ExtractBest (Dictionary<AppxPackage.PriResourceKey, string> source, int baseSize)
{
if (source == null || source.Count == 0) return null;
var result = new Dictionary<int, string> ();
foreach (var kv in source)
{
if (kv.Key.IsTargetSize &&
kv.Key.Contrast == AppxPackage.PriResourceKey.PriContrast.None)
{
result [kv.Key.Value] = kv.Value;
}
}
if (result.Count > 0) return result;
foreach (var kv in source)
{
if (kv.Key.IsTargetSize)
{
result [kv.Key.Value] = kv.Value;
}
}
if (result.Count > 0) return result;
foreach (var kv in source)
{
if (kv.Key.IsScale &&
kv.Key.Contrast == AppxPackage.PriResourceKey.PriContrast.None)
{
int size = (int)(kv.Key.Value * 0.01 * baseSize);
result [size] = kv.Value;
}
}
if (result.Count > 0)
return result;
foreach (var kv in source)
{
if (kv.Key.IsScale)
{
int size = (int)(kv.Key.Value * 0.01 * baseSize);
result [size] = kv.Value;
}
}
return result.Count > 0 ? result : null;
}
void InitImageList (Dictionary<int, Image> images)
{
_imageItems = new BindingList<ImageItem> (
images.Select (kv => new ImageItem
{
Size = kv.Key,
Image = kv.Value
}).ToList ()
);
imageSizeList.AutoGenerateColumns = false;
Column1.DataPropertyName = nameof (ImageItem.Size);
Column2.DataPropertyName = nameof (ImageItem.Image);
imageSizeList.DataSource = _imageItems;
}
private string installLocation = "";
private string genAppUserId = "";
private Dictionary<int, Image> _initList = new Dictionary<int, Image> ();
private void InitInfos ()
{
try
{
_initList?.Clear ();
_initList = null;
using (var m = new AppxPackage.ManifestReader (Path.Combine (installLocation, "AppxManifest.xml")))
{
m.EnablePri = false;
m.UsePri = true;
AppxPackage.MRApplication app = null;
string logo_30 = "",
smallLogo = "",
logo = "",
logo_44 = "";
foreach (var i in m.Applications)
{
if (i.UserModelID?.Trim ()?.ToLowerInvariant () == genAppUserId?.Trim ()?.ToLowerInvariant ())
{
app = i;
logo_44 = app ["Square44x44Logo"];
logo_30 = app ["Square30x30Logo"];
logo = app ["Logo"];
smallLogo = app ["SmallLogo"];
break;
}
}
m.EnablePri = true;
foreach (var i in m.Applications)
{
if (i.UserModelID?.Trim ()?.ToLowerInvariant () == genAppUserId?.Trim ()?.ToLowerInvariant ())
{
app = i;
break;
}
}
this.Invoke ((Action)(() =>
{
colorInputAndPreview.Text = app ["BackgroundColor"];
shortcutNameInput.Text = app ["DisplayName"];
if (string.IsNullOrWhiteSpace (shortcutNameInput.Text))
shortcutNameInput.Text = app ["SmallLogo"];
}));
Dictionary<AppxPackage.PriResourceKey, string> logo_30list = m.PriFile.ResourceAllValues (logo_30),
logo_smalllist = m.PriFile.ResourceAllValues (smallLogo),
logo_list = m.PriFile.ResourceAllValues (logo),
logo_44list = m.PriFile.ResourceAllValues (logo_44);
Dictionary<int, string> filteredlist = null;
filteredlist =
ExtractBest (logo_44list, 44)
?? ExtractBest (logo_30list, 30)
?? ExtractBest (logo_smalllist, 30)
?? ExtractBest (logo_list, 150);
Dictionary<int, Image> imageList = new Dictionary<int, Image> ();
foreach (var kv in filteredlist)
{
try
{
var imgPath = Path.Combine (installLocation, kv.Value);
var img = Image.FromFile (imgPath);
if (img == null) continue;
imageList [kv.Key] = img;
}
catch { }
}
_initList = imageList;
this.Invoke ((Action)(() =>
{
InitImageList (imageList);
RefreshImagePreview ();
RefreshCustomRatioStatus ();
RefreshIconSourceMode ();
}));
}
}
catch (Exception e)
{
this.Invoke ((Action)(() => _imageItems.Clear ()));
}
}
private void InitAsync ()
{
var loading = new LoadingStatusForm ();
{
loading.Show (this);
loading.Refresh ();
this.Invoke ((Action)(() => { Enabled = false; }));
Task.Factory.StartNew (() =>
{
try
{
InitInfos ();
}
catch (Exception ex)
{
Invoke ((Action)(() =>
{
MessageBox.Show ($"Initialization failed: {ex.Message}");
}));
}
finally
{
this.Invoke ((Action)(() =>
{
loading.Close ();
Enabled = true;
}));
}
});
}
}
public string InstallLocation
{
get { return installLocation; }
set { installLocation = value; InitAsync (); }
}
public string AppUserModelID
{
get { return genAppUserId; }
set { genAppUserId = value; InitAsync (); }
}
public void InitCreater (string inslocation, string appUserId)
{
installLocation = inslocation;
genAppUserId = appUserId;
InitAsync ();
}
private void ShortcutCreateForm_Load (object sender, EventArgs e)
{
}
private void ratio8_7_CheckedChanged (object sender, EventArgs e) { RefreshCustomRatioStatus (); }
private void ratio3_2_CheckedChanged (object sender, EventArgs e) { RefreshCustomRatioStatus (); }
private void ratio1_1_CheckedChanged (object sender, EventArgs e) { RefreshCustomRatioStatus (); }
private void ratioCustom_CheckedChanged (object sender, EventArgs e) { RefreshCustomRatioStatus (); }
private void RefreshCustomRatioStatus ()
{
ratioCustomBack.Enabled = ratioCustomFore.Enabled = ratioCustom.Checked;
UpdateRatio (GetCurrentRatio ());
}
private void iconSetGen_CheckedChanged (object sender, EventArgs e) { RefreshIconSourceMode (); }
private void iconSetFromFile_CheckedChanged (object sender, EventArgs e) { RefreshIconSourceMode (); }
private void RefreshIconSourceMode ()
{
iconFileInput.Enabled = iconFileBrowser.Enabled = iconSetFromFile.Checked;
colorInputAndPreview.Enabled = colorPickerButton.Enabled =
ratio8_7.Enabled = ratio3_2.Enabled = ratio1_1.Enabled =
ratioCustom.Enabled = ratioCustomBack.Enabled = ratioCustomFore.Enabled =
iconSetGen.Checked;
if (iconSetGen.Checked)
{
RefreshCustomRatioStatus ();
}
if (iconSetFromFile.Checked)
{
try
{
customIconDisplay.Image = new Icon (iconFileInput.Text)?.ToBitmap ();
}
catch
{
customIconDisplay.Image = null;
}
}
else customIconDisplay.Image = null;
}
private void colorInputAndPreview_TextChanged (object sender, EventArgs e)
{
try
{
Color nowColor = DataUtils.UITheme.StringToColor (colorInputAndPreview.Text);
double luminance = nowColor.R * 0.299 + nowColor.G * 0.587 + nowColor.B * 0.114;
Color foreground = luminance < 128 ? Color.White : Color.Black;
colorInputAndPreview.BackColor = nowColor;
colorInputAndPreview.ForeColor = foreground;
UpdateBackgroundColor (nowColor);
}
catch { }
}
private Bitmap GenerateIconBitmap (int size, Image foreground, Color background, decimal ratio)
{
var bmp = new Bitmap (size, size);
using (var g = Graphics.FromImage (bmp))
{
g.Clear (background);
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
float foreSize = (float)(size / ratio);
float x = (size - foreSize) / 2f;
float y = (size - foreSize) / 2f;
var destRect = new RectangleF (x, y, foreSize, foreSize);
g.DrawImage (foreground, destRect);
}
return bmp;
}
Dictionary<int, Image> GenerateAllIconImages ()
{
var result = new Dictionary<int, Image> ();
Color bg = GetCurrentBackgroundColor ();
decimal ratio = GetCurrentRatio ();
foreach (var item in _imageItems)
{
var bmp = GenerateIconBitmap (item.Size, item.Image, bg, ratio);
result [item.Size] = bmp;
}
return result;
}
public static void SaveAsIcon (Dictionary<int, Image> images, string filePath)
{
using (var fs = new FileStream (filePath, FileMode.Create))
using (var bw = new BinaryWriter (fs))
{
bw.Write ((short)0); // reserved
bw.Write ((short)1); // type = icon
bw.Write ((short)images.Count);
int offset = 6 + (16 * images.Count);
var imageData = new List<byte []> ();
foreach (var kv in images.OrderBy (i => i.Key))
{
using (var ms = new MemoryStream ())
{
kv.Value.Save (ms, System.Drawing.Imaging.ImageFormat.Png);
byte [] data = ms.ToArray ();
imageData.Add (data);
bw.Write ((byte)(kv.Key >= 256 ? 0 : kv.Key)); // width
bw.Write ((byte)(kv.Key >= 256 ? 0 : kv.Key)); // height
bw.Write ((byte)0); // color count
bw.Write ((byte)0); // reserved
bw.Write ((short)1); // planes
bw.Write ((short)32); // bit count
bw.Write (data.Length);
bw.Write (offset);
offset += data.Length;
}
}
foreach (var data in imageData) bw.Write (data);
}
}
private void iconFileInput_TextChanged (object sender, EventArgs e)
{
try
{
customIconDisplay.Image = new Icon (iconFileInput.Text)?.ToBitmap ();
}
catch
{
customIconDisplay.Image = null;
}
}
private void imageSizeList_CellDoubleClick (object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex < 0) return;
if (imageSizeList.Columns [e.ColumnIndex] != Column2) return;
var item = _imageItems [e.RowIndex];
var isf = new ImageSetForm ();
isf.CurrentSize = item.Size;
isf.DefaultImages = _initList;
isf.FinalImage = item.Image;
isf.ShowDialog (this);
var newimg = isf.FinalImage;
if (newimg != null)
{
item.Image = newimg;
RefreshImagePreview ();
}
}
public bool IsSuccess { get; private set; } = false;
public string Message { get; private set; } = "";
private void buttonCancel_Click (object sender, EventArgs e)
{
IsSuccess = false;
Message = "User canceled.";
this.Close ();
}
private void ShortcutCreateForm_FormClosed (object sender, FormClosedEventArgs e)
{
_imageItems?.Clear ();
_imageItems = null;
_initList?.Clear ();
_initList = null;
}
public static bool IsValidFileName (string fileName, bool requireExtension = true)
{
if (string.IsNullOrWhiteSpace (fileName)) return false;
if (fileName.IndexOfAny (Path.GetInvalidFileNameChars ()) >= 0) return false;
if (fileName.EndsWith (" ") || fileName.EndsWith (".")) return false;
if (requireExtension)
{
if (!Path.HasExtension (fileName)) return false;
string ext = Path.GetExtension (fileName);
if (string.IsNullOrWhiteSpace (ext) || ext == ".") return false;
}
string nameWithoutExtension = Path.GetFileNameWithoutExtension (fileName);
string [] reservedNames =
{
"CON", "PRN", "AUX", "NUL",
"COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9",
"LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"
};
if (reservedNames.Contains (nameWithoutExtension.ToUpper ())) return false;
if (fileName.Length > 255) return false;
return true;
}
private void buttonGen_Click (object sender, EventArgs e)
{
try
{
if (!IsValidFileName (shortcutNameInput.Text, false))
{
MessageBox.Show (this, "Invalid shortcut name.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
var iconfilename = "";
var iconfilepath = "";
if (iconSetGen.Checked)
{
iconfilename = genAppUserId.Replace ('!', '-') + ".ico";
iconfilepath = Path.Combine (AppDomain.CurrentDomain.BaseDirectory, "icons", iconfilename);
if (File.Exists (iconfilepath))
{
#region gen twice;
var dlgres = MessageBox.Show (
this,
ResXmlStore.StringRes.Get ("MANAGER_APP_SHORTCUTCREATE_ASK_ICONEXISTS"),
"Ask",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question
);
if (dlgres == DialogResult.Yes)
{
try
{
iconfilename = genAppUserId.Replace ('!', '-') + "-" + DateTime.Now.GetHashCode () + ".ico";
iconfilepath = Path.Combine (AppDomain.CurrentDomain.BaseDirectory, "icons", iconfilename);
var icons = GenerateAllIconImages ();
SaveAsIcon (icons, iconfilepath);
}
catch (Exception ex)
{
MessageBox.Show (this, "Cannot create icon, we will fallback. Message: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
iconfilename = genAppUserId.Replace ('!', '-') + ".ico";
iconfilepath = Path.Combine (AppDomain.CurrentDomain.BaseDirectory, "icons", iconfilename);
}
}
#endregion
}
else
{
var icons = GenerateAllIconImages ();
SaveAsIcon (icons, iconfilepath);
}
}
else
{
iconfilepath = iconFileInput.Text;
}
var shortcutname = shortcutNameInput.Text + ".lnk";
var shortcutpath = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Desktop), shortcutname);
ShortcutHelper.CreateShortcut (
shortcutpath,
Path.Combine (AppDomain.CurrentDomain.BaseDirectory, "Launch.exe"),
genAppUserId,
null,
iconfilepath,
shortcutNameInput.Text,
genAppUserId
);
IsSuccess = true;
Message = "";
this.Close ();
}
catch (Exception ex)
{
IsSuccess = false;
Message = ex.Message;
this.Close ();
}
}
private void ShortcutCreateForm_FormClosing (object sender, FormClosingEventArgs e)
{
if (!IsSuccess && string.IsNullOrWhiteSpace (Message))
{
IsSuccess = false;
Message = "User canceled.";
}
}
private void colorPickerButton_Click (object sender, EventArgs e)
{
using (var colorpicker = new ColorDialog ())
{
colorpicker.Color = GetCurrentBackgroundColor ();
var dlgres = colorpicker.ShowDialog (this);
if (dlgres == DialogResult.OK)
{
colorInputAndPreview.Text = DataUtils.UITheme.ColorToHtml (colorpicker.Color);
}
}
}
private void iconFileBrowser_Click (object sender, EventArgs e)
{
using (OpenFileDialog dlg = new OpenFileDialog ())
{
dlg.Title = "Please select the icon file:";
dlg.Filter = "Icon File (*.ico)|*.ico";
dlg.CheckFileExists = true;
dlg.CheckPathExists = true;
dlg.Multiselect = false;
dlg.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory;
if (dlg.ShowDialog () == DialogResult.OK)
{
iconFileInput.Text = dlg.FileName;
}
}
}
}
}

View File

@@ -0,0 +1,135 @@
<?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>
<data name="label2.Text" xml:space="preserve">
<value>A shortcut to the Windows Store app will be created on the desktop as the entry point for launching the app. Due to limitations in Windows 8.x, this will be achieved through launching the program (using parameters); please do not pin it to the Start Menu.</value>
</data>
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

155
Manager/ShortcutHelper.cs Normal file
View File

@@ -0,0 +1,155 @@
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace Manager
{
public static class ShortcutHelper
{
public static void CreateShortcut (
string shortcutPath,
string targetPath,
string arguments,
string workingDirectory,
string iconPath,
string description,
string appUserModelID)
{
IShellLinkW link = (IShellLinkW)new CShellLink ();
link.SetPath (targetPath);
if (!string.IsNullOrEmpty (arguments))
link.SetArguments (arguments);
if (!string.IsNullOrEmpty (workingDirectory))
link.SetWorkingDirectory (workingDirectory);
if (!string.IsNullOrEmpty (description))
link.SetDescription (description);
if (!string.IsNullOrEmpty (iconPath))
link.SetIconLocation (iconPath, 0);
if (!string.IsNullOrEmpty (appUserModelID))
{
IPropertyStore propertyStore = (IPropertyStore)link;
PROPERTYKEY key = PROPERTYKEY.AppUserModel_ID;
using (PropVariant pv = new PropVariant (appUserModelID))
{
propertyStore.SetValue (ref key, pv);
propertyStore.Commit ();
}
}
IPersistFile file = (IPersistFile)link;
file.Save (shortcutPath, false);
Marshal.ReleaseComObject (link);
}
#region COM
[ComImport]
[Guid ("00021401-0000-0000-C000-000000000046")]
internal class CShellLink
{
}
[ComImport]
[InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
[Guid ("000214F9-0000-0000-C000-000000000046")]
internal interface IShellLinkW
{
void GetPath ([Out, MarshalAs (UnmanagedType.LPWStr)] StringBuilder pszFile, int cchMaxPath, IntPtr pfd, int fFlags);
void GetIDList (out IntPtr ppidl);
void SetIDList (IntPtr pidl);
void GetDescription ([Out, MarshalAs (UnmanagedType.LPWStr)] StringBuilder pszName, int cchMaxName);
void SetDescription ([MarshalAs (UnmanagedType.LPWStr)] string pszName);
void GetWorkingDirectory ([Out, MarshalAs (UnmanagedType.LPWStr)] StringBuilder pszDir, int cchMaxPath);
void SetWorkingDirectory ([MarshalAs (UnmanagedType.LPWStr)] string pszDir);
void GetArguments ([Out, MarshalAs (UnmanagedType.LPWStr)] StringBuilder pszArgs, int cchMaxPath);
void SetArguments ([MarshalAs (UnmanagedType.LPWStr)] string pszArgs);
void GetHotkey (out short pwHotkey);
void SetHotkey (short wHotkey);
void GetShowCmd (out int piShowCmd);
void SetShowCmd (int iShowCmd);
void GetIconLocation ([Out, MarshalAs (UnmanagedType.LPWStr)] StringBuilder pszIconPath, int cchIconPath, out int piIcon);
void SetIconLocation ([MarshalAs (UnmanagedType.LPWStr)] string pszIconPath, int iIcon);
void SetRelativePath ([MarshalAs (UnmanagedType.LPWStr)] string pszPathRel, int dwReserved);
void Resolve (IntPtr hwnd, int fFlags);
void SetPath ([MarshalAs (UnmanagedType.LPWStr)] string pszFile);
}
[ComImport]
[InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
[Guid ("0000010b-0000-0000-C000-000000000046")]
internal interface IPersistFile
{
void GetClassID (out Guid pClassID);
void IsDirty ();
void Load ([MarshalAs (UnmanagedType.LPWStr)] string pszFileName, uint dwMode);
void Save ([MarshalAs (UnmanagedType.LPWStr)] string pszFileName, bool fRemember);
void SaveCompleted ([MarshalAs (UnmanagedType.LPWStr)] string pszFileName);
void GetCurFile ([MarshalAs (UnmanagedType.LPWStr)] out string ppszFileName);
}
[ComImport]
[InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
[Guid ("886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99")]
internal interface IPropertyStore
{
uint GetCount (out uint cProps);
uint GetAt (uint iProp, out PROPERTYKEY pkey);
uint GetValue (ref PROPERTYKEY key, out PropVariant pv);
uint SetValue (ref PROPERTYKEY key, PropVariant pv);
uint Commit ();
}
[StructLayout (LayoutKind.Sequential, Pack = 4)]
internal struct PROPERTYKEY
{
public Guid fmtid;
public uint pid;
public static PROPERTYKEY AppUserModel_ID =
new PROPERTYKEY
{
fmtid = new Guid ("9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3"),
pid = 5
};
}
[StructLayout (LayoutKind.Sequential)]
internal sealed class PropVariant: IDisposable
{
short vt;
short wReserved1;
short wReserved2;
short wReserved3;
IntPtr ptr;
int int32;
private const short VT_LPWSTR = 31;
public PropVariant (string value)
{
vt = VT_LPWSTR;
ptr = Marshal.StringToCoTaskMemUni (value);
}
public void Dispose ()
{
if (ptr != IntPtr.Zero)
{
Marshal.FreeCoTaskMem (ptr);
ptr = IntPtr.Zero;
}
}
}
#endregion
}
}

4
Manager/packages.config Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net40" />
</packages>