mirror of
https://github.com/modernw/App-Installer-For-Windows-8.x-Reset.git
synced 2026-04-11 17:57:19 +10:00
Update about Manager.
This commit is contained in:
@@ -857,6 +857,7 @@ namespace AppxPackage
|
|||||||
private bool m_usePRI = false;
|
private bool m_usePRI = false;
|
||||||
private bool m_enablePRI = false;
|
private bool m_enablePRI = false;
|
||||||
private PriReader m_pri = null;
|
private PriReader m_pri = null;
|
||||||
|
public PriReader PriFile => m_pri;
|
||||||
public IntPtr Instance => m_hReader;
|
public IntPtr Instance => m_hReader;
|
||||||
public string FileRoot{ get { return Path.GetDirectoryName (m_filePath); } }
|
public string FileRoot{ get { return Path.GetDirectoryName (m_filePath); } }
|
||||||
private void InitPri ()
|
private void InitPri ()
|
||||||
|
|||||||
@@ -66,6 +66,108 @@ namespace AppxPackage
|
|||||||
PriFormatFreeString (ptr); // 如果 DLL 返回的内存要求 free
|
PriFormatFreeString (ptr); // 如果 DLL 返回的内存要求 free
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
[StructLayout (LayoutKind.Sequential)]
|
||||||
|
internal struct DWORDWSTRPAIR
|
||||||
|
{
|
||||||
|
public uint dwKey;
|
||||||
|
public IntPtr lpValue; // LPWSTR
|
||||||
|
}
|
||||||
|
[StructLayout (LayoutKind.Sequential)]
|
||||||
|
internal struct DWSPAIRLIST
|
||||||
|
{
|
||||||
|
public uint dwLength;
|
||||||
|
public DWORDWSTRPAIR lpArray; // 第一个元素(柔性数组起点)
|
||||||
|
}
|
||||||
|
[StructLayout (LayoutKind.Sequential)]
|
||||||
|
internal struct WSDSPAIR
|
||||||
|
{
|
||||||
|
public IntPtr lpKey; // LPWSTR
|
||||||
|
public IntPtr lpValue; // HDWSPAIRLIST
|
||||||
|
}
|
||||||
|
[StructLayout (LayoutKind.Sequential)]
|
||||||
|
internal struct WSDSPAIRLIST
|
||||||
|
{
|
||||||
|
public uint dwLength;
|
||||||
|
public WSDSPAIR lpArray; // 第一个元素
|
||||||
|
}
|
||||||
|
[DllImport (DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern IntPtr GetPriResourceAllValueList (PCSPRIFILE pFilePri, [MarshalAs (UnmanagedType.LPWStr)] string resName);
|
||||||
|
[DllImport (DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void DestroyPriResourceAllValueList (IntPtr list);
|
||||||
|
[DllImport (DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern IntPtr GetPriResourcesAllValuesList (PCSPRIFILE pFilePri, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)] string [] lpResNames, uint dwCount);
|
||||||
|
[DllImport (DLL, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void DestroyResourcesAllValuesList (IntPtr list);
|
||||||
|
public static Dictionary<uint, string> ParseDWSPAIRLIST (IntPtr ptr)
|
||||||
|
{
|
||||||
|
if (ptr == IntPtr.Zero)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var result = new Dictionary<uint, string> ();
|
||||||
|
|
||||||
|
// 读取数量
|
||||||
|
uint count = (uint)Marshal.ReadInt32 (ptr);
|
||||||
|
|
||||||
|
// 跳过 dwLength
|
||||||
|
IntPtr pFirst = IntPtr.Add (ptr, sizeof (uint));
|
||||||
|
|
||||||
|
int elementSize = Marshal.SizeOf (typeof (DWORDWSTRPAIR));
|
||||||
|
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
IntPtr pItem = IntPtr.Add (pFirst, i * elementSize);
|
||||||
|
|
||||||
|
object boxed =
|
||||||
|
Marshal.PtrToStructure (pItem, typeof (DWORDWSTRPAIR));
|
||||||
|
|
||||||
|
DWORDWSTRPAIR item = (DWORDWSTRPAIR)boxed;
|
||||||
|
|
||||||
|
string value = null;
|
||||||
|
|
||||||
|
if (item.lpValue != IntPtr.Zero)
|
||||||
|
value = Marshal.PtrToStringUni (item.lpValue);
|
||||||
|
|
||||||
|
result [item.dwKey] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
public static Dictionary<string, Dictionary<uint, string>> ParseWSDSPAIRLIST (IntPtr ptr)
|
||||||
|
{
|
||||||
|
if (ptr == IntPtr.Zero)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var result =
|
||||||
|
new Dictionary<string, Dictionary<uint, string>> ();
|
||||||
|
|
||||||
|
uint count = (uint)Marshal.ReadInt32 (ptr);
|
||||||
|
|
||||||
|
IntPtr pFirst = IntPtr.Add (ptr, sizeof (uint));
|
||||||
|
|
||||||
|
int elementSize = Marshal.SizeOf (typeof (WSDSPAIR));
|
||||||
|
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
IntPtr pItem = IntPtr.Add (pFirst, i * elementSize);
|
||||||
|
|
||||||
|
object boxed =
|
||||||
|
Marshal.PtrToStructure (pItem, typeof (WSDSPAIR));
|
||||||
|
|
||||||
|
WSDSPAIR item = (WSDSPAIR)boxed;
|
||||||
|
|
||||||
|
string key = null;
|
||||||
|
|
||||||
|
if (item.lpKey != IntPtr.Zero)
|
||||||
|
key = Marshal.PtrToStringUni (item.lpKey);
|
||||||
|
|
||||||
|
Dictionary<uint, string> valueDict =
|
||||||
|
ParseDWSPAIRLIST (item.lpValue);
|
||||||
|
|
||||||
|
result [key] = valueDict;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public static class LpcwstrListHelper
|
public static class LpcwstrListHelper
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,6 +9,51 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace AppxPackage
|
namespace AppxPackage
|
||||||
{
|
{
|
||||||
|
public struct PriResourceKey
|
||||||
|
{
|
||||||
|
public enum PriResourceType: byte
|
||||||
|
{
|
||||||
|
Scale = 0,
|
||||||
|
TargetSize = 1,
|
||||||
|
String = 2
|
||||||
|
}
|
||||||
|
public enum PriContrast: byte
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
White = 1,
|
||||||
|
Black = 2,
|
||||||
|
High = 3,
|
||||||
|
Low = 4
|
||||||
|
}
|
||||||
|
public readonly PriResourceType Type;
|
||||||
|
public readonly PriContrast Contrast;
|
||||||
|
public readonly ushort Value;
|
||||||
|
public uint Raw { get; }
|
||||||
|
public PriResourceKey (uint raw)
|
||||||
|
{
|
||||||
|
Raw = raw;
|
||||||
|
Type = (PriResourceType)((raw >> 28) & 0xF);
|
||||||
|
Contrast = (PriContrast)((raw >> 24) & 0xF);
|
||||||
|
Value = (ushort)(raw & 0xFFFF);
|
||||||
|
}
|
||||||
|
public bool IsScale => Type == PriResourceType.Scale;
|
||||||
|
public bool IsTargetSize => Type == PriResourceType.TargetSize;
|
||||||
|
public bool IsString => Type == PriResourceType.String;
|
||||||
|
public override string ToString ()
|
||||||
|
{
|
||||||
|
switch (Type)
|
||||||
|
{
|
||||||
|
case PriResourceType.Scale:
|
||||||
|
return $"Scale={Value}, Contrast={Contrast}";
|
||||||
|
case PriResourceType.TargetSize:
|
||||||
|
return $"TargetSize={Value}, Contrast={Contrast}";
|
||||||
|
case PriResourceType.String:
|
||||||
|
return $"LCID=0x{Value:X4}";
|
||||||
|
default:
|
||||||
|
return $"Unknown(0x{Raw:X8})";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
public class PriReader: IDisposable
|
public class PriReader: IDisposable
|
||||||
{
|
{
|
||||||
private IntPtr m_hPriFile = IntPtr.Zero;
|
private IntPtr m_hPriFile = IntPtr.Zero;
|
||||||
@@ -60,7 +105,7 @@ namespace AppxPackage
|
|||||||
public PriReader (IntPtr pStream) { Create (pStream); }
|
public PriReader (IntPtr pStream) { Create (pStream); }
|
||||||
public PriReader ([MarshalAs (UnmanagedType.LPWStr)] string fileName) { Create (fileName); }
|
public PriReader ([MarshalAs (UnmanagedType.LPWStr)] string fileName) { Create (fileName); }
|
||||||
public PriReader () { }
|
public PriReader () { }
|
||||||
public void AddSearch (IEnumerable <string> arr)
|
public void AddSearch (IEnumerable<string> arr)
|
||||||
{
|
{
|
||||||
IntPtr buf = IntPtr.Zero;
|
IntPtr buf = IntPtr.Zero;
|
||||||
try
|
try
|
||||||
@@ -102,9 +147,98 @@ namespace AppxPackage
|
|||||||
}
|
}
|
||||||
public static string LastError { get { return PriFileHelper.PriFileGetLastError (); } }
|
public static string LastError { get { return PriFileHelper.PriFileGetLastError (); } }
|
||||||
public string Path (string resName) { return Resource (resName); }
|
public string Path (string resName) { return Resource (resName); }
|
||||||
public Dictionary <string, string> Paths (IEnumerable <string> resNames) { return Resources (resNames); }
|
public Dictionary<string, string> Paths (IEnumerable<string> resNames) { return Resources (resNames); }
|
||||||
public string String (string resName) { return Resource (resName); }
|
public string String (string resName) { return Resource (resName); }
|
||||||
public Dictionary <string, string> Strings (IEnumerable <string> resNames) { return Resources (resNames); }
|
public Dictionary<string, string> Strings (IEnumerable<string> resNames) { return Resources (resNames); }
|
||||||
|
public Dictionary<PriResourceKey, string> ResourceAllValues (string resName)
|
||||||
|
{
|
||||||
|
var task = Task.Factory.StartNew (() => {
|
||||||
|
IntPtr ptr = IntPtr.Zero;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ptr = PriFileHelper.GetPriResourceAllValueList (
|
||||||
|
m_hPriFile, resName);
|
||||||
|
|
||||||
|
if (ptr == IntPtr.Zero)
|
||||||
|
return new Dictionary<PriResourceKey, string> ();
|
||||||
|
|
||||||
|
var raw =
|
||||||
|
PriFileHelper.ParseDWSPAIRLIST (ptr);
|
||||||
|
|
||||||
|
var result =
|
||||||
|
new Dictionary<PriResourceKey, string> ();
|
||||||
|
|
||||||
|
foreach (var kv in raw)
|
||||||
|
{
|
||||||
|
var key = new PriResourceKey (kv.Key);
|
||||||
|
result [key] = kv.Value;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (ptr != IntPtr.Zero) PriFileHelper.DestroyPriResourceAllValueList (ptr);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return task.Result;
|
||||||
|
}
|
||||||
|
public Dictionary<string, Dictionary<PriResourceKey, string>> ResourcesAllValues (IEnumerable<string> resNames)
|
||||||
|
{
|
||||||
|
var task = Task.Factory.StartNew (() => {
|
||||||
|
IntPtr ptr = IntPtr.Zero;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var list = resNames?.ToList ();
|
||||||
|
|
||||||
|
if (list == null || list.Count == 0)
|
||||||
|
return new Dictionary<string,
|
||||||
|
Dictionary<PriResourceKey, string>> ();
|
||||||
|
|
||||||
|
ptr = PriFileHelper.GetPriResourcesAllValuesList (
|
||||||
|
m_hPriFile,
|
||||||
|
list.ToArray (),
|
||||||
|
(uint)list.Count);
|
||||||
|
|
||||||
|
if (ptr == IntPtr.Zero)
|
||||||
|
return new Dictionary<string,
|
||||||
|
Dictionary<PriResourceKey, string>> ();
|
||||||
|
|
||||||
|
var raw =
|
||||||
|
PriFileHelper.ParseWSDSPAIRLIST (ptr);
|
||||||
|
|
||||||
|
var result =
|
||||||
|
new Dictionary<string,
|
||||||
|
Dictionary<PriResourceKey, string>> ();
|
||||||
|
|
||||||
|
foreach (var outer in raw)
|
||||||
|
{
|
||||||
|
var innerDict =
|
||||||
|
new Dictionary<PriResourceKey, string> ();
|
||||||
|
|
||||||
|
foreach (var inner in outer.Value)
|
||||||
|
{
|
||||||
|
var key =
|
||||||
|
new PriResourceKey (inner.Key);
|
||||||
|
|
||||||
|
innerDict [key] = inner.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
result [outer.Key] = innerDict;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (ptr != IntPtr.Zero)
|
||||||
|
PriFileHelper.DestroyResourcesAllValuesList (ptr);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return task.Result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public class PriReaderBundle: IDisposable
|
public class PriReaderBundle: IDisposable
|
||||||
{
|
{
|
||||||
@@ -246,6 +380,7 @@ namespace AppxPackage
|
|||||||
{
|
{
|
||||||
return Resources (resNames);
|
return Resources (resNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose ()
|
public void Dispose ()
|
||||||
{
|
{
|
||||||
foreach (PriInst it in _priFiles) it.Reader.Dispose ();
|
foreach (PriInst it in _priFiles) it.Reader.Dispose ();
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using Win32;
|
using Win32;
|
||||||
using DataUtils;
|
using DataUtils;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Drawing;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using AppxPackage;
|
using AppxPackage;
|
||||||
using ModernNotice;
|
using ModernNotice;
|
||||||
@@ -898,6 +894,7 @@ namespace Bridge
|
|||||||
public _I_Taskbar Taskbar { get; private set; } = null;
|
public _I_Taskbar Taskbar { get; private set; } = null;
|
||||||
public _I_System System => system;
|
public _I_System System => system;
|
||||||
public _I_Notice Notice => new _I_Notice ();
|
public _I_Notice Notice => new _I_Notice ();
|
||||||
|
public _I_Process Process => proc;
|
||||||
public string CmdArgs
|
public string CmdArgs
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|||||||
@@ -230,6 +230,7 @@ namespace DataUtils
|
|||||||
|
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
public string GetString (string id) => Get (id);
|
||||||
|
|
||||||
public string this [string id]
|
public string this [string id]
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace DataUtils
|
namespace DataUtils
|
||||||
{
|
{
|
||||||
@@ -257,6 +262,28 @@ namespace DataUtils
|
|||||||
string b = Utilities.NormalizeFullPath (r);
|
string b = Utilities.NormalizeFullPath (r);
|
||||||
return string.Equals (a, b, StringComparison.OrdinalIgnoreCase);
|
return string.Equals (a, b, StringComparison.OrdinalIgnoreCase);
|
||||||
}
|
}
|
||||||
|
public bool Open (string path)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty (path)) return false;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (File.Exists (path))
|
||||||
|
{
|
||||||
|
Process.Start (path);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Directory.Exists (path))
|
||||||
|
{
|
||||||
|
Process.Start ("explorer.exe", path);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Basic entry object
|
// Basic entry object
|
||||||
[ComVisible (true)]
|
[ComVisible (true)]
|
||||||
@@ -476,13 +503,183 @@ namespace DataUtils
|
|||||||
}
|
}
|
||||||
[ComVisible (true)]
|
[ComVisible (true)]
|
||||||
[ClassInterface (ClassInterfaceType.AutoDual)]
|
[ClassInterface (ClassInterfaceType.AutoDual)]
|
||||||
|
public class _I_Explorer
|
||||||
|
{
|
||||||
|
[DllImport ("user32.dll")]
|
||||||
|
private static extern IntPtr GetForegroundWindow ();
|
||||||
|
class WindowWrapper: IWin32Window
|
||||||
|
{
|
||||||
|
private IntPtr _hwnd;
|
||||||
|
public WindowWrapper (IntPtr handle) { _hwnd = handle; }
|
||||||
|
public IntPtr Handle { get { return _hwnd; } }
|
||||||
|
}
|
||||||
|
private static IWin32Window GetActiveWindowOwner ()
|
||||||
|
{
|
||||||
|
IntPtr hWnd = GetForegroundWindow ();
|
||||||
|
return hWnd != IntPtr.Zero ? new WindowWrapper (hWnd) : null;
|
||||||
|
}
|
||||||
|
private static void CallJS (object jsFunc, params object [] args)
|
||||||
|
{
|
||||||
|
if (jsFunc == null) return;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
object [] realArgs = new object [args.Length + 1];
|
||||||
|
realArgs [0] = jsFunc; // thisArg
|
||||||
|
Array.Copy (args, 0, realArgs, 1, args.Length);
|
||||||
|
jsFunc.GetType ().InvokeMember (
|
||||||
|
"call",
|
||||||
|
System.Reflection.BindingFlags.InvokeMethod,
|
||||||
|
null,
|
||||||
|
jsFunc,
|
||||||
|
realArgs
|
||||||
|
);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
public void File (string filter, string initDir, object jsCallback)
|
||||||
|
{
|
||||||
|
IWin32Window owner = GetActiveWindowOwner ();
|
||||||
|
Thread t = new Thread (() =>
|
||||||
|
{
|
||||||
|
string result = string.Empty;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (OpenFileDialog dlg = new OpenFileDialog ())
|
||||||
|
{
|
||||||
|
dlg.Filter = filter;
|
||||||
|
dlg.InitialDirectory = string.IsNullOrEmpty (initDir)
|
||||||
|
? Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments)
|
||||||
|
: initDir;
|
||||||
|
dlg.Multiselect = false;
|
||||||
|
if (dlg.ShowDialog (owner) == DialogResult.OK)
|
||||||
|
result = dlg.FileName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
CallJS (jsCallback, result);
|
||||||
|
});
|
||||||
|
t.IsBackground = true;
|
||||||
|
t.SetApartmentState (ApartmentState.STA);
|
||||||
|
t.Start ();
|
||||||
|
}
|
||||||
|
public void Files (string filter, string initDir, object jsCallback)
|
||||||
|
{
|
||||||
|
IWin32Window owner = GetActiveWindowOwner ();
|
||||||
|
Thread t = new Thread (() =>
|
||||||
|
{
|
||||||
|
string result = "[]";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (OpenFileDialog dlg = new OpenFileDialog ())
|
||||||
|
{
|
||||||
|
dlg.Filter = filter;
|
||||||
|
dlg.InitialDirectory = string.IsNullOrEmpty (initDir)
|
||||||
|
? Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments)
|
||||||
|
: initDir;
|
||||||
|
dlg.Multiselect = true;
|
||||||
|
if (dlg.ShowDialog (owner) == DialogResult.OK)
|
||||||
|
result = Newtonsoft.Json.JsonConvert.SerializeObject (dlg.FileNames);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
CallJS (jsCallback, result);
|
||||||
|
});
|
||||||
|
t.IsBackground = true;
|
||||||
|
t.SetApartmentState (ApartmentState.STA);
|
||||||
|
t.Start ();
|
||||||
|
}
|
||||||
|
public void Dir (string initDir, object jsCallback)
|
||||||
|
{
|
||||||
|
IWin32Window owner = GetActiveWindowOwner ();
|
||||||
|
Thread t = new Thread (() =>
|
||||||
|
{
|
||||||
|
string result = string.Empty;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (FolderBrowserDialog dlg = new FolderBrowserDialog ())
|
||||||
|
{
|
||||||
|
dlg.SelectedPath = string.IsNullOrEmpty (initDir)
|
||||||
|
? Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments)
|
||||||
|
: initDir;
|
||||||
|
if (dlg.ShowDialog (owner) == DialogResult.OK)
|
||||||
|
result = dlg.SelectedPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
|
CallJS (jsCallback, result);
|
||||||
|
});
|
||||||
|
t.IsBackground = true;
|
||||||
|
t.SetApartmentState (ApartmentState.STA);
|
||||||
|
t.Start ();
|
||||||
|
}
|
||||||
|
public void Dirs (string initDir, object jsCallback)
|
||||||
|
{
|
||||||
|
IWin32Window owner = GetActiveWindowOwner ();
|
||||||
|
Thread t = new Thread (() =>
|
||||||
|
{
|
||||||
|
string result = "[]";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (var dlg = new OpenFileDialog ())
|
||||||
|
{
|
||||||
|
// trick: 多选文件夹
|
||||||
|
dlg.ValidateNames = false;
|
||||||
|
dlg.CheckFileExists = false;
|
||||||
|
dlg.CheckPathExists = true;
|
||||||
|
dlg.FileName = "SelectFolder";
|
||||||
|
dlg.InitialDirectory = string.IsNullOrEmpty (initDir)
|
||||||
|
? Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments)
|
||||||
|
: initDir;
|
||||||
|
dlg.Multiselect = true;
|
||||||
|
if (dlg.ShowDialog (owner) == DialogResult.OK)
|
||||||
|
{
|
||||||
|
var dirs = dlg.FileNames.Select (f => Path.GetDirectoryName (f)).Distinct ().ToArray ();
|
||||||
|
result = Newtonsoft.Json.JsonConvert.SerializeObject (dirs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
CallJS (jsCallback, result);
|
||||||
|
});
|
||||||
|
t.IsBackground = true;
|
||||||
|
t.SetApartmentState (ApartmentState.STA);
|
||||||
|
t.Start ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
[ComVisible (true)]
|
||||||
|
[ClassInterface (ClassInterfaceType.AutoDual)]
|
||||||
public class _I_Storage
|
public class _I_Storage
|
||||||
{
|
{
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
protected _I_Path path = new _I_Path ();
|
protected _I_Path path = new _I_Path ();
|
||||||
public _I_Path Path { get { return path; } }
|
public _I_Path Path { get { return path; } }
|
||||||
public _I_File GetFile (string path) { return new _I_File (path); }
|
public _I_File GetFile (string path) { return new _I_File (path); }
|
||||||
public _I_Directory GetDirectory (string path) { return new _I_Directory (path); }
|
public _I_Directory GetDirectory (string path) { return new _I_Directory (path); }
|
||||||
public _I_Directory GetDir (string path) { return GetDirectory (path); }
|
public _I_Directory GetDir (string path) { return GetDirectory (path); }
|
||||||
|
public _I_Explorer Explorer => new _I_Explorer ();
|
||||||
}
|
}
|
||||||
// Small shell helpers that P/Invoke for folder retrieval using CSIDL or Known Folder GUIDs
|
// Small shell helpers that P/Invoke for folder retrieval using CSIDL or Known Folder GUIDs
|
||||||
internal static class ShellHelpers
|
internal static class ShellHelpers
|
||||||
|
|||||||
Binary file not shown.
@@ -23,7 +23,7 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>..\Release\</OutputPath>
|
<OutputPath>..\Release\</OutputPath>
|
||||||
|
|||||||
85
Manager/BridgeExt.cs
Normal file
85
Manager/BridgeExt.cs
Normal 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
2
Manager/ClassDiagram1.cd
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ClassDiagram />
|
||||||
126
Manager/ImageDisplay.Designer.cs
generated
Normal file
126
Manager/ImageDisplay.Designer.cs
generated
Normal 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
69
Manager/ImageDisplay.cs
Normal 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
129
Manager/ImageDisplay.resx
Normal 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
323
Manager/ImageSetForm.Designer.cs
generated
Normal 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
178
Manager/ImageSetForm.cs
Normal 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
129
Manager/ImageSetForm.resx
Normal 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
89
Manager/LoadingStatusForm.Designer.cs
generated
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
19
Manager/LoadingStatusForm.cs
Normal file
19
Manager/LoadingStatusForm.cs
Normal 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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
Manager/LoadingStatusForm.resx
Normal file
120
Manager/LoadingStatusForm.resx
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
@@ -53,8 +53,13 @@
|
|||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<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" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.DirectoryServices" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
@@ -65,6 +70,25 @@
|
|||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<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">
|
<Compile Include="ManagerShell.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -74,7 +98,22 @@
|
|||||||
<Compile Include="Polyfill.cs" />
|
<Compile Include="Polyfill.cs" />
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.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">
|
<EmbeddedResource Include="ManagerShell.resx">
|
||||||
<DependentUpon>ManagerShell.cs</DependentUpon>
|
<DependentUpon>ManagerShell.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
@@ -88,7 +127,12 @@
|
|||||||
<DependentUpon>Resources.resx</DependentUpon>
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<EmbeddedResource Include="ShortcutCreateForm.resx">
|
||||||
|
<DependentUpon>ShortcutCreateForm.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<None Include="app.manifest" />
|
<None Include="app.manifest" />
|
||||||
|
<None Include="ClassDiagram1.cd" />
|
||||||
|
<None Include="packages.config" />
|
||||||
<None Include="Properties\Settings.settings">
|
<None Include="Properties\Settings.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ namespace Manager
|
|||||||
public ManagerShell ()
|
public ManagerShell ()
|
||||||
{
|
{
|
||||||
InitializeComponent ();
|
InitializeComponent ();
|
||||||
|
this.PublicObjectForScripting = new BridgeExt (this, this, this, this);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var relativePath = DataUtils.VisualElementsStore.Vemanifest.SplashScreenImage (Program.g_appId);
|
var relativePath = DataUtils.VisualElementsStore.Vemanifest.SplashScreenImage (Program.g_appId);
|
||||||
@@ -23,6 +24,7 @@ namespace Manager
|
|||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
InitSize ();
|
InitSize ();
|
||||||
|
Text = Bridge.ResXmlStore.StringRes.Get ("MANAGER_APPTITLE");
|
||||||
}
|
}
|
||||||
private void InitSize ()
|
private void InitSize ()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace Manager
|
namespace Manager
|
||||||
@@ -15,7 +14,13 @@ namespace Manager
|
|||||||
[STAThread]
|
[STAThread]
|
||||||
static void Main ()
|
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 ("SmallLogo");
|
||||||
|
AppxPackage.PackageReader.AddApplicationItem ("Square30x30Logo");
|
||||||
|
AppxPackage.PackageReader.AddApplicationItem ("Logo");
|
||||||
|
AppxPackage.PackageReader.AddApplicationItem ("Square44x44Logo");
|
||||||
DataUtils.BrowserEmulation.SetWebBrowserEmulation ();
|
DataUtils.BrowserEmulation.SetWebBrowserEmulation ();
|
||||||
Application.EnableVisualStyles ();
|
Application.EnableVisualStyles ();
|
||||||
Application.SetCompatibleTextRenderingDefault (false);
|
Application.SetCompatibleTextRenderingDefault (false);
|
||||||
|
|||||||
662
Manager/ShortcutCreateForm.Designer.cs
generated
Normal file
662
Manager/ShortcutCreateForm.Designer.cs
generated
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,571 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using Bridge;
|
||||||
namespace Manager
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
135
Manager/ShortcutCreateForm.resx
Normal file
135
Manager/ShortcutCreateForm.resx
Normal 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
155
Manager/ShortcutHelper.cs
Normal 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
4
Manager/packages.config
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net40" />
|
||||||
|
</packages>
|
||||||
@@ -73,12 +73,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Project1.ico" />
|
<Content Include="Project1.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\settings\settings.vcxproj">
|
|
||||||
<Project>{ad25497f-a15f-4dff-ac7a-b8abf5f411d6}</Project>
|
|
||||||
<Name>settings</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|||||||
@@ -1610,6 +1610,298 @@
|
|||||||
<CRC>0</CRC>
|
<CRC>0</CRC>
|
||||||
<StoreOnly>0</StoreOnly>
|
<StoreOnly>0</StoreOnly>
|
||||||
</FileData>
|
</FileData>
|
||||||
|
<FileData>
|
||||||
|
<FldRef>0</FldRef>
|
||||||
|
<FullName>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release\IEHelper.dll</FullName>
|
||||||
|
<FileName>IEHelper.dll</FileName>
|
||||||
|
<Source>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release</Source>
|
||||||
|
<Ext>dll</Ext>
|
||||||
|
<RTSource>档案</RTSource>
|
||||||
|
<Desc/>
|
||||||
|
<Recurse>1</Recurse>
|
||||||
|
<MatchMode>0</MatchMode>
|
||||||
|
<Dest>%AppFolder%</Dest>
|
||||||
|
<Overwrite>1</Overwrite>
|
||||||
|
<Backup>0</Backup>
|
||||||
|
<Protect>0</Protect>
|
||||||
|
<InstallOrder>1000</InstallOrder>
|
||||||
|
<SCStartRoot>0</SCStartRoot>
|
||||||
|
<SCStartProgs>0</SCStartProgs>
|
||||||
|
<SCAppFld>0</SCAppFld>
|
||||||
|
<SCStartup>0</SCStartup>
|
||||||
|
<SCDesk>0</SCDesk>
|
||||||
|
<SCQLaunch>0</SCQLaunch>
|
||||||
|
<SCStartPinOption>0</SCStartPinOption>
|
||||||
|
<SCCust>0</SCCust>
|
||||||
|
<CustSCPath/>
|
||||||
|
<SCDesc/>
|
||||||
|
<SCComment/>
|
||||||
|
<SCArgs/>
|
||||||
|
<SCWork/>
|
||||||
|
<UseExtIco>0</UseExtIco>
|
||||||
|
<IcoFN/>
|
||||||
|
<IcoIdx>0</IcoIdx>
|
||||||
|
<IcoShowMd>0</IcoShowMd>
|
||||||
|
<IcoHK>0</IcoHK>
|
||||||
|
<RegTTF>0</RegTTF>
|
||||||
|
<TTFName/>
|
||||||
|
<RegOCX>0</RegOCX>
|
||||||
|
<RegTLB>0</RegTLB>
|
||||||
|
<SupInUse>0</SupInUse>
|
||||||
|
<Compress>1</Compress>
|
||||||
|
<UseOrigAttr>1</UseOrigAttr>
|
||||||
|
<Attr>0</Attr>
|
||||||
|
<NoCRC>0</NoCRC>
|
||||||
|
<NoRemove>0</NoRemove>
|
||||||
|
<Shared>0</Shared>
|
||||||
|
<OSCond>
|
||||||
|
<OS>32768</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
</OSCond>
|
||||||
|
<RTCond/>
|
||||||
|
<BuildConfigs>
|
||||||
|
<Cfg>All</Cfg>
|
||||||
|
</BuildConfigs>
|
||||||
|
<Package>None</Package>
|
||||||
|
<Packages/>
|
||||||
|
<Notes/>
|
||||||
|
<CompSize>0</CompSize>
|
||||||
|
<CRC>0</CRC>
|
||||||
|
<StoreOnly>0</StoreOnly>
|
||||||
|
</FileData>
|
||||||
|
<FileData>
|
||||||
|
<FldRef>0</FldRef>
|
||||||
|
<FullName>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release\Launch.exe</FullName>
|
||||||
|
<FileName>Launch.exe</FileName>
|
||||||
|
<Source>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release</Source>
|
||||||
|
<Ext>exe</Ext>
|
||||||
|
<RTSource>档案</RTSource>
|
||||||
|
<Desc/>
|
||||||
|
<Recurse>1</Recurse>
|
||||||
|
<MatchMode>0</MatchMode>
|
||||||
|
<Dest>%AppFolder%</Dest>
|
||||||
|
<Overwrite>1</Overwrite>
|
||||||
|
<Backup>0</Backup>
|
||||||
|
<Protect>0</Protect>
|
||||||
|
<InstallOrder>1000</InstallOrder>
|
||||||
|
<SCStartRoot>0</SCStartRoot>
|
||||||
|
<SCStartProgs>0</SCStartProgs>
|
||||||
|
<SCAppFld>1</SCAppFld>
|
||||||
|
<SCStartup>0</SCStartup>
|
||||||
|
<SCDesk>0</SCDesk>
|
||||||
|
<SCQLaunch>0</SCQLaunch>
|
||||||
|
<SCStartPinOption>0</SCStartPinOption>
|
||||||
|
<SCCust>0</SCCust>
|
||||||
|
<CustSCPath/>
|
||||||
|
<SCDesc>Launch</SCDesc>
|
||||||
|
<SCComment/>
|
||||||
|
<SCArgs/>
|
||||||
|
<SCWork/>
|
||||||
|
<UseExtIco>0</UseExtIco>
|
||||||
|
<IcoFN/>
|
||||||
|
<IcoIdx>0</IcoIdx>
|
||||||
|
<IcoShowMd>0</IcoShowMd>
|
||||||
|
<IcoHK>0</IcoHK>
|
||||||
|
<RegTTF>0</RegTTF>
|
||||||
|
<TTFName/>
|
||||||
|
<RegOCX>0</RegOCX>
|
||||||
|
<RegTLB>0</RegTLB>
|
||||||
|
<SupInUse>0</SupInUse>
|
||||||
|
<Compress>1</Compress>
|
||||||
|
<UseOrigAttr>1</UseOrigAttr>
|
||||||
|
<Attr>0</Attr>
|
||||||
|
<NoCRC>0</NoCRC>
|
||||||
|
<NoRemove>0</NoRemove>
|
||||||
|
<Shared>0</Shared>
|
||||||
|
<OSCond>
|
||||||
|
<OS>32768</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
</OSCond>
|
||||||
|
<RTCond/>
|
||||||
|
<BuildConfigs>
|
||||||
|
<Cfg>All</Cfg>
|
||||||
|
</BuildConfigs>
|
||||||
|
<Package>None</Package>
|
||||||
|
<Packages/>
|
||||||
|
<Notes/>
|
||||||
|
<CompSize>0</CompSize>
|
||||||
|
<CRC>0</CRC>
|
||||||
|
<StoreOnly>0</StoreOnly>
|
||||||
|
</FileData>
|
||||||
|
<FileData>
|
||||||
|
<FldRef>0</FldRef>
|
||||||
|
<FullName>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release\Manager.exe</FullName>
|
||||||
|
<FileName>Manager.exe</FileName>
|
||||||
|
<Source>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release</Source>
|
||||||
|
<Ext>exe</Ext>
|
||||||
|
<RTSource>档案</RTSource>
|
||||||
|
<Desc/>
|
||||||
|
<Recurse>1</Recurse>
|
||||||
|
<MatchMode>0</MatchMode>
|
||||||
|
<Dest>%AppFolder%</Dest>
|
||||||
|
<Overwrite>1</Overwrite>
|
||||||
|
<Backup>0</Backup>
|
||||||
|
<Protect>0</Protect>
|
||||||
|
<InstallOrder>1000</InstallOrder>
|
||||||
|
<SCStartRoot>0</SCStartRoot>
|
||||||
|
<SCStartProgs>0</SCStartProgs>
|
||||||
|
<SCAppFld>0</SCAppFld>
|
||||||
|
<SCStartup>0</SCStartup>
|
||||||
|
<SCDesk>0</SCDesk>
|
||||||
|
<SCQLaunch>0</SCQLaunch>
|
||||||
|
<SCStartPinOption>0</SCStartPinOption>
|
||||||
|
<SCCust>0</SCCust>
|
||||||
|
<CustSCPath/>
|
||||||
|
<SCDesc>Manager</SCDesc>
|
||||||
|
<SCComment/>
|
||||||
|
<SCArgs/>
|
||||||
|
<SCWork/>
|
||||||
|
<UseExtIco>0</UseExtIco>
|
||||||
|
<IcoFN/>
|
||||||
|
<IcoIdx>0</IcoIdx>
|
||||||
|
<IcoShowMd>0</IcoShowMd>
|
||||||
|
<IcoHK>0</IcoHK>
|
||||||
|
<RegTTF>0</RegTTF>
|
||||||
|
<TTFName/>
|
||||||
|
<RegOCX>0</RegOCX>
|
||||||
|
<RegTLB>0</RegTLB>
|
||||||
|
<SupInUse>0</SupInUse>
|
||||||
|
<Compress>1</Compress>
|
||||||
|
<UseOrigAttr>1</UseOrigAttr>
|
||||||
|
<Attr>0</Attr>
|
||||||
|
<NoCRC>0</NoCRC>
|
||||||
|
<NoRemove>0</NoRemove>
|
||||||
|
<Shared>0</Shared>
|
||||||
|
<OSCond>
|
||||||
|
<OS>32768</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
</OSCond>
|
||||||
|
<RTCond/>
|
||||||
|
<BuildConfigs>
|
||||||
|
<Cfg>All</Cfg>
|
||||||
|
</BuildConfigs>
|
||||||
|
<Package>None</Package>
|
||||||
|
<Packages/>
|
||||||
|
<Notes/>
|
||||||
|
<CompSize>0</CompSize>
|
||||||
|
<CRC>0</CRC>
|
||||||
|
<StoreOnly>0</StoreOnly>
|
||||||
|
</FileData>
|
||||||
|
<FileData>
|
||||||
|
<FldRef>0</FldRef>
|
||||||
|
<FullName>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release\ModernNotice.dll</FullName>
|
||||||
|
<FileName>ModernNotice.dll</FileName>
|
||||||
|
<Source>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release</Source>
|
||||||
|
<Ext>dll</Ext>
|
||||||
|
<RTSource>档案</RTSource>
|
||||||
|
<Desc/>
|
||||||
|
<Recurse>1</Recurse>
|
||||||
|
<MatchMode>0</MatchMode>
|
||||||
|
<Dest>%AppFolder%</Dest>
|
||||||
|
<Overwrite>1</Overwrite>
|
||||||
|
<Backup>0</Backup>
|
||||||
|
<Protect>0</Protect>
|
||||||
|
<InstallOrder>1000</InstallOrder>
|
||||||
|
<SCStartRoot>0</SCStartRoot>
|
||||||
|
<SCStartProgs>0</SCStartProgs>
|
||||||
|
<SCAppFld>0</SCAppFld>
|
||||||
|
<SCStartup>0</SCStartup>
|
||||||
|
<SCDesk>0</SCDesk>
|
||||||
|
<SCQLaunch>0</SCQLaunch>
|
||||||
|
<SCStartPinOption>0</SCStartPinOption>
|
||||||
|
<SCCust>0</SCCust>
|
||||||
|
<CustSCPath/>
|
||||||
|
<SCDesc/>
|
||||||
|
<SCComment/>
|
||||||
|
<SCArgs/>
|
||||||
|
<SCWork/>
|
||||||
|
<UseExtIco>0</UseExtIco>
|
||||||
|
<IcoFN/>
|
||||||
|
<IcoIdx>0</IcoIdx>
|
||||||
|
<IcoShowMd>0</IcoShowMd>
|
||||||
|
<IcoHK>0</IcoHK>
|
||||||
|
<RegTTF>0</RegTTF>
|
||||||
|
<TTFName/>
|
||||||
|
<RegOCX>0</RegOCX>
|
||||||
|
<RegTLB>0</RegTLB>
|
||||||
|
<SupInUse>0</SupInUse>
|
||||||
|
<Compress>1</Compress>
|
||||||
|
<UseOrigAttr>1</UseOrigAttr>
|
||||||
|
<Attr>0</Attr>
|
||||||
|
<NoCRC>0</NoCRC>
|
||||||
|
<NoRemove>0</NoRemove>
|
||||||
|
<Shared>0</Shared>
|
||||||
|
<OSCond>
|
||||||
|
<OS>32768</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
<OS>65535</OS>
|
||||||
|
</OSCond>
|
||||||
|
<RTCond/>
|
||||||
|
<BuildConfigs>
|
||||||
|
<Cfg>All</Cfg>
|
||||||
|
</BuildConfigs>
|
||||||
|
<Package>None</Package>
|
||||||
|
<Packages/>
|
||||||
|
<Notes/>
|
||||||
|
<CompSize>0</CompSize>
|
||||||
|
<CRC>0</CRC>
|
||||||
|
<StoreOnly>0</StoreOnly>
|
||||||
|
</FileData>
|
||||||
</ArchiveFiles>
|
</ArchiveFiles>
|
||||||
<ExternalFiles/>
|
<ExternalFiles/>
|
||||||
<BeforeInstallingScreens>
|
<BeforeInstallingScreens>
|
||||||
@@ -7055,7 +7347,7 @@ g_HandleSystemReboot();
|
|||||||
</SessionVar>
|
</SessionVar>
|
||||||
<SessionVar>
|
<SessionVar>
|
||||||
<Name>%ProductVer%</Name>
|
<Name>%ProductVer%</Name>
|
||||||
<Value>0.2.2.3</Value>
|
<Value>0.3.0.0</Value>
|
||||||
<Type>1</Type>
|
<Type>1</Type>
|
||||||
</SessionVar>
|
</SessionVar>
|
||||||
<SessionVar>
|
<SessionVar>
|
||||||
|
|||||||
@@ -47,11 +47,11 @@ extern "C"
|
|||||||
// 只能如此。
|
// 只能如此。
|
||||||
// 可查阅文档 https://learn.microsoft.com/zh-cn/uwp/api/windows.management.deployment.deploymentoptions?view=winrt-26100
|
// 可查阅文档 https://learn.microsoft.com/zh-cn/uwp/api/windows.management.deployment.deploymentoptions?view=winrt-26100
|
||||||
|
|
||||||
|
// 如果当前正在使用此包或依赖于此包的任何包,则会强制关闭与该包关联的进程,以便可以继续注册。
|
||||||
|
#define DEPOLYOPTION_FORCE_APP_SHUTDOWN 0x00000001
|
||||||
// 设置此选项时,应用将在开发模式下安装。 有关开发模式的信息,请参阅 备注。
|
// 设置此选项时,应用将在开发模式下安装。 有关开发模式的信息,请参阅 备注。
|
||||||
// 使用此选项可启用关键应用开发方案。不能将此选项与捆绑包结合使用。
|
// 使用此选项可启用关键应用开发方案。不能将此选项与捆绑包结合使用。
|
||||||
// 如果将此选项与捆绑包一起使用,调用将返回ERROR_INSTALL_FAILED。
|
// 如果将此选项与捆绑包一起使用,调用将返回ERROR_INSTALL_FAILED。
|
||||||
#define DEPOLYOPTION_FORCE_APP_SHUTDOWN 0x00000001
|
|
||||||
// 如果当前正在使用此包或依赖于此包的任何包,则会强制关闭与该包关联的进程,以便可以继续注册。
|
|
||||||
#define DEPOLYOPTION_DEVELOPMENT_MODE 0x00000002
|
#define DEPOLYOPTION_DEVELOPMENT_MODE 0x00000002
|
||||||
// 设置此选项时,将指示应用跳过资源适用性检查。 这会有效地暂存或注册用户传递给 命令的所有资源包,
|
// 设置此选项时,将指示应用跳过资源适用性检查。 这会有效地暂存或注册用户传递给 命令的所有资源包,
|
||||||
// 这会强制对捆绑包中包含的所有包具有适用性。 如果用户传入捆绑包,则将注册所有包含的资源包。
|
// 这会强制对捆绑包中包含的所有包具有适用性。 如果用户传入捆绑包,则将注册所有包含的资源包。
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <set>
|
||||||
|
|
||||||
const std::wstring g_swMsResUriProtocolName = L"ms-resource:";
|
const std::wstring g_swMsResUriProtocolName = L"ms-resource:";
|
||||||
const size_t g_cbMsResPNameLength = lstrlenW (g_swMsResUriProtocolName.c_str ());
|
const size_t g_cbMsResPNameLength = lstrlenW (g_swMsResUriProtocolName.c_str ());
|
||||||
@@ -408,11 +409,11 @@ LPCWSTR PriFileGetLastError ()
|
|||||||
}
|
}
|
||||||
enum class Contrast
|
enum class Contrast
|
||||||
{
|
{
|
||||||
None,
|
None = 0,
|
||||||
White,
|
White = 1,
|
||||||
Black,
|
Black = 2,
|
||||||
High,
|
High = 3,
|
||||||
Low
|
Low = 4
|
||||||
};
|
};
|
||||||
struct candidate_value
|
struct candidate_value
|
||||||
{
|
{
|
||||||
@@ -579,7 +580,7 @@ SearchLoop:
|
|||||||
for each (auto candidateSet in resourceMapSection->CandidateSets->Values)
|
for each (auto candidateSet in resourceMapSection->CandidateSets->Values)
|
||||||
{
|
{
|
||||||
// 超时强制退出(也就没有遍及的必要了)
|
// 超时强制退出(也就没有遍及的必要了)
|
||||||
if ((System::DateTime::Now - begtime).TotalSeconds > 20) return;
|
if ((System::DateTime::Now - begtime).TotalSeconds > 60) return;
|
||||||
allitemslen ++;
|
allitemslen ++;
|
||||||
auto item = pri->inst->GetResourceMapItemByRef (candidateSet->ResourceMapItem);
|
auto item = pri->inst->GetResourceMapItemByRef (candidateSet->ResourceMapItem);
|
||||||
std::wstring itemfullname = MPStringToStdW (item->FullName);
|
std::wstring itemfullname = MPStringToStdW (item->FullName);
|
||||||
@@ -918,4 +919,293 @@ void PriFormatFreeString (LPWSTR lpStrFromThisDll)
|
|||||||
{
|
{
|
||||||
if (!lpStrFromThisDll) return;
|
if (!lpStrFromThisDll) return;
|
||||||
free (lpStrFromThisDll);
|
free (lpStrFromThisDll);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PriFileInst ^GetPriFileInst (PCSPRIFILE file)
|
||||||
|
{
|
||||||
|
if (!file) return nullptr;
|
||||||
|
using namespace System::Runtime::InteropServices;
|
||||||
|
IntPtr ptr (file); // void* → IntPtr
|
||||||
|
GCHandle handle = GCHandle::FromIntPtr (ptr);
|
||||||
|
return safe_cast<PriFileInst^>(handle.Target);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 高 16 位:
|
||||||
|
// 高 4 位:0: Scale 资源, 1: TargetSize 资源, 2: 字符串资源(防止无法获取资源)
|
||||||
|
// 低 4 位:对比度 0 None, 1 White, 2 Black, 3 High, 4 Low
|
||||||
|
// 低 16 位:
|
||||||
|
// Scale 或 TargetSize 或 LCID
|
||||||
|
// 运行时,外部不可使用 output
|
||||||
|
#define PRI_TYPE_SHIFT 28
|
||||||
|
#define PRI_CONTRAST_SHIFT 24
|
||||||
|
#define PRI_TYPE_MASK 0xF0000000
|
||||||
|
#define PRI_CONTRAST_MASK 0x0F000000
|
||||||
|
#define PRI_VALUE_MASK 0x0000FFFF
|
||||||
|
#define PRI_MAKE_KEY(type, contrast, value) \
|
||||||
|
( ((DWORD)(type) << PRI_TYPE_SHIFT) | \
|
||||||
|
((DWORD)(contrast) << PRI_CONTRAST_SHIFT) | \
|
||||||
|
((DWORD)(value) & PRI_VALUE_MASK) )
|
||||||
|
#define PRI_MAKE_SCALE(scale, contrast) PRI_MAKE_KEY(0, contrast, scale)
|
||||||
|
#define PRI_MAKE_TARGETSIZE(size, contrast) PRI_MAKE_KEY(1, contrast, size)
|
||||||
|
#define PRI_MAKE_STRING(lcid) PRI_MAKE_KEY(2, 0, lcid)
|
||||||
|
size_t GetPriScaleAndTargetSizeFileList (
|
||||||
|
PCSPRIFILE pPriFile,
|
||||||
|
const std::vector <std::wstring> &resnames,
|
||||||
|
std::map <std::wnstring, std::map <DWORD, std::wnstring>> &output
|
||||||
|
)
|
||||||
|
{
|
||||||
|
output.clear ();
|
||||||
|
if (!pPriFile) return 0;
|
||||||
|
auto inst = GetPriFileInst (pPriFile);
|
||||||
|
auto pri = inst->inst;
|
||||||
|
auto priFile = inst;
|
||||||
|
auto resmapsect = pri->PriDescriptorSection->ResourceMapSections;
|
||||||
|
std::set <std::wnstring> rnlist;
|
||||||
|
for (auto &it : resnames) rnlist.insert (std::wnstring (it));
|
||||||
|
for (size_t i = 0; i < resmapsect->Count; i ++)
|
||||||
|
{
|
||||||
|
auto resourceMapSectionRef = resmapsect [i];
|
||||||
|
auto resourceMapSection = pri->GetSectionByRef (resourceMapSectionRef);
|
||||||
|
if (resourceMapSection->HierarchicalSchemaReference != nullptr) continue;
|
||||||
|
auto decisionInfoSection = pri->GetSectionByRef (resourceMapSection->DecisionInfoSection);
|
||||||
|
for each (auto candidateSet in resourceMapSection->CandidateSets->Values)
|
||||||
|
{
|
||||||
|
auto item = pri->GetResourceMapItemByRef (candidateSet->ResourceMapItem);
|
||||||
|
std::wstring itemfullname = MPStringToStdW (item->FullName);
|
||||||
|
std::vector <std::wnstring> itempath;
|
||||||
|
{
|
||||||
|
auto ips = split_wcstok (itemfullname, L"\\");
|
||||||
|
for (auto &it : ips)
|
||||||
|
{
|
||||||
|
if (std::wnstring::empty (it)) continue;
|
||||||
|
itempath.push_back (it);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bool isfind = false;
|
||||||
|
std::wnstring taskkey = L"";
|
||||||
|
int tasktype = 1;
|
||||||
|
for (auto &it : rnlist)
|
||||||
|
{
|
||||||
|
TASKITEM_SEARCH key (it);
|
||||||
|
std::vector <std::wnstring> namepath;
|
||||||
|
key.get_path (namepath);
|
||||||
|
if (PathEquals (itempath, namepath))
|
||||||
|
{
|
||||||
|
taskkey = it;
|
||||||
|
tasktype = key.iTaskType;
|
||||||
|
isfind = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isfind) continue;
|
||||||
|
std::map <DWORD, std::wnstring> values;
|
||||||
|
for each (auto candidate in candidateSet->Candidates)
|
||||||
|
{
|
||||||
|
DWORD resc = 0;
|
||||||
|
System::String ^value = nullptr;
|
||||||
|
if (candidate->SourceFile.HasValue)
|
||||||
|
{
|
||||||
|
// 内嵌资源,暂无法处理
|
||||||
|
// value = System::String::Format ("<external in {0}>", pri->GetReferencedFileByRef (candidate->SourceFile.Value)->FullName);
|
||||||
|
value = pri->GetReferencedFileByRef (candidate->SourceFile.Value)->FullName;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ByteSpan ^byteSpan = nullptr;
|
||||||
|
if (candidate->DataItem.HasValue) byteSpan = priFile->inst->GetDataItemByRef (candidate->DataItem.Value);
|
||||||
|
else byteSpan = candidate->Data.Value;
|
||||||
|
priFile->Seek (byteSpan->Offset, System::IO::SeekOrigin::Begin);
|
||||||
|
auto binaryReader = gcnew System::IO::BinaryReader (priFile, System::Text::Encoding::Default, true);
|
||||||
|
auto data = binaryReader->ReadBytes ((int)byteSpan->Length);
|
||||||
|
switch (candidate->Type)
|
||||||
|
{
|
||||||
|
case ResourceValueType::AsciiPath:
|
||||||
|
case ResourceValueType::AsciiString:
|
||||||
|
value = System::Text::Encoding::ASCII->GetString (data)->TrimEnd ('\0');
|
||||||
|
break;
|
||||||
|
case ResourceValueType::Utf8Path:
|
||||||
|
case ResourceValueType::Utf8String:
|
||||||
|
value = System::Text::Encoding::UTF8->GetString (data)->TrimEnd ('\0');
|
||||||
|
break;
|
||||||
|
case ResourceValueType::Path:
|
||||||
|
case ResourceValueType::String:
|
||||||
|
value = System::Text::Encoding::Unicode->GetString (data)->TrimEnd ('\0');
|
||||||
|
break;
|
||||||
|
case ResourceValueType::EmbeddedData:
|
||||||
|
value = Convert::ToBase64String (data);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
delete binaryReader;
|
||||||
|
delete data;
|
||||||
|
binaryReader = nullptr;
|
||||||
|
data = nullptr;
|
||||||
|
}
|
||||||
|
auto qualifierSet = decisionInfoSection->QualifierSets [candidate->QualifierSet];
|
||||||
|
auto qualis = gcnew System::Collections::Generic::Dictionary <QualifierType, Object ^> ();
|
||||||
|
for each (auto quali in qualifierSet->Qualifiers)
|
||||||
|
{
|
||||||
|
auto type = quali->Type;
|
||||||
|
auto value = quali->Value;
|
||||||
|
qualis->Add (type, value);
|
||||||
|
}
|
||||||
|
if (qualis->ContainsKey (QualifierType::Language))
|
||||||
|
{
|
||||||
|
resc = PRI_MAKE_STRING (LocaleCodeToLcidW (MPStringToStdW (qualis [QualifierType::Language]->ToString ())));
|
||||||
|
values [resc] = MPStringToStdW (value ? value : System::String::Empty);
|
||||||
|
}
|
||||||
|
else if (qualis->ContainsKey (QualifierType::TargetSize))
|
||||||
|
{
|
||||||
|
if (qualis->ContainsKey (QualifierType::Contrast))
|
||||||
|
{
|
||||||
|
Contrast ct = Contrast::None;
|
||||||
|
auto contstr = std::wnstring (MPStringToStdW (qualis [QualifierType::Contrast]->ToString ()->Trim ()->ToUpper ()));
|
||||||
|
if (contstr.equals (L"WHITE")) ct = Contrast::White;
|
||||||
|
else if (contstr.equals (L"BLACK")) ct = Contrast::Black;
|
||||||
|
else if (contstr.equals (L"HIGH")) ct = Contrast::High;
|
||||||
|
resc = PRI_MAKE_TARGETSIZE (Convert::ToUInt32 (qualis [QualifierType::TargetSize]), (DWORD)ct);
|
||||||
|
values [resc] = MPStringToStdW (value ? value : System::String::Empty);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
resc = PRI_MAKE_TARGETSIZE (Convert::ToUInt32 (qualis [QualifierType::TargetSize]), 0);
|
||||||
|
values [resc] = MPStringToStdW (value ? value : System::String::Empty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (qualis->ContainsKey (QualifierType::Scale))
|
||||||
|
{
|
||||||
|
if (qualis->ContainsKey (QualifierType::Contrast))
|
||||||
|
{
|
||||||
|
Contrast ct = Contrast::None;
|
||||||
|
auto contstr = std::wnstring (MPStringToStdW (qualis [QualifierType::Contrast]->ToString ()->Trim ()->ToUpper ()));
|
||||||
|
if (contstr.equals (L"WHITE")) ct = Contrast::White;
|
||||||
|
else if (contstr.equals (L"BLACK")) ct = Contrast::Black;
|
||||||
|
else if (contstr.equals (L"HIGH")) ct = Contrast::High;
|
||||||
|
resc = PRI_MAKE_SCALE (Convert::ToUInt32 (qualis [QualifierType::Scale]), (DWORD)ct);
|
||||||
|
values [resc] = MPStringToStdW (value ? value : System::String::Empty);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
resc = PRI_MAKE_SCALE (Convert::ToUInt32 (qualis [QualifierType::Scale]), 0);
|
||||||
|
values [resc] = MPStringToStdW (value ? value : System::String::Empty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete qualis;
|
||||||
|
qualis = nullptr;
|
||||||
|
}
|
||||||
|
output [taskkey] = values;
|
||||||
|
rnlist.erase (taskkey);
|
||||||
|
}
|
||||||
|
resourceMapSection = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
HDWSPAIRLIST CreateDWSPAIRLISTFromMap (const std::map <DWORD, std::wstring> &input)
|
||||||
|
{
|
||||||
|
DWORD count = (DWORD)input.size ();
|
||||||
|
if (count == 0) return nullptr;
|
||||||
|
size_t totalSize = sizeof (DWSPAIRLIST) + sizeof (DWORDWSTRPAIR) * (count - 1);
|
||||||
|
HDWSPAIRLIST list = (HDWSPAIRLIST)malloc (totalSize);
|
||||||
|
if (!list) return nullptr;
|
||||||
|
list->dwLength = count;
|
||||||
|
DWORD index = 0;
|
||||||
|
for (auto &it : input)
|
||||||
|
{
|
||||||
|
list->lpArray [index].dwKey = it.first;
|
||||||
|
list->lpArray [index].lpValue = _wcsdup (it.second.c_str ());
|
||||||
|
index ++;
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
HDWSPAIRLIST CreateDWSPAIRLISTFromMap (const std::map <DWORD, std::wnstring> &input)
|
||||||
|
{
|
||||||
|
DWORD count = (DWORD)input.size ();
|
||||||
|
if (count == 0) return nullptr;
|
||||||
|
size_t totalSize = sizeof (DWSPAIRLIST) + sizeof (DWORDWSTRPAIR) * (count - 1);
|
||||||
|
HDWSPAIRLIST list = (HDWSPAIRLIST)malloc (totalSize);
|
||||||
|
if (!list) return nullptr;
|
||||||
|
list->dwLength = count;
|
||||||
|
DWORD index = 0;
|
||||||
|
for (auto &it : input)
|
||||||
|
{
|
||||||
|
list->lpArray [index].dwKey = it.first;
|
||||||
|
list->lpArray [index].lpValue = _wcsdup (it.second.c_str ());
|
||||||
|
index ++;
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
void DestroyPriResourceAllValueList (HDWSPAIRLIST list)
|
||||||
|
{
|
||||||
|
if (!list) return;
|
||||||
|
for (DWORD i = 0; i < list->dwLength; i++)
|
||||||
|
{
|
||||||
|
if (list->lpArray [i].lpValue)
|
||||||
|
{
|
||||||
|
free (list->lpArray [i].lpValue); // 对应 _wcsdup
|
||||||
|
list->lpArray [i].lpValue = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free (list);
|
||||||
|
}
|
||||||
|
HDWSPAIRLIST GetPriResourceAllValueList (PCSPRIFILE pPriFile, LPCWSTR lpResName)
|
||||||
|
{
|
||||||
|
if (!pPriFile || !lpResName) return nullptr;
|
||||||
|
std::map <std::wnstring, std::map <DWORD, std::wnstring>> rnout;
|
||||||
|
std::vector <std::wstring> rnl = {lpResName ? lpResName : L""};
|
||||||
|
GetPriScaleAndTargetSizeFileList (pPriFile, rnl, rnout);
|
||||||
|
for (auto &it : rnout) return CreateDWSPAIRLISTFromMap (it.second);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
HWSDSPAIRLIST CreateWSDSPAIRLISTFromMap (const std::map <std::wnstring, std::map <DWORD, std::wnstring>> &input)
|
||||||
|
{
|
||||||
|
DWORD count = (DWORD)input.size ();
|
||||||
|
if (count == 0) return nullptr;
|
||||||
|
size_t totalSize = sizeof (WSDSPAIRLIST) + sizeof (WSDSPAIR) * (count - 1);
|
||||||
|
HWSDSPAIRLIST list = (HWSDSPAIRLIST)malloc (totalSize);
|
||||||
|
if (!list) return nullptr;
|
||||||
|
list->dwLength = count;
|
||||||
|
DWORD index = 0;
|
||||||
|
for (auto &it : input)
|
||||||
|
{
|
||||||
|
list->lpArray [index].lpKey = _wcsdup (it.first.c_str ());
|
||||||
|
list->lpArray [index].lpValue = nullptr;
|
||||||
|
if (!it.second.empty ())
|
||||||
|
{
|
||||||
|
list->lpArray [index].lpValue = CreateDWSPAIRLISTFromMap (it.second);
|
||||||
|
}
|
||||||
|
index ++;
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
void DestroyResourcesAllValuesList (HWSDSPAIRLIST list)
|
||||||
|
{
|
||||||
|
if (!list) return;
|
||||||
|
for (DWORD i = 0; i < list->dwLength; i++)
|
||||||
|
{
|
||||||
|
if (list->lpArray [i].lpKey)
|
||||||
|
{
|
||||||
|
free (list->lpArray [i].lpKey);
|
||||||
|
list->lpArray [i].lpKey = nullptr;
|
||||||
|
}
|
||||||
|
if (list->lpArray [i].lpValue)
|
||||||
|
{
|
||||||
|
DestroyPriResourceAllValueList (list->lpArray [i].lpValue);
|
||||||
|
list->lpArray [i].lpValue = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free (list);
|
||||||
|
}
|
||||||
|
HWSDSPAIRLIST GetPriResourcesAllValuesList (PCSPRIFILE pPriFile, const LPCWSTR *lpResNames, DWORD dwCount)
|
||||||
|
{
|
||||||
|
if (!pPriFile || !lpResNames || dwCount == 0) return nullptr;
|
||||||
|
std::map <std::wnstring, std::map <DWORD, std::wnstring>> rnout;
|
||||||
|
std::vector<std::wstring> rnl;
|
||||||
|
rnl.reserve (dwCount);
|
||||||
|
for (DWORD i = 0; i < dwCount; i++)
|
||||||
|
{
|
||||||
|
if (lpResNames [i])
|
||||||
|
rnl.emplace_back (lpResNames [i]);
|
||||||
|
}
|
||||||
|
if (rnl.empty ()) return nullptr;
|
||||||
|
GetPriScaleAndTargetSizeFileList (pPriFile, rnl, rnout);
|
||||||
|
if (rnout.empty ()) return nullptr;
|
||||||
|
return CreateWSDSPAIRLISTFromMap (rnout);
|
||||||
|
}
|
||||||
|
|||||||
@@ -75,6 +75,44 @@ extern "C" {
|
|||||||
PRIFORMATCLI_API BOOL IsMsResourceUri (LPCWSTR pResUri);
|
PRIFORMATCLI_API BOOL IsMsResourceUri (LPCWSTR pResUri);
|
||||||
// 工具函数,用于释放本地 DLL 返回的字符串
|
// 工具函数,用于释放本地 DLL 返回的字符串
|
||||||
PRIFORMATCLI_API void PriFormatFreeString (LPWSTR lpStrFromThisDll);
|
PRIFORMATCLI_API void PriFormatFreeString (LPWSTR lpStrFromThisDll);
|
||||||
|
typedef struct DWORDWSTRPAIR__
|
||||||
|
{
|
||||||
|
DWORD dwKey _DEFAULT_VALUE_SET (0);
|
||||||
|
LPWSTR lpValue _DEFAULT_VALUE_SET (NULL);
|
||||||
|
} DWORDWSTRPAIR;
|
||||||
|
typedef struct DWSPAIRLIST__
|
||||||
|
{
|
||||||
|
DWORD dwLength _DEFAULT_VALUE_SET (0);
|
||||||
|
DWORDWSTRPAIR lpArray [1];
|
||||||
|
} DWSPAIRLIST, *HDWSPAIRLIST;
|
||||||
|
// HDWSPAIRLIST 由此销毁
|
||||||
|
PRIFORMATCLI_API void DestroyPriResourceAllValueList (HDWSPAIRLIST list);
|
||||||
|
// DWORD 部分
|
||||||
|
// 高 16 位:
|
||||||
|
// 高 4 位:0: Scale 资源, 1: TargetSize 资源, 2: 字符串资源(防止无法获取资源)
|
||||||
|
// 低 4 位:对比度 0 None, 1 White, 2 Black, 3 High, 4 Low
|
||||||
|
// 低 16 位:
|
||||||
|
// Scale 或 TargetSize 或 LCID
|
||||||
|
PRIFORMATCLI_API HDWSPAIRLIST GetPriResourceAllValueList (PCSPRIFILE pPriFile, LPCWSTR lpResName);
|
||||||
|
typedef struct WSDSPAIR__
|
||||||
|
{
|
||||||
|
LPWSTR lpKey;
|
||||||
|
HDWSPAIRLIST lpValue;
|
||||||
|
} WSDSPAIR;
|
||||||
|
typedef struct WSDSPAIRLIST___
|
||||||
|
{
|
||||||
|
DWORD dwLength _DEFAULT_VALUE_SET (0);
|
||||||
|
WSDSPAIR lpArray [1];
|
||||||
|
} WSDSPAIRLIST, *HWSDSPAIRLIST;
|
||||||
|
// HWSDSPAIRLIST 由此销毁
|
||||||
|
PRIFORMATCLI_API void DestroyResourcesAllValuesList (HWSDSPAIRLIST list);
|
||||||
|
// DWORD 部分
|
||||||
|
// 高 16 位:
|
||||||
|
// 高 4 位:0: Scale 资源, 1: TargetSize 资源, 2: 字符串资源(防止无法获取资源)
|
||||||
|
// 低 4 位:对比度 0 None, 1 White, 2 Black, 3 High, 4 Low
|
||||||
|
// 低 16 位:
|
||||||
|
// Scale 或 TargetSize 或 LCID
|
||||||
|
PRIFORMATCLI_API HWSDSPAIRLIST GetPriResourcesAllValuesList (PCSPRIFILE pPriFile, const LPCWSTR *lpResNames, DWORD dwCount);
|
||||||
#ifdef _DEFAULT_VALUE_SET
|
#ifdef _DEFAULT_VALUE_SET
|
||||||
#undef _DEFAULT_VALUE_SET
|
#undef _DEFAULT_VALUE_SET
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Binary file not shown.
BIN
shared/html/fonts/Symbols.eot
Normal file
BIN
shared/html/fonts/Symbols.eot
Normal file
Binary file not shown.
BIN
shared/html/fonts/Symbols.ttf
Normal file
BIN
shared/html/fonts/Symbols.ttf
Normal file
Binary file not shown.
@@ -31,4 +31,12 @@
|
|||||||
url('SETUP.TTF') format('truetype');
|
url('SETUP.TTF') format('truetype');
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Symbols";
|
||||||
|
src: url('Symbols.eot') format('embedded-opentype'),
|
||||||
|
url('Symbols.ttf') format('truetype');
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
}
|
}
|
||||||
@@ -12,6 +12,9 @@
|
|||||||
global.publicRes = function(resId) {
|
global.publicRes = function(resId) {
|
||||||
return getFileResPair(respath, resId);
|
return getFileResPair(respath, resId);
|
||||||
}
|
}
|
||||||
|
global.stringRes = function(resId) {
|
||||||
|
return Bridge.External.StringResources.getString(resId);
|
||||||
|
}
|
||||||
|
|
||||||
function ready(e) {
|
function ready(e) {
|
||||||
function nextstep() {
|
function nextstep() {
|
||||||
|
|||||||
@@ -124,5 +124,100 @@
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function initLoaderPage() {
|
||||||
|
var page = document.getElementById("page-load");
|
||||||
|
var prefixs = ["ins", "reg", "sta"];
|
||||||
|
var opdict = {
|
||||||
|
ins: Package.manager.add,
|
||||||
|
reg: Package.manager.register,
|
||||||
|
sta: Package.manager.stage
|
||||||
|
};
|
||||||
|
var ingdict = {
|
||||||
|
ins: strres.get("MANAGER_LOAD_INSTALL_ING"),
|
||||||
|
reg: strres.get("MANAGER_LOAD_REGISTER_ING"),
|
||||||
|
sta: strres.get("MANAGER_LOAD_STAGE_ING")
|
||||||
|
};
|
||||||
|
var sdict = {
|
||||||
|
ins: strres.get("MANAGER_LOAD_INSTALL_SUCCEED"),
|
||||||
|
reg: strres.get("MANAGER_LOAD_REGISTER_SUCCEED"),
|
||||||
|
sta: strres.get("MANAGER_LOAD_STAGE_SUCCEED")
|
||||||
|
}
|
||||||
|
var explorer = external.Storage.Explorer;
|
||||||
|
prefixs.forEach(function(prefix) {
|
||||||
|
var checklist = document.getElementById(prefix + "-deployoptions");
|
||||||
|
var btn = document.getElementById(prefix + "-btn");
|
||||||
|
var statusbar = document.getElementById(prefix + "-progress");
|
||||||
|
var progressbar = statusbar.querySelector(".progress");
|
||||||
|
var status = statusbar.querySelector(".status");
|
||||||
|
progressbar.removeAttribute("value");
|
||||||
|
status.textContent = "";
|
||||||
|
var hideTimer = null;
|
||||||
|
btn.onclick = function() {
|
||||||
|
var self = this;
|
||||||
|
self.disabled = true;
|
||||||
|
var nextNextStep = function(statusbar) {
|
||||||
|
if (hideTimer) clearTimeout(hideTimer);
|
||||||
|
hideTimer = setTimeout(function() {
|
||||||
|
hideTimer = null;
|
||||||
|
statusbar.bar.hide();
|
||||||
|
}, 10000);
|
||||||
|
}
|
||||||
|
var nextStep = function(filename) {
|
||||||
|
if (filename === "" || filename === null || filename === void 0) {
|
||||||
|
self.disabled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (hideTimer) clearTimeout(hideTimer);
|
||||||
|
var op = opdict[prefix];
|
||||||
|
var options = 0;
|
||||||
|
var items = checklist.querySelectorAll("input:checked");
|
||||||
|
if (items) {
|
||||||
|
for (var i = 0; i < items.length; i++) {
|
||||||
|
options |= parseInt(items[i].value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
progressbar.removeAttribute("value");
|
||||||
|
status.textContent = external.String.format(ingdict[prefix], "");
|
||||||
|
statusbar.bar.show();
|
||||||
|
op(filename, options).then(function(result) {
|
||||||
|
self.disabled = false;
|
||||||
|
status.textContent = sdict[prefix];
|
||||||
|
refreshAppList2();
|
||||||
|
nextNextStep(statusbar);
|
||||||
|
}, function(error) {
|
||||||
|
self.disabled = false;
|
||||||
|
status.textContent = error.message;
|
||||||
|
nextNextStep(statusbar);
|
||||||
|
}, function(_p) {
|
||||||
|
status.textContent = external.String.format(ingdict[prefix], _p + "%");
|
||||||
|
progressbar.value = _p;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (prefix === "ins" || prefix === "sta") explorer.file(
|
||||||
|
external.String.format("{0}|{1}|{2}|{3}",
|
||||||
|
strres.get("MANAGER_LOAD_INS_OR_STA_FILTERDISPLAY"),
|
||||||
|
"*.appx;*.appxbundle;*.msix;*.msixbundle",
|
||||||
|
strres.get("MANAGER_LOAD_ALLFILES"),
|
||||||
|
"*.*"
|
||||||
|
),
|
||||||
|
"",
|
||||||
|
nextStep
|
||||||
|
);
|
||||||
|
else if (prefix === "reg") explorer.file(
|
||||||
|
external.String.format("{0}|{1}|{2}|{3}",
|
||||||
|
strres.get("MANAGER_LOAD_REG_FILTERDISPLAY"),
|
||||||
|
"*.appxmanifest;AppxManifest.xml",
|
||||||
|
strres.get("MANAGER_LOAD_ALLFILES"),
|
||||||
|
"*.*"
|
||||||
|
),
|
||||||
|
"",
|
||||||
|
nextStep
|
||||||
|
);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
global.setAppInfoPageContent = setAppInfoPageContent;
|
global.setAppInfoPageContent = setAppInfoPageContent;
|
||||||
|
global.initLoaderPage = initLoaderPage;
|
||||||
})(this);
|
})(this);
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
(function(global) {
|
(function(global) {
|
||||||
var strres = external.StringResources;
|
var strres = external.StringResources;
|
||||||
|
var conf = external.Config.current;
|
||||||
|
var set = conf.getSection("Settings");
|
||||||
|
|
||||||
function createLocalizedCompare(locale) {
|
function createLocalizedCompare(locale) {
|
||||||
return function(a, b) {
|
return function(a, b) {
|
||||||
@@ -359,6 +361,8 @@
|
|||||||
}
|
}
|
||||||
var showSystemApps = document.getElementById("applist-showsystemapp");
|
var showSystemApps = document.getElementById("applist-showsystemapp");
|
||||||
var showFrameworks = document.getElementById("applist-showframework");
|
var showFrameworks = document.getElementById("applist-showframework");
|
||||||
|
showSystemApps.checked = set.getKey("PackageManager:ShowSystemApps").readBool(false);
|
||||||
|
showFrameworks.checked = set.getKey("PackageManager:ShowFrameworks").readBool(false);
|
||||||
listView.filter = function(item) {
|
listView.filter = function(item) {
|
||||||
try {
|
try {
|
||||||
if (!showFrameworks.checked && item.Properties.Framework) return false;
|
if (!showFrameworks.checked && item.Properties.Framework) return false;
|
||||||
@@ -371,10 +375,12 @@
|
|||||||
Windows.UI.Event.Util.addEvent(showSystemApps, "change", function() {
|
Windows.UI.Event.Util.addEvent(showSystemApps, "change", function() {
|
||||||
listView.refresh();
|
listView.refresh();
|
||||||
dataLengthDisplay.textContent = external.String.format(strres.get("MANAGER_MANAGE_FINDAPPS"), listView.findItemLength);
|
dataLengthDisplay.textContent = external.String.format(strres.get("MANAGER_MANAGE_FINDAPPS"), listView.findItemLength);
|
||||||
|
set.getKey("PackageManager:ShowSystemApps").set(showSystemApps.checked);
|
||||||
});
|
});
|
||||||
Windows.UI.Event.Util.addEvent(showFrameworks, "change", function() {
|
Windows.UI.Event.Util.addEvent(showFrameworks, "change", function() {
|
||||||
listView.refresh();
|
listView.refresh();
|
||||||
dataLengthDisplay.textContent = external.String.format(strres.get("MANAGER_MANAGE_FINDAPPS"), listView.findItemLength);
|
dataLengthDisplay.textContent = external.String.format(strres.get("MANAGER_MANAGE_FINDAPPS"), listView.findItemLength);
|
||||||
|
set.getKey("PackageManager:ShowFrameworks").set(showFrameworks.checked);
|
||||||
});
|
});
|
||||||
refreshButton.addEventListener("click", refreshAppList2);
|
refreshButton.addEventListener("click", refreshAppList2);
|
||||||
appbarControl.add(refreshButton);
|
appbarControl.add(refreshButton);
|
||||||
@@ -408,12 +414,60 @@
|
|||||||
launchButton.textContent = strres.get("MANAGER_APP_LAUNCH");
|
launchButton.textContent = strres.get("MANAGER_APP_LAUNCH");
|
||||||
launchButton.setAttribute("data-app-user-model-id", item.AppUserModelID);
|
launchButton.setAttribute("data-app-user-model-id", item.AppUserModelID);
|
||||||
var createShortcutButton = document.createElement("button");
|
var createShortcutButton = document.createElement("button");
|
||||||
createShortcutButton.textContent = strres.get("MANAGER_APP_CREATESHORTCUT");
|
createShortcutButton.setAttribute("data-app-user-model-id", item.AppUserModelID);
|
||||||
|
createShortcutButton.textContent = strres.get("MANAGER_APP_SHORTCUTCREATE_TITLE");
|
||||||
createShortcutButton.style.marginRight = "10px";
|
createShortcutButton.style.marginRight = "10px";
|
||||||
Windows.UI.Event.Util.addEvent(launchButton, "click", function(e) {
|
Windows.UI.Event.Util.addEvent(launchButton, "click", function(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
Package.manager.active(this.getAttribute("data-app-user-model-id"));
|
Package.manager.active(this.getAttribute("data-app-user-model-id"));
|
||||||
});
|
});
|
||||||
|
Windows.UI.Event.Util.addEvent(createShortcutButton, "click", function(e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
var backid =
|
||||||
|
messageBoxAdvance(function() {
|
||||||
|
var ring = document.createElement("progress");
|
||||||
|
ring.classList.add("win-ring");
|
||||||
|
ring.style.color = "white";
|
||||||
|
var text = document.createElement("span");
|
||||||
|
text.textContent = strres.get("MANAGER_APP_SHORTCUTCREATE_BACK_TEXT_ING");
|
||||||
|
text.style.marginLeft = "20px";
|
||||||
|
var container = document.createElement("div");
|
||||||
|
container.style.display = "flex";
|
||||||
|
container.style.flexDirection = "row";
|
||||||
|
container.appendChild(ring);
|
||||||
|
container.appendChild(text);
|
||||||
|
container.style.marginTop = "10px";
|
||||||
|
var openInstallLocation = document.createElement("button");
|
||||||
|
openInstallLocation.textContent = strres.get("MANAGER_APP_SHORTCUTCREATE_OPENINSTALLLOCATION");
|
||||||
|
openInstallLocation.style.marginTop = "10px";
|
||||||
|
openInstallLocation.style.display = "block";
|
||||||
|
openInstallLocation.setAttribute("data-install-location", appDetailPage.data.InstallLocation);
|
||||||
|
openInstallLocation.onclick = function() {
|
||||||
|
external.Storage.Path.open(this.getAttribute("data-install-location"));
|
||||||
|
};
|
||||||
|
var finalc = document.createElement("div");
|
||||||
|
finalc.appendChild(container);
|
||||||
|
finalc.appendChild(document.createElement("br"));
|
||||||
|
finalc.appendChild(openInstallLocation);
|
||||||
|
return finalc;
|
||||||
|
}(), strres.get("MANAGER_APP_SHORTCUTCREATE_BACK_TITLE"), [], "#159d9d");
|
||||||
|
document.getElementById(backid).querySelector(".notice-controls").style.display = "none";
|
||||||
|
var back = document.getElementById(backid);
|
||||||
|
external.createAppShortcut(appDetailPage.data.InstallLocation, this.getAttribute("data-app-user-model-id"), function(complete) {
|
||||||
|
complete = JSON.parse(complete);
|
||||||
|
if (typeof back.remove !== "undefined") back.remove();
|
||||||
|
else if (typeof back.removeNode !== "undefined") back.removeNode(true);
|
||||||
|
else back.parentNode.removeChild(back);
|
||||||
|
if (complete.succeeded) messageBoxAdvance(strres.get("MANAGER_APP_SHORTCUTCREATE_BACK_TEXT_SUCCEED"), strres.get("MANAGER_APP_SHORTCUTCREATE_BACK_TITLE_SUCCEED"), [], "#159d9d");
|
||||||
|
else messageBoxAdvance(complete.message, strres.get("MANAGER_APP_SHORTCUTCREATE_BACK_TITLE_FAILED"), [], "#159d9d");
|
||||||
|
}, function(error) {
|
||||||
|
error = JSON.parse(error);
|
||||||
|
if (typeof back.remove !== "undefined") back.remove();
|
||||||
|
else if (typeof back.removeNode !== "undefined") back.removeNode(true);
|
||||||
|
else back.parentNode.removeChild(back);
|
||||||
|
messageBoxAdvance((error.message || error.error || error), strres.get("MANAGER_APP_SHORTCUTCREATE_BACK_TITLE_FAILED"), [], "#159d9d");
|
||||||
|
});
|
||||||
|
});
|
||||||
ctrls.appendChild(launchButton);
|
ctrls.appendChild(launchButton);
|
||||||
ctrls.appendChild(createShortcutButton);
|
ctrls.appendChild(createShortcutButton);
|
||||||
return appItem;
|
return appItem;
|
||||||
@@ -536,10 +590,12 @@
|
|||||||
});
|
});
|
||||||
uninstallFlyout.appDataSource = new DataView.DataSource();
|
uninstallFlyout.appDataSource = new DataView.DataSource();
|
||||||
uninstallFlyout.appListView.bind(uninstallFlyout.appDataSource);
|
uninstallFlyout.appListView.bind(uninstallFlyout.appDataSource);
|
||||||
|
initLoaderPage();
|
||||||
pagemgr.addEventListener("load", function(e) {
|
pagemgr.addEventListener("load", function(e) {
|
||||||
appbarControl.enabled = e == "manager";
|
appbarControl.enabled = e == "manager";
|
||||||
refreshButton.style.display = e == "manager" ? "" : "none";
|
refreshButton.style.display = e == "manager" ? "" : "none";
|
||||||
});
|
});
|
||||||
|
pagemgr.register("load", document.getElementById("tag-load"), document.getElementById("page-load"));
|
||||||
pagemgr.go("manager");
|
pagemgr.go("manager");
|
||||||
});
|
});
|
||||||
})(this);
|
})(this);
|
||||||
@@ -187,4 +187,32 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
(function(global) {
|
||||||
|
"use strict";
|
||||||
|
if (typeof Array.prototype.forEach === "undefined") {
|
||||||
|
Array.prototype.forEach = function(callback, thisArg) {
|
||||||
|
var T, k;
|
||||||
|
if (this == null) {
|
||||||
|
throw new TypeError(" this is null or not defined");
|
||||||
|
}
|
||||||
|
var O = Object(this);
|
||||||
|
var len = O.length >>> 0;
|
||||||
|
if (typeof callback !== "function") {
|
||||||
|
throw new TypeError(callback + " is not a function");
|
||||||
|
}
|
||||||
|
if (arguments.length > 1) {
|
||||||
|
T = thisArg;
|
||||||
|
}
|
||||||
|
k = 0;
|
||||||
|
while (k < len) {
|
||||||
|
var kValue;
|
||||||
|
if (k in O) {
|
||||||
|
kValue = O[k];
|
||||||
|
callback.call(T, kValue, k, O);
|
||||||
|
}
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
})(this);
|
||||||
@@ -14,10 +14,12 @@
|
|||||||
var byId = el.getAttribute('data-res-byid');
|
var byId = el.getAttribute('data-res-byid');
|
||||||
var fromFile = el.getAttribute('data-res-fromfile');
|
var fromFile = el.getAttribute('data-res-fromfile');
|
||||||
var byXml = el.getAttribute('data-res-resxml');
|
var byXml = el.getAttribute('data-res-resxml');
|
||||||
|
var customSet = el.getAttribute('data-res-custom');
|
||||||
if ((byName && !Bridge.NString.empty(byName)) ||
|
if ((byName && !Bridge.NString.empty(byName)) ||
|
||||||
(byId && parseInt(byId, 10) > 0) ||
|
(byId && parseInt(byId, 10) > 0) ||
|
||||||
(fromFile && !Bridge.NString.empty(fromFile)) ||
|
(fromFile && !Bridge.NString.empty(fromFile)) ||
|
||||||
(byXml && !Bridge.NString.empty(byXml))) {
|
(byXml && !Bridge.NString.empty(byXml)) ||
|
||||||
|
(customSet && !Bridge.NString.empty(customSet))) {
|
||||||
result.push(el);
|
result.push(el);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,12 +57,23 @@
|
|||||||
try {
|
try {
|
||||||
var obj = nodes[i].getAttribute('data-res-resxml');
|
var obj = nodes[i].getAttribute('data-res-resxml');
|
||||||
var strres = external.StringResources;
|
var strres = external.StringResources;
|
||||||
if (strres && strres.isValid) {
|
if (strres) {
|
||||||
nodes[i].textContent = strres.get(obj);
|
try {
|
||||||
|
nodes[i].textContent = strres.get(obj);
|
||||||
|
} catch (e) {
|
||||||
|
nodes[i].textContent = strres.getString(obj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
nodes[i].textContent = "";
|
nodes[i].textContent = "";
|
||||||
}
|
}
|
||||||
|
} else if (nodes[i].hasAttribute('data-res-custom')) {
|
||||||
|
try {
|
||||||
|
var obj = eval(nodes[i].getAttribute('data-res-custom'));
|
||||||
|
nodes[i].textContent = obj;
|
||||||
|
} catch (e) {
|
||||||
|
nodes[i].textContent = "";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
nodes[i].textContent = "";
|
nodes[i].textContent = "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,6 +144,123 @@
|
|||||||
<button id="detail-uninstall-btn" data-res-resxml="MANAGER_APP_UNINSTALL">卸载</button>
|
<button id="detail-uninstall-btn" data-res-resxml="MANAGER_APP_UNINSTALL">卸载</button>
|
||||||
<div class="bottom-compensate"></div>
|
<div class="bottom-compensate"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="page-load" class="ispage" style="display: none;">
|
||||||
|
<style>
|
||||||
|
.checklist {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-content: flex-start;
|
||||||
|
justify-content: flex-start;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checklist .title {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checklist .item {
|
||||||
|
margin-left: 10px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
align-content: flex-start;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<h2 data-res-resxml="MANAGER_LOAD"></h2>
|
||||||
|
<p data-res-resxml="MANAGER_LOAD_DESC"></p>
|
||||||
|
<h3 data-res-resxml="MANAGER_LOAD_INSTALL"></h3>
|
||||||
|
<p data-res-resxml="MANAGER_LOAD_INSTALL_DESC"></p>
|
||||||
|
<div class="checklist" id="ins-deployoptions">
|
||||||
|
<span class="title" data-res-resxml="MANAGER_LOAD_DEPLOY_OPTIONS"></span>
|
||||||
|
<div class="item">
|
||||||
|
<input type="checkbox" value="2" id="ins-devmode">
|
||||||
|
<label for="ins-devmode" data-res-resxml="MANAGER_LOAD_DEPLOY_OPTIONS_DEVELOPMENT_MODE"></label>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<input type="checkbox" value="1" id="ins-force-appshutdown">
|
||||||
|
<label for="ins-force-appshutdown" data-res-resxml="MANAGER_LOAD_DEPLOY_OPTIONS_FORCE_APP_SHUTDOWN"></label>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<input type="checkbox" value="32" id="ins-all-resources">
|
||||||
|
<label for="ins-all-resources" data-res-resxml="MANAGER_LOAD_DEPLOY_OPTIONS_INSTALL_ALL_RESOURCES"></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="statusbar" id="ins-progress">
|
||||||
|
<div class="container" style="padding-bottom: 10px;">
|
||||||
|
<span class="status"></span><br>
|
||||||
|
<progress class="win-progress progress" min="0" max="100"></progress>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button id="ins-btn" data-res-resxml="MANAGER_LOAD_INSTALL_BTN"></button>
|
||||||
|
<br><br>
|
||||||
|
<h3 data-res-resxml="MANAGER_LOAD_REGISTER"></h3>
|
||||||
|
<p data-res-resxml="MANAGER_LOAD_REGISTER_DESC"></p>
|
||||||
|
<div class="checklist" id="reg-deployoptions">
|
||||||
|
<span class="title" data-res-resxml="MANAGER_LOAD_DEPLOY_OPTIONS"></span>
|
||||||
|
<div class="item">
|
||||||
|
<input type="checkbox" value="2" id="reg-devmode">
|
||||||
|
<label for="reg-devmode" data-res-resxml="MANAGER_LOAD_DEPLOY_OPTIONS_DEVELOPMENT_MODE"></label>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<input type="checkbox" value="1" id="reg-force-appshutdown">
|
||||||
|
<label for="reg-force-appshutdown" data-res-resxml="MANAGER_LOAD_DEPLOY_OPTIONS_FORCE_APP_SHUTDOWN"></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="statusbar" id="reg-progress">
|
||||||
|
<div class="container">
|
||||||
|
<span class="status" data-res-resxml="MANAGER_APP_REG_ING"></span><br>
|
||||||
|
<progress class="win-progress progress" min="0" max="100"></progress>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button id="reg-btn" data-res-resxml="MANAGER_LOAD_REGISTER_BTN"></button>
|
||||||
|
<br><br>
|
||||||
|
<h3 data-res-resxml="MANAGER_LOAD_STAGE"></h3>
|
||||||
|
<p data-res-resxml="MANAGER_LOAD_STAGE_DESC"></p>
|
||||||
|
<div class="checklist" id="sta-deployoptions">
|
||||||
|
<span class="title" data-res-resxml="MANAGER_LOAD_DEPLOY_OPTIONS"></span>
|
||||||
|
<div class="item">
|
||||||
|
<input type="checkbox" value="2" id="sta-devmode">
|
||||||
|
<label for="sta-devmode" data-res-resxml="MANAGER_LOAD_DEPLOY_OPTIONS_DEVELOPMENT_MODE"></label>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<input type="checkbox" value="1" id="sta-force-appshutdown">
|
||||||
|
<label for="sta-force-appshutdown" data-res-resxml="MANAGER_LOAD_DEPLOY_OPTIONS_FORCE_APP_SHUTDOWN"></label>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<input type="checkbox" value="32" id="sta-all-resources">
|
||||||
|
<label for="sta-all-resources" data-res-resxml="MANAGER_LOAD_DEPLOY_OPTIONS_INSTALL_ALL_RESOURCES"></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="statusbar" id="sta-progress">
|
||||||
|
<div class="container">
|
||||||
|
<span class="status" data-res-resxml="MANAGER_APP_REG_ING"></span><br>
|
||||||
|
<progress class="win-progress progress" min="0" max="100"></progress>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button id="sta-btn" data-res-resxml="MANAGER_LOAD_STAGE_BTN"></button>
|
||||||
|
<div class="bottom-compensate"></div>
|
||||||
|
<script>
|
||||||
|
(function(global) {
|
||||||
|
var prefixs = ["ins", "reg", "sta"];
|
||||||
|
var statusbars = [
|
||||||
|
document.getElementById("ins-progress"),
|
||||||
|
document.getElementById("reg-progress"),
|
||||||
|
document.getElementById("sta-progress")
|
||||||
|
];
|
||||||
|
statusbars.forEach(function(statusbar) {
|
||||||
|
statusbar.bar = new TransitionPanel(statusbar, {
|
||||||
|
axis: 'y',
|
||||||
|
duration: 500,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})(this);
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<aside class="win-ui-dark">
|
<aside class="win-ui-dark">
|
||||||
<nav class="container">
|
<nav class="container">
|
||||||
@@ -171,12 +288,44 @@
|
|||||||
</li>
|
</li>
|
||||||
<li id="tag-appinfo" class="subitem">
|
<li id="tag-appinfo" class="subitem">
|
||||||
<div role="img"></div>
|
<div role="img"></div>
|
||||||
<span class="win-type-base">应用信息</span>
|
<span class="win-type-base" data-res-resxml="MANAGER_APP"></span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li id="tag-load">
|
||||||
<div role="img"></div>
|
<div role="img"></div>
|
||||||
<span class="win-type-base">Manager</span>
|
<span class="win-type-base" data-res-resxml="MANAGER_LOAD"></span>
|
||||||
</li>
|
</li>
|
||||||
|
<li id="tag-settings">
|
||||||
|
<div role="img"></div>
|
||||||
|
<span class="win-type-base" data-res-resxml="MANAGER_SETTINGS"></span>
|
||||||
|
</li>
|
||||||
|
<script>
|
||||||
|
(function(global) {
|
||||||
|
var isexec = false;
|
||||||
|
var settag = document.getElementById("tag-settings");
|
||||||
|
Windows.UI.Event.Util.addEvent(settag, "click", function() {
|
||||||
|
if (isexec) return;
|
||||||
|
var self = this;
|
||||||
|
try {
|
||||||
|
var settingpath = external.Storage.Path.combine(external.Storage.Path.root, "settings.exe");
|
||||||
|
//var cmdline = "\"{execfile}\" manager".replace("{execfile}", settingpath);
|
||||||
|
external.Process.runAsync(
|
||||||
|
"manager",
|
||||||
|
settingpath,
|
||||||
|
1,
|
||||||
|
"",
|
||||||
|
function(ret) {
|
||||||
|
isexec = false;
|
||||||
|
self.classList.remove("selected");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
isexec = true;
|
||||||
|
self.classList.add("selected");
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})(this);
|
||||||
|
</script>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</aside>
|
</aside>
|
||||||
@@ -209,14 +358,6 @@
|
|||||||
<button class="confirm" data-res-resxml="MANAGER_APP_UNINSTALL" style="float: right;"></button>
|
<button class="confirm" data-res-resxml="MANAGER_APP_UNINSTALL" style="float: right;"></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="app-deskshortcut-create" style="position: absolute;">
|
|
||||||
<p>即将在桌面创建快捷方式,这里做一些调整。快捷方式不建议固定到开始菜单中,因为本快捷方式只是一种启动器。不具有其余磁贴功能。</p>
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<div class="win-radio"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -10,6 +10,10 @@
|
|||||||
return res.fromfile(libpath, resid);
|
return res.fromfile(libpath, resid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getStringRes(resid) {
|
||||||
|
return Bridge.External.StringResources.getString(resid);
|
||||||
|
}
|
||||||
|
|
||||||
function getSettingsItem(page, displayName) {
|
function getSettingsItem(page, displayName) {
|
||||||
return {
|
return {
|
||||||
page: page,
|
page: page,
|
||||||
@@ -18,7 +22,8 @@
|
|||||||
}
|
}
|
||||||
var settingItems = {
|
var settingItems = {
|
||||||
appinstaller: getSettingsItem("appinstaller.html", getLibRes("appinstaller.exe", 300)),
|
appinstaller: getSettingsItem("appinstaller.html", getLibRes("appinstaller.exe", 300)),
|
||||||
settings: getSettingsItem("settings.html", getLibRes("settings.exe", 200))
|
manager: getSettingsItem("manager.html", getStringRes("MANAGER_APPTITLE")),
|
||||||
|
settings: getSettingsItem("settings.html", getLibRes("settings.exe", 200)),
|
||||||
};
|
};
|
||||||
Object.defineProperty(global, "settingPages", {
|
Object.defineProperty(global, "settingPages", {
|
||||||
get: function() { return settingItems; }
|
get: function() { return settingItems; }
|
||||||
|
|||||||
54
shared/html/settings/manager.html
Normal file
54
shared/html/settings/manager.html
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>Package Manager Settings</title>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<script type="text/javascript" src="../js/module.js"></script>
|
||||||
|
<script type="text/javascript" src="../js/polyfill-ie.js"></script>
|
||||||
|
<link rel="stylesheet" href="../libs/winjs/2.0/css/ui-light.css" id="winjs-style">
|
||||||
|
<script type="text/javascript" src="../libs/winjs/1.0/js/base.js"></script>
|
||||||
|
<script type="text/javascript" src="../libs/winjs/1.0/js/ui.js"></script>
|
||||||
|
<script type="text/javascript" src="../js/color.js"></script>
|
||||||
|
<script type="text/javascript" src="../js/promise.js"></script>
|
||||||
|
<script type="text/javascript" src="../js/bridge.js"></script>
|
||||||
|
<script type="text/javascript" src="../js/dpimodes.js"></script>
|
||||||
|
<script type="text/javascript" src="../js/resources.js"></script>
|
||||||
|
<script type="text/javascript" src="../js/animation.js"></script>
|
||||||
|
<link rel="stylesheet" href="../fonts/fonts.css">
|
||||||
|
<script type="text/javascript" src="../js/event.js"></script>
|
||||||
|
<script type="text/javascript" src="../js/tileback.js"></script>
|
||||||
|
<script type="text/javascript" src="../js/load.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="../libs/msgbox/msgbox.css">
|
||||||
|
<script type="text/javascript" src="../libs/msgbox/msgbox.js"></script>
|
||||||
|
<script type="text/javascript" src="../js/init.js"></script>
|
||||||
|
<script type="text/javascript" src="initsame.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="page.css">
|
||||||
|
<script type="text/javascript" src="manager/preinit.js"></script>
|
||||||
|
<script type="text/javascript" src="manager/items.js"></script>
|
||||||
|
<script type="text/javascript" src="manager/init.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="settingpage" class="pagecontainer full">
|
||||||
|
<div class="page full guide">
|
||||||
|
<aside class="left win-ui-dark">
|
||||||
|
<header aria-label="Header content" role="banner" class="titlebanner" id="pagebanner" style="height: 120px;">
|
||||||
|
<button id="back" class="win-backbutton pagetitlewb-backbutton" onclick="Bridge.Frame.callEvent ('InvokeBackPage')" style="margin-left: 20px; transform: scale(0.72);"></button>
|
||||||
|
<h2 class="titlearea win-type-ellipsis" id="apptitle" style="">
|
||||||
|
<span class="pagetitlewb-title" id="apptitlestr" style="margin-left: 10px; margin-right: 20px;" data-res-resxml="MANAGER_APPTITLE"></span>
|
||||||
|
</h2>
|
||||||
|
</header>
|
||||||
|
<nav class="container">
|
||||||
|
<ul class="list">
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</aside>
|
||||||
|
<iframe class="main right" defer loading="lazy" async></iframe>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
146
shared/html/settings/manager/general.html
Normal file
146
shared/html/settings/manager/general.html
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>App Installer Settings</title>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<script type="text/javascript" src="../../js/module.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/polyfill-ie.js"></script>
|
||||||
|
<link rel="stylesheet" href="../../libs/winjs/2.0/css/ui-light.css" id="winjs-style">
|
||||||
|
<script type="text/javascript" src="../../libs/winjs/1.0/js/base.js"></script>
|
||||||
|
<script type="text/javascript" src="../../libs/winjs/1.0/js/ui.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/color.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/promise.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/bridge.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/dpimodes.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/resources.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/animation.js"></script>
|
||||||
|
<link rel="stylesheet" href="../../fonts/fonts.css">
|
||||||
|
<script type="text/javascript" src="../../js/event.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/tileback.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/load.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../libs/msgbox/msgbox.css">
|
||||||
|
<script type="text/javascript" src="../../libs/msgbox/msgbox.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../libs/toggle/toggle.css">
|
||||||
|
<script type="text/javascript" src="../../libs/toggle/toggle.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/init.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="../page.css">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../subpage.css">
|
||||||
|
<script type="text/javascript" src="preinit.js"></script>
|
||||||
|
<script type="text/javascript" src="initsame.js"></script>
|
||||||
|
<script>
|
||||||
|
try {
|
||||||
|
window.parent.setItemHighlight("general");
|
||||||
|
} catch (e) {}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="pagecontainer full pagesection">
|
||||||
|
<div class="section padding">
|
||||||
|
<div class="bottom-compensate">
|
||||||
|
<h2 id="page-title" data-res-fromfile="publicRes (101)"></h2>
|
||||||
|
<div class="win-settings-section">
|
||||||
|
<br>
|
||||||
|
<label class="win-label" for="save-wnd-size" id="save-wnd-size-label" data-res-fromfile="publicRes (125)"></label>
|
||||||
|
<script>
|
||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
var label = document.getElementById("save-wnd-size-label");
|
||||||
|
var toggle = new Toggle();
|
||||||
|
toggle.create();
|
||||||
|
toggle.parent = label.parentNode;
|
||||||
|
toggle.showlabel = true;
|
||||||
|
var winjsres = Bridge.External.WinJsStringRes;
|
||||||
|
toggle.setStatusText(winjsres.getString("ms-resource://Microsoft.WinJS.1.0/ui/on"), winjsres.getString("ms-resource://Microsoft.WinJS.1.0/ui/off"));
|
||||||
|
toggle.inputId = "save-wnd-size";
|
||||||
|
var ini = Bridge.External.Config.GetConfig();
|
||||||
|
toggle.addEventListener("change", function() {
|
||||||
|
ini.set("Settings", "PackageManager:SavePosAndSizeBeforeCancel", toggle.checked);
|
||||||
|
});
|
||||||
|
toggle.checked = parseBool(ini.getSection("Settings").getKey("PackageManager:SavePosAndSizeBeforeCancel").value);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<div class="win-settings-section">
|
||||||
|
<br>
|
||||||
|
<label class="win-label" for="default-wndwidth" data-res-fromfile="publicRes(126)"></label><br>
|
||||||
|
<input type="number" id="default-wndwidth" inputmode="numeric"><br><br>
|
||||||
|
<label class="win-label" for="default-wndheight" data-res-fromfile="publicRes(127)"></label><br>
|
||||||
|
<input type="number" id="default-wndheight" inputmode="numeric">
|
||||||
|
<script>
|
||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
var ini = Bridge.External.Config.GetConfig();
|
||||||
|
var defWndWInput = document.getElementById("default-wndwidth");
|
||||||
|
var defWndHInput = document.getElementById("default-wndheight");
|
||||||
|
var setsect = ini.getSection("Settings");
|
||||||
|
var defwk = setsect.getKey("PackageManager:DefaultWidth");
|
||||||
|
var defhk = setsect.getKey("PackageManager:DefaultHeight");
|
||||||
|
defWndWInput.value = defwk.value;
|
||||||
|
defWndHInput.value = defhk.value;
|
||||||
|
var eventutil = Windows.UI.Event.Util;
|
||||||
|
|
||||||
|
function inputDefaultWidthChangeEvent(e) {
|
||||||
|
defwk.value = parseInt(defWndWInput.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
function inputDefaultHeightChangeEvent(e) {
|
||||||
|
defhk.value = parseInt(defWndHInput.value);
|
||||||
|
}
|
||||||
|
var debounced_idwc = debounce(inputDefaultWidthChangeEvent, 500);
|
||||||
|
var debounced_idhc = debounce(inputDefaultHeightChangeEvent, 500);
|
||||||
|
eventutil.addEvent(defWndWInput, "input", debounced_idwc);
|
||||||
|
eventutil.addEvent(defWndWInput, "propertychange", debounced_idwc);
|
||||||
|
eventutil.addEvent(defWndWInput, "change", debounced_idwc);
|
||||||
|
eventutil.addEvent(defWndHInput, "input", debounced_idhc);
|
||||||
|
eventutil.addEvent(defWndHInput, "propertychange", debounced_idhc);
|
||||||
|
eventutil.addEvent(defWndHInput, "change", debounced_idhc);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<div class="win-settings-section">
|
||||||
|
<br>
|
||||||
|
<label class="win-label" for="min-wndwidth" data-res-fromfile="publicRes (128)"></label><br>
|
||||||
|
<input type="number" id="min-wndwidth" inputmode="numeric"><br><br>
|
||||||
|
<label class="win-label" for="min-wndheight" data-res-fromfile="publicRes (129)"></label><br>
|
||||||
|
<input type="number" id="min-wndheight" inputmode="numeric">
|
||||||
|
<script>
|
||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
var ini = Bridge.External.Config.GetConfig();
|
||||||
|
var minWndWInput = document.getElementById("min-wndwidth");
|
||||||
|
var minWndHInput = document.getElementById("min-wndheight");
|
||||||
|
var setsect = ini.getSection("Settings");
|
||||||
|
var minwk = setsect.getKey("PackageManager:MinimumWidth");
|
||||||
|
var minhk = setsect.getKey("PackageManager:MinimumHeight");
|
||||||
|
minWndWInput.value = minwk.value;
|
||||||
|
minWndHInput.value = minhk.value;
|
||||||
|
var eventutil = Windows.UI.Event.Util;
|
||||||
|
|
||||||
|
function inputDefaultWidthChangeEvent(e) {
|
||||||
|
minwk.value = parseInt(minWndWInput.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
function inputDefaultHeightChangeEvent(e) {
|
||||||
|
minhk.value = parseInt(minWndHInput.value);
|
||||||
|
}
|
||||||
|
var debounced_idwc = debounce(inputDefaultWidthChangeEvent, 500);
|
||||||
|
var debounced_idhc = debounce(inputDefaultHeightChangeEvent, 500);
|
||||||
|
eventutil.addEvent(minWndWInput, "input", debounced_idwc);
|
||||||
|
eventutil.addEvent(minWndWInput, "propertychange", debounced_idwc);
|
||||||
|
eventutil.addEvent(minWndWInput, "change", debounced_idwc);
|
||||||
|
eventutil.addEvent(minWndHInput, "input", debounced_idhc);
|
||||||
|
eventutil.addEvent(minWndHInput, "propertychange", debounced_idhc);
|
||||||
|
eventutil.addEvent(minWndHInput, "change", debounced_idhc);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
60
shared/html/settings/manager/guide.html
Normal file
60
shared/html/settings/manager/guide.html
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>App Installer Settings</title>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<script type="text/javascript" src="../../js/module.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/polyfill-ie.js"></script>
|
||||||
|
<link rel="stylesheet" href="../../libs/winjs/2.0/css/ui-light.css" id="winjs-style">
|
||||||
|
<script type="text/javascript" src="../../libs/winjs/1.0/js/base.js"></script>
|
||||||
|
<script type="text/javascript" src="../../libs/winjs/1.0/js/ui.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/color.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/promise.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/bridge.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/dpimodes.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/resources.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/animation.js"></script>
|
||||||
|
<link rel="stylesheet" href="../../fonts/fonts.css">
|
||||||
|
<script type="text/javascript" src="../../js/event.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/tileback.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/load.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../libs/msgbox/msgbox.css">
|
||||||
|
<script type="text/javascript" src="../../libs/msgbox/msgbox.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/init.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="../page.css">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../subpage.css">
|
||||||
|
<script type="text/javascript" src="preinit.js"></script>
|
||||||
|
<script type="text/javascript" src="initsame.js"></script>
|
||||||
|
<script>
|
||||||
|
try {
|
||||||
|
window.parent.setItemHighlight("guide");
|
||||||
|
} catch (e) {}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="pagecontainer full pagesection">
|
||||||
|
<div class="section padding">
|
||||||
|
<div class="bottom-compensate">
|
||||||
|
<h2 id="guide-title"></h2>
|
||||||
|
<p id="guide-desc" style="white-space: pre-wrap;"></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
(function() {
|
||||||
|
"use strict";
|
||||||
|
var res = Bridge.Resources;
|
||||||
|
var stru = Bridge.String;
|
||||||
|
var title = document.getElementById("guide-title");
|
||||||
|
title.textContent = stru.format(res.byname("IDS_TITLEFORMAT"), stringRes("MANAGER_APPTITLE"));
|
||||||
|
var text = document.getElementById("guide-desc");
|
||||||
|
text.textContent = res.byname("IDS_GUIDETEXT_COMMON");
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
96
shared/html/settings/manager/init.js
Normal file
96
shared/html/settings/manager/init.js
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
(function(global) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
function ready(e) {
|
||||||
|
var page = document.querySelector("#settingpage");
|
||||||
|
var guide = page.querySelector(".page.guide");
|
||||||
|
var slide = guide.querySelector("aside");
|
||||||
|
setTimeout(function() {
|
||||||
|
var barcolor = visual["BackgroundColor"];
|
||||||
|
slide.style.backgroundColor = barcolor;
|
||||||
|
slide.style.color = Color.getSuitableForegroundTextColor(Color.parse(barcolor), [Color.Const.white, Color.Const.black]).stringify();
|
||||||
|
}, 50);
|
||||||
|
var content = guide.querySelector(".main");
|
||||||
|
var list = slide.querySelector("ul");
|
||||||
|
var backbtn = slide.querySelector("#back");
|
||||||
|
var title = slide.querySelector("#apptitle");
|
||||||
|
list.innerHTML = "";
|
||||||
|
var items = pages;
|
||||||
|
var tags = Object.keys(items);
|
||||||
|
var eventutil = Windows.UI.Event.Util;
|
||||||
|
for (var i = 0; i < tags.length; i++) {
|
||||||
|
var tag = tags[i];
|
||||||
|
var item = items[tag];
|
||||||
|
var li = document.createElement("li");
|
||||||
|
li.setAttribute("data-page", item.page);
|
||||||
|
li.setAttribute("data-tag", item.tag);
|
||||||
|
li.innerHTML = item.title;
|
||||||
|
eventutil.addEvent(li, "click", function() {
|
||||||
|
if (li.hasAttribute("data-require-disabled")) return;
|
||||||
|
content.style.display = "none";
|
||||||
|
for (var j = 0; j < list.children.length; j++) {
|
||||||
|
var child = list.children[j];
|
||||||
|
if (child.classList.contains("selected"))
|
||||||
|
child.classList.remove("selected");
|
||||||
|
}
|
||||||
|
content.src = this.getAttribute("data-page");
|
||||||
|
setTimeout(function() {
|
||||||
|
content.style.display = "";
|
||||||
|
Windows.UI.Animation.runAsync(content, [Windows.UI.Animation.Keyframes.Flyout.toLeft, Windows.UI.Animation.Keyframes.Opacity.visible]);
|
||||||
|
}, 0);
|
||||||
|
this.classList.add("selected");
|
||||||
|
});
|
||||||
|
list.appendChild(li);
|
||||||
|
}
|
||||||
|
content.src = guidePage.page;
|
||||||
|
/*for (var i = 0; i < list.children.length; i++) {
|
||||||
|
var child = list.children[i];
|
||||||
|
child.click();
|
||||||
|
break;
|
||||||
|
}*/
|
||||||
|
var jumppage = "";
|
||||||
|
try { var args = cmdargs; if (args.length > 1) jumppage = args[1]; } catch (e) {}
|
||||||
|
if (jumppage && jumppage.length > 0 && !Bridge.External.jump2) {
|
||||||
|
for (var i = 0; i < list.children.length; i++) {
|
||||||
|
var child = list.children[i];
|
||||||
|
if (Bridge.NString.equals(child.getAttribute("data-tag"), jumppage)) {
|
||||||
|
Bridge.External.jump2 = true;
|
||||||
|
setTimeout(function(thisnode) {
|
||||||
|
thisnode.click();
|
||||||
|
}, 0, child)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
global.setDisabledForOperation = function(disabled) {
|
||||||
|
var list = document.querySelector("#settingpage .guide aside ul");
|
||||||
|
for (var i = 0; i < list.children.length; i++) {
|
||||||
|
var child = list.children[i];
|
||||||
|
if (disabled) {
|
||||||
|
child.setAttribute("data-require-disabled", "true");
|
||||||
|
} else {
|
||||||
|
child.removeAttribute("data-require-disabled");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (disabled) {
|
||||||
|
backbtn.disabled = true;
|
||||||
|
title.style.marginLeft = backbtn.style.marginLeft;
|
||||||
|
} else {
|
||||||
|
backbtn.disabled = false;
|
||||||
|
title.style.marginLeft = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
global.setItemHighlight = function(tag) {
|
||||||
|
var list = document.querySelector("#settingpage .guide aside ul");
|
||||||
|
for (var i = 0; i < list.children.length; i++) {
|
||||||
|
var child = list.children[i];
|
||||||
|
if (Bridge.NString.equals(child.getAttribute("data-tag"), tag)) {
|
||||||
|
if (!child.classList.contains("selected")) child.classList.add("selected");
|
||||||
|
} else {
|
||||||
|
if (child.classList.contains("selected")) child.classList.remove("selected");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OnLoad.add(ready);
|
||||||
|
})(this);
|
||||||
21
shared/html/settings/manager/initsame.js
Normal file
21
shared/html/settings/manager/initsame.js
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
(function(global) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
function ready(e) {
|
||||||
|
Windows.UI.DPI.mode = 1
|
||||||
|
var pagesection = document.querySelector(".pagesection");
|
||||||
|
if (pagesection) {
|
||||||
|
var backcolor = slideback;
|
||||||
|
setTimeout(function() {
|
||||||
|
var h2style = document.getElementById("h2-style");
|
||||||
|
if (!h2style) {
|
||||||
|
h2style = document.createElement("style");
|
||||||
|
h2style.id = "h2-style";
|
||||||
|
}
|
||||||
|
h2style.innerHTML = ".main h2 { color: " + Color.getSuitableForegroundTextColor(Color.parse("#F3F3F3"), [Color.parse(backcolor), Color.Const.black]).RGBA.stringify() + " }";
|
||||||
|
document.head.appendChild(h2style);
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OnLoad.add(ready);
|
||||||
|
})(this);
|
||||||
24
shared/html/settings/manager/items.js
Normal file
24
shared/html/settings/manager/items.js
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
(function(global) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
function getPage(tag, page, display) {
|
||||||
|
return {
|
||||||
|
tag: tag,
|
||||||
|
page: page,
|
||||||
|
title: display
|
||||||
|
};
|
||||||
|
}
|
||||||
|
var pages = {
|
||||||
|
general: getPage("general", "manager/general.html", getPublicRes(101)),
|
||||||
|
};
|
||||||
|
Object.defineProperty(global, "pages", {
|
||||||
|
get: function() {
|
||||||
|
return pages;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Object.defineProperty(global, "guidePage", {
|
||||||
|
get: function() {
|
||||||
|
return getPage("guide", "manager/guide.html", "guide");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})(this);
|
||||||
30
shared/html/settings/manager/preinit.js
Normal file
30
shared/html/settings/manager/preinit.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
(function(global) {
|
||||||
|
var storage = Bridge.External.Storage;
|
||||||
|
var path = storage.path;
|
||||||
|
var root = path.getDir(path.program);
|
||||||
|
var exepath = path.combine(root, "settings.exe");
|
||||||
|
var id = "Manager";
|
||||||
|
var ve = Bridge.External.VisualElements.get(id);
|
||||||
|
var slideback = ve["BackgroundColor"];
|
||||||
|
global.slideback = slideback;
|
||||||
|
global.exepath = exepath;
|
||||||
|
global.visual = ve;
|
||||||
|
var strutil = Bridge.External.String;
|
||||||
|
var nstrutil = Bridge.NString;
|
||||||
|
var boolTrue = ["true", "1", "yes", "on", "y", "t", "zhen", "真"];
|
||||||
|
var boolFalse = ["false", "0", "no", "off", "n", "f", "jia", "假"];
|
||||||
|
global.parseBool = function(str) {
|
||||||
|
str = "" + str;
|
||||||
|
for (var i = 0; i < boolTrue.length; i++) {
|
||||||
|
if (nstrutil.equals(str, boolTrue[i])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (var i = 0; i < boolFalse.length; i++) {
|
||||||
|
if (nstrutil.equals(str, boolFalse[i])) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
})(this);
|
||||||
@@ -354,8 +354,244 @@
|
|||||||
<lang name="zh-CN">正在卸载... {0}%</lang>
|
<lang name="zh-CN">正在卸载... {0}%</lang>
|
||||||
<lang name="en-US">Uninstalling... {0}%</lang>
|
<lang name="en-US">Uninstalling... {0}%</lang>
|
||||||
</resource>
|
</resource>
|
||||||
<resource id="MANAGER_APP_UNINSTALL_SUCCEED">
|
<resource id="MANAGER_APP_UNINSTALL_SUCCEED">
|
||||||
<lang name="zh-CN">已成功卸载。</lang>
|
<lang name="zh-CN">已成功卸载。</lang>
|
||||||
<lang name="en-US">Uninstall succeeded.</lang>
|
<lang name="en-US">Uninstall succeeded.</lang>
|
||||||
</resource>
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_TITLE">
|
||||||
|
<lang name="zh-CN">创建桌面快捷方式</lang>
|
||||||
|
<lang name="en-US">Create Desktop Shortcut</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_DESC">
|
||||||
|
<lang name="zh-CN">桌面上将创建一个快捷方式,作为启动 Windows 商店应用的入口点。由于 Windows 8.x 的限制,此操作将通过启动程序(使用参数)来实现;请勿将其固定到“开始”菜单。</lang>
|
||||||
|
<lang name="en-US">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.</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_ICONTYPE">
|
||||||
|
<lang name="zh-CN">请选择设置图标设置模式。</lang>
|
||||||
|
<lang name="en-US">Please select the icon settings mode.</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_ICONTYPE_GEN">
|
||||||
|
<lang name="zh-CN">生成新的图标</lang>
|
||||||
|
<lang name="en-US">Generate new icon</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_ICONTYPE_SEL">
|
||||||
|
<lang name="zh-CN">选择现有图标</lang>
|
||||||
|
<lang name="en-US">Select existing icon</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_ICONTYPE_SEL_ICONPATH">
|
||||||
|
<lang name="zh-CN">请选择图标路径: </lang>
|
||||||
|
<lang name="en-US">Please select icon path: </lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_BROWSE">
|
||||||
|
<lang name="zh-CN">浏览...</lang>
|
||||||
|
<lang name="en-US">Browse...</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_PREVIEW">
|
||||||
|
<lang name="zh-CN">预览:</lang>
|
||||||
|
<lang name="en-US">Preview:</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_SELECT">
|
||||||
|
<lang name="zh-CN">选择</lang>
|
||||||
|
<lang name="en-US">Select</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_GENERATE">
|
||||||
|
<lang name="zh-CN">创建</lang>
|
||||||
|
<lang name="en-US">Create</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_CANCEL">
|
||||||
|
<lang name="zh-CN">取消</lang>
|
||||||
|
<lang name="en-US">Cancel</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_BACKGROUNDCOLOR">
|
||||||
|
<lang name="zh-CN">背景颜色</lang>
|
||||||
|
<lang name="en-US">Background Color</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_RATIO">
|
||||||
|
<lang name="zh-CN">背景与前景的边长比</lang>
|
||||||
|
<lang name="en-US">Background-to-foreground edge ratio</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_RATIO_CUSTOM">
|
||||||
|
<lang name="zh-CN">自定义</lang>
|
||||||
|
<lang name="en-US">Custom</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_RATIO_CUSTOMRATIO">
|
||||||
|
<lang name="zh-CN">自定义比例</lang>
|
||||||
|
<lang name="en-US">Custom Ratio</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_DISPLAYNAME">
|
||||||
|
<lang name="zh-CN">快捷方式显示名</lang>
|
||||||
|
<lang name="en-US">Shortcut Display Name</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_IMAGELIST">
|
||||||
|
<lang name="zh-CN">图片列表</lang>
|
||||||
|
<lang name="en-US">Image List</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_SIZE">
|
||||||
|
<lang name="zh-CN">尺寸</lang>
|
||||||
|
<lang name="en-US">Size</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_IMAGE">
|
||||||
|
<lang name="zh-CN">图像</lang>
|
||||||
|
<lang name="en-US">Image</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_LOADING">
|
||||||
|
<lang name="zh-CN">请稍候...</lang>
|
||||||
|
<lang name="en-US">Please wait...</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_SETIMG_TITLE">
|
||||||
|
<lang name="zh-CN">设置当前图片</lang>
|
||||||
|
<lang name="en-US">Set Current Image</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_SETIMG_CURRSIZE">
|
||||||
|
<lang name="zh-CN">当前尺寸</lang>
|
||||||
|
<lang name="en-US">Current Size</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_SETIMG_USEDEF">
|
||||||
|
<lang name="zh-CN">使用预设资源</lang>
|
||||||
|
<lang name="en-US">Use Default Resources</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_SETIMG_USEFILE">
|
||||||
|
<lang name="zh-CN">使用自定义文件</lang>
|
||||||
|
<lang name="en-US">Use Custom File</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_SETIMG_FILEPATH">
|
||||||
|
<lang name="zh-CN">文件路径</lang>
|
||||||
|
<lang name="en-US">File Path</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_SETIMG_SET">
|
||||||
|
<lang name="zh-CN">设置</lang>
|
||||||
|
<lang name="en-US">Set</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_ASK_ICONEXISTS">
|
||||||
|
<lang name="zh-CN">发现图标文件已经存在,是否继续生成?生成的图标文件不会覆盖已有文件。</lang>
|
||||||
|
<lang name="en-US">Icon file already exists, do you want to continue generating? The generated icon file will not overwrite existing files.</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_BACK_TITLE">
|
||||||
|
<lang name="zh-CN">正在生成快捷方式</lang>
|
||||||
|
<lang name="en-US">Generating Shortcut</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_BACK_TEXT_ING">
|
||||||
|
<lang name="zh-CN">正在生成快捷方式...</lang>
|
||||||
|
<lang name="en-US">Generating Shortcut...</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_BACK_TITLE_SUCCEED">
|
||||||
|
<lang name="zh-CN">已生成快捷方式</lang>
|
||||||
|
<lang name="en-US">Shortcut Generated</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_BACK_TEXT_SUCCEED">
|
||||||
|
<lang name="zh-CN">已成功生成快捷方式。</lang>
|
||||||
|
<lang name="en-US">Shortcut generated successfully.</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_BACK_TITLE_FAILED">
|
||||||
|
<lang name="zh-CN">生成时出现问题</lang>
|
||||||
|
<lang name="en-US">Error Generating Shortcut</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP_SHORTCUTCREATE_OPENINSTALLLOCATION">
|
||||||
|
<lang name="zh-CN">打开安装位置</lang>
|
||||||
|
<lang name="en-US">Open Install Location</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_APP">
|
||||||
|
<lang name="zh-CN">应用信息</lang>
|
||||||
|
<lang name="en-US">App Information</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD">
|
||||||
|
<lang name="zh-CN">安装与注册</lang>
|
||||||
|
<lang name="en-US">Install & Register</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_DESC">
|
||||||
|
<lang name="zh-CN">在这里,可以进行对应用的安装、注册等操作。</lang>
|
||||||
|
<lang name="en-US">Here, you can perform installations, registrations, and other operations on apps.</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_INSTALL">
|
||||||
|
<lang name="zh-CN">安装</lang>
|
||||||
|
<lang name="en-US">Install</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_INSTALL_BTN">
|
||||||
|
<lang name="zh-CN">安装</lang>
|
||||||
|
<lang name="en-US">Install</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_INSTALL_DESC">
|
||||||
|
<lang name="zh-CN">将应用部署到系统中。</lang>
|
||||||
|
<lang name="en-US">Deploy the app to the system.</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_DEPLOY_OPTIONS">
|
||||||
|
<lang name="zh-CN">部署选项</lang>
|
||||||
|
<lang name="en-US">Deploy Options</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_DEPLOY_OPTIONS_DEVELOPMENT_MODE">
|
||||||
|
<lang name="zh-CN">开发模式</lang>
|
||||||
|
<lang name="en-US">Development Mode</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_DEPLOY_OPTIONS_FORCE_APP_SHUTDOWN">
|
||||||
|
<lang name="zh-CN">强制关闭应用</lang>
|
||||||
|
<lang name="en-US">Force App Shutdown</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_DEPLOY_OPTIONS_INSTALL_ALL_RESOURCES">
|
||||||
|
<lang name="zh-CN">安装所有资源 (对于捆绑包)</lang>
|
||||||
|
<lang name="en-US">Install All Resources (for Bundle Packages)</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_REGISTER">
|
||||||
|
<lang name="zh-CN">注册</lang>
|
||||||
|
<lang name="en-US">Register</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_REGISTER_BTN">
|
||||||
|
<lang name="zh-CN">注册</lang>
|
||||||
|
<lang name="en-US">Register</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_REGISTER_DESC">
|
||||||
|
<lang name="zh-CN">将应用清单注册到系统中。</lang>
|
||||||
|
<lang name="en-US">Register the app manifest to the system.</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_STAGE">
|
||||||
|
<lang name="zh-CN">预部署</lang>
|
||||||
|
<lang name="en-US">Stage</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_STAGE_DESC">
|
||||||
|
<lang name="zh-CN">将应用预部署到系统中。</lang>
|
||||||
|
<lang name="en-US">Stage the app to the system.</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_STAGE_BTN">
|
||||||
|
<lang name="zh-CN">预部署</lang>
|
||||||
|
<lang name="en-US">Stage</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_INSTALL_ING">
|
||||||
|
<lang name="zh-CN">正在安装... {0}</lang>
|
||||||
|
<lang name="en-US">Installing... {0}</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_REGISTER_ING">
|
||||||
|
<lang name="zh-CN">正在注册... {0}</lang>
|
||||||
|
<lang name="en-US">Registering... {0}</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_STAGE_ING">
|
||||||
|
<lang name="zh-CN">正在预部署... {0}</lang>
|
||||||
|
<lang name="en-US">Staging... {0}</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_INSTALL_SUCCEED">
|
||||||
|
<lang name="zh-CN">安装完成</lang>
|
||||||
|
<lang name="en-US">Install Complete.</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_REGISTER_SUCCEED">
|
||||||
|
<lang name="zh-CN">注册完成</lang>
|
||||||
|
<lang name="en-US">Registration Complete.</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_STAGE_SUCCEED">
|
||||||
|
<lang name="zh-CN">预部署完成</lang>
|
||||||
|
<lang name="en-US">Staging Complete.</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_INS_OR_STA_FILTERDISPLAY">
|
||||||
|
<lang name="zh-CN">Windows 商店应用包 (*.appx, *.appxbundle, *.msix, *.msixbundle)</lang>
|
||||||
|
<lang name="en-US">Windows Store App Package (*.appx, *.appxbundle, *.msix, *.msixbundle)</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_REG_FILTERDISPLAY">
|
||||||
|
<lang name="zh-CN">Windows 商店应用清单文件 (*.appxmanifest, *AppxManifest.xml)</lang>
|
||||||
|
<lang name="en-US">Windows Store App Manifest File (*.appxmanifest, *AppxManifest.xml)</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_LOAD_ALLFILES">
|
||||||
|
<lang name="zh-CN">所有文件 (*.*)</lang>
|
||||||
|
<lang name="en-US">All Files (*.*)</lang>
|
||||||
|
</resource>
|
||||||
|
<resource id="MANAGER_SETTINGS">
|
||||||
|
<lang name="zh-CN">设置</lang>
|
||||||
|
<lang name="en-US">Settings</lang>
|
||||||
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -1 +1 @@
|
|||||||
0.2.2.3
|
0.3.0.0
|
||||||
Reference in New Issue
Block a user