From 67f14d6a62261038eb7b0dca4ba3a5d3ba95eb3c Mon Sep 17 00:00:00 2001 From: qianlifeng Date: Thu, 6 Feb 2014 22:22:02 +0800 Subject: [PATCH] Add start Wox on system startup config & code refactorying. --- .../ChineseToPinYin.cs | 254 ++++++++--------- .../IniParser.cs | 2 +- Wox.Infrastructure/UAC.cs | 96 +++++++ Wox.Infrastructure/Wox.Infrastructure.csproj | 7 + Wox.Plugin.System/BrowserBookmarks.cs | 2 +- Wox.Plugin.System/Programs.cs | 2 +- Wox.Plugin.System/Wox.Plugin.System.csproj | 1 - Wox.Plugin/AllowedLanguage.cs | 2 +- {Wox.WorkflowInstaller => Wox.UAC}/App.xaml | 2 +- .../App.xaml.cs | 32 +-- .../MainWindow.xaml | 2 +- Wox.UAC/MainWindow.xaml.cs | 47 +++ .../Properties/AssemblyInfo.cs | 110 +++---- .../Properties/Resources.Designer.cs | 142 +++++----- .../Properties/Resources.resx | 0 .../Properties/Settings.Designer.cs | 4 +- .../Properties/Settings.settings | 0 .../Wox.UAC.csproj | 268 +++++++++--------- {Wox.WorkflowInstaller => Wox.UAC}/app.ico | Bin 370070 -> 370070 bytes .../app.manifest | 101 +++---- Wox.UAC/packages.config | 4 + Wox.WorkflowInstaller/packages.config | 4 - Wox.sln | 64 +++-- Wox/Commands/PluginCommand.cs | 5 +- Wox/Helper/IniParser.cs | 217 -------------- .../Helper/PluginInstaller.cs | 136 ++++----- Wox/MainWindow.xaml.cs | 4 +- Wox/PluginLoader/BasePluginLoader.cs | 1 + Wox/SettingWindow.xaml | 14 +- Wox/SettingWindow.xaml.cs | 54 ++++ Wox/WebSearchSetting.xaml | 11 +- Wox/WebSearchSetting.xaml.cs | 35 ++- Wox/Wox.csproj | 6 +- 33 files changed, 818 insertions(+), 811 deletions(-) rename {Wox.Plugin.System/Common => Wox.Infrastructure}/ChineseToPinYin.cs (98%) rename {Wox.WorkflowInstaller => Wox.Infrastructure}/IniParser.cs (99%) create mode 100644 Wox.Infrastructure/UAC.cs rename {Wox.WorkflowInstaller => Wox.UAC}/App.xaml (83%) rename {Wox.WorkflowInstaller => Wox.UAC}/App.xaml.cs (88%) rename {Wox.WorkflowInstaller => Wox.UAC}/MainWindow.xaml (81%) create mode 100644 Wox.UAC/MainWindow.xaml.cs rename {Wox.WorkflowInstaller => Wox.UAC}/Properties/AssemblyInfo.cs (73%) rename {Wox.WorkflowInstaller => Wox.UAC}/Properties/Resources.Designer.cs (91%) rename {Wox.WorkflowInstaller => Wox.UAC}/Properties/Resources.resx (100%) rename {Wox.WorkflowInstaller => Wox.UAC}/Properties/Settings.Designer.cs (92%) rename {Wox.WorkflowInstaller => Wox.UAC}/Properties/Settings.settings (100%) rename Wox.WorkflowInstaller/Wox.WorkflowInstaller.csproj => Wox.UAC/Wox.UAC.csproj (70%) rename {Wox.WorkflowInstaller => Wox.UAC}/app.ico (79%) rename {Wox.WorkflowInstaller => Wox.UAC}/app.manifest (74%) create mode 100644 Wox.UAC/packages.config delete mode 100644 Wox.WorkflowInstaller/packages.config delete mode 100644 Wox/Helper/IniParser.cs rename Wox.WorkflowInstaller/MainWindow.xaml.cs => Wox/Helper/PluginInstaller.cs (86%) diff --git a/Wox.Plugin.System/Common/ChineseToPinYin.cs b/Wox.Infrastructure/ChineseToPinYin.cs similarity index 98% rename from Wox.Plugin.System/Common/ChineseToPinYin.cs rename to Wox.Infrastructure/ChineseToPinYin.cs index 56d82863f..9be18b279 100644 --- a/Wox.Plugin.System/Common/ChineseToPinYin.cs +++ b/Wox.Infrastructure/ChineseToPinYin.cs @@ -1,127 +1,127 @@ -using System.Collections.Generic; -using System.Text; - -//From:http://blog.csdn.net/chamychen/article/details/7976125 -namespace Wox.Plugin.System.Common -{ - public static class ChineseToPinYin - { - private static readonly Dictionary CodeCollections = new Dictionary { - { -20319, "a" }, { -20317, "ai" }, { -20304, "an" }, { -20295, "ang" }, { -20292, "ao" }, { -20283, "ba" }, { -20265, "bai" }, -{ -20257, "ban" }, { -20242, "bang" }, { -20230, "bao" }, { -20051, "bei" }, { -20036, "ben" }, { -20032, "beng" }, { -20026, "bi" } -, { -20002, "bian" }, { -19990, "biao" }, { -19986, "bie" }, { -19982, "bin" }, { -19976, "bing" }, { -19805, "bo" }, -{ -19784, "bu" }, { -19775, "ca" }, { -19774, "cai" }, { -19763, "can" }, { -19756, "cang" }, { -19751, "cao" }, { -19746, "ce" }, - { -19741, "ceng" }, { -19739, "cha" }, { -19728, "chai" }, { -19725, "chan" }, { -19715, "chang" }, { -19540, "chao" }, -{ -19531, "che" }, { -19525, "chen" }, { -19515, "cheng" }, { -19500, "chi" }, { -19484, "chong" }, { -19479, "chou" }, -{ -19467, "chu" }, { -19289, "chuai" }, { -19288, "chuan" }, { -19281, "chuang" }, { -19275, "chui" }, { -19270, "chun" }, - { -19263, "chuo" }, { -19261, "ci" }, { -19249, "cong" }, { -19243, "cou" }, { -19242, "cu" }, { -19238, "cuan" }, -{ -19235, "cui" }, { -19227, "cun" }, { -19224, "cuo" }, { -19218, "da" }, { -19212, "dai" }, { -19038, "dan" }, { -19023, "dang" }, - { -19018, "dao" }, { -19006, "de" }, { -19003, "deng" }, { -18996, "di" }, { -18977, "dian" }, { -18961, "diao" }, { -18952, "die" } -, { -18783, "ding" }, { -18774, "diu" }, { -18773, "dong" }, { -18763, "dou" }, { -18756, "du" }, { -18741, "duan" }, -{ -18735, "dui" }, { -18731, "dun" }, { -18722, "duo" }, { -18710, "e" }, { -18697, "en" }, { -18696, "er" }, { -18526, "fa" }, - { -18518, "fan" }, { -18501, "fang" }, { -18490, "fei" }, { -18478, "fen" }, { -18463, "feng" }, { -18448, "fo" }, { -18447, "fou" } -, { -18446, "fu" }, { -18239, "ga" }, { -18237, "gai" }, { -18231, "gan" }, { -18220, "gang" }, { -18211, "gao" }, { -18201, "ge" }, - { -18184, "gei" }, { -18183, "gen" }, { -18181, "geng" }, { -18012, "gong" }, { -17997, "gou" }, { -17988, "gu" }, { -17970, "gua" } -, { -17964, "guai" }, { -17961, "guan" }, { -17950, "guang" }, { -17947, "gui" }, { -17931, "gun" }, { -17928, "guo" }, -{ -17922, "ha" }, { -17759, "hai" }, { -17752, "han" }, { -17733, "hang" }, { -17730, "hao" }, { -17721, "he" }, { -17703, "hei" }, - { -17701, "hen" }, { -17697, "heng" }, { -17692, "hong" }, { -17683, "hou" }, { -17676, "hu" }, { -17496, "hua" }, -{ -17487, "huai" }, { -17482, "huan" }, { -17468, "huang" }, { -17454, "hui" }, { -17433, "hun" }, { -17427, "huo" }, -{ -17417, "ji" }, { -17202, "jia" }, { -17185, "jian" }, { -16983, "jiang" }, { -16970, "jiao" }, { -16942, "jie" }, -{ -16915, "jin" }, { -16733, "jing" }, { -16708, "jiong" }, { -16706, "jiu" }, { -16689, "ju" }, { -16664, "juan" }, -{ -16657, "jue" }, { -16647, "jun" }, { -16474, "ka" }, { -16470, "kai" }, { -16465, "kan" }, { -16459, "kang" }, { -16452, "kao" }, - { -16448, "ke" }, { -16433, "ken" }, { -16429, "keng" }, { -16427, "kong" }, { -16423, "kou" }, { -16419, "ku" }, { -16412, "kua" } -, { -16407, "kuai" }, { -16403, "kuan" }, { -16401, "kuang" }, { -16393, "kui" }, { -16220, "kun" }, { -16216, "kuo" }, -{ -16212, "la" }, { -16205, "lai" }, { -16202, "lan" }, { -16187, "lang" }, { -16180, "lao" }, { -16171, "le" }, { -16169, "lei" }, -{ -16158, "leng" }, { -16155, "li" }, { -15959, "lia" }, { -15958, "lian" }, { -15944, "liang" }, { -15933, "liao" }, -{ -15920, "lie" }, { -15915, "lin" }, { -15903, "ling" }, { -15889, "liu" }, { -15878, "long" }, { -15707, "lou" }, { -15701, "lu" }, - { -15681, "lv" }, { -15667, "luan" }, { -15661, "lue" }, { -15659, "lun" }, { -15652, "luo" }, { -15640, "ma" }, { -15631, "mai" }, - { -15625, "man" }, { -15454, "mang" }, { -15448, "mao" }, { -15436, "me" }, { -15435, "mei" }, { -15419, "men" }, -{ -15416, "meng" }, { -15408, "mi" }, { -15394, "mian" }, { -15385, "miao" }, { -15377, "mie" }, { -15375, "min" }, -{ -15369, "ming" }, { -15363, "miu" }, { -15362, "mo" }, { -15183, "mou" }, { -15180, "mu" }, { -15165, "na" }, { -15158, "nai" }, -{ -15153, "nan" }, { -15150, "nang" }, { -15149, "nao" }, { -15144, "ne" }, { -15143, "nei" }, { -15141, "nen" }, { -15140, "neng" } -, { -15139, "ni" }, { -15128, "nian" }, { -15121, "niang" }, { -15119, "niao" }, { -15117, "nie" }, { -15110, "nin" }, -{ -15109, "ning" }, { -14941, "niu" }, { -14937, "nong" }, { -14933, "nu" }, { -14930, "nv" }, { -14929, "nuan" }, { -14928, "nue" } -, { -14926, "nuo" }, { -14922, "o" }, { -14921, "ou" }, { -14914, "pa" }, { -14908, "pai" }, { -14902, "pan" }, { -14894, "pang" }, - { -14889, "pao" }, { -14882, "pei" }, { -14873, "pen" }, { -14871, "peng" }, { -14857, "pi" }, { -14678, "pian" }, -{ -14674, "piao" }, { -14670, "pie" }, { -14668, "pin" }, { -14663, "ping" }, { -14654, "po" }, { -14645, "pu" }, { -14630, "qi" }, - { -14594, "qia" }, { -14429, "qian" }, { -14407, "qiang" }, { -14399, "qiao" }, { -14384, "qie" }, { -14379, "qin" }, - { -14368, "qing" }, { -14355, "qiong" }, { -14353, "qiu" }, { -14345, "qu" }, { -14170, "quan" }, { -14159, "que" }, -{ -14151, "qun" }, { -14149, "ran" }, { -14145, "rang" }, { -14140, "rao" }, { -14137, "re" }, { -14135, "ren" }, { -14125, "reng" } -, { -14123, "ri" }, { -14122, "rong" }, { -14112, "rou" }, { -14109, "ru" }, { -14099, "ruan" }, { -14097, "rui" }, { -14094, "run" } -, { -14092, "ruo" }, { -14090, "sa" }, { -14087, "sai" }, { -14083, "san" }, { -13917, "sang" }, { -13914, "sao" }, { -13910, "se" } -, { -13907, "sen" }, { -13906, "seng" }, { -13905, "sha" }, { -13896, "shai" }, { -13894, "shan" }, { -13878, "shang" }, -{ -13870, "shao" }, { -13859, "she" }, { -13847, "shen" }, { -13831, "sheng" }, { -13658, "shi" }, { -13611, "shou" }, - { -13601, "shu" }, { -13406, "shua" }, { -13404, "shuai" }, { -13400, "shuan" }, { -13398, "shuang" }, { -13395, "shui" }, - { -13391, "shun" }, { -13387, "shuo" }, { -13383, "si" }, { -13367, "song" }, { -13359, "sou" }, { -13356, "su" }, -{ -13343, "suan" }, { -13340, "sui" }, { -13329, "sun" }, { -13326, "suo" }, { -13318, "ta" }, { -13147, "tai" }, { -13138, "tan" }, - { -13120, "tang" }, { -13107, "tao" }, { -13096, "te" }, { -13095, "teng" }, { -13091, "ti" }, { -13076, "tian" }, -{ -13068, "tiao" }, { -13063, "tie" }, { -13060, "ting" }, { -12888, "tong" }, { -12875, "tou" }, { -12871, "tu" }, -{ -12860, "tuan" }, { -12858, "tui" }, { -12852, "tun" }, { -12849, "tuo" }, { -12838, "wa" }, { -12831, "wai" }, { -12829, "wan" } -, { -12812, "wang" }, { -12802, "wei" }, { -12607, "wen" }, { -12597, "weng" }, { -12594, "wo" }, { -12585, "wu" }, { -12556, "xi" } -, { -12359, "xia" }, { -12346, "xian" }, { -12320, "xiang" }, { -12300, "xiao" }, { -12120, "xie" }, { -12099, "xin" }, -{ -12089, "xing" }, { -12074, "xiong" }, { -12067, "xiu" }, { -12058, "xu" }, { -12039, "xuan" }, { -11867, "xue" }, -{ -11861, "xun" }, { -11847, "ya" }, { -11831, "yan" }, { -11798, "yang" }, { -11781, "yao" }, { -11604, "ye" }, { -11589, "yi" }, - { -11536, "yin" }, { -11358, "ying" }, { -11340, "yo" }, { -11339, "yong" }, { -11324, "you" }, { -11303, "yu" }, -{ -11097, "yuan" }, { -11077, "yue" }, { -11067, "yun" }, { -11055, "za" }, { -11052, "zai" }, { -11045, "zan" }, - { -11041, "zang" }, { -11038, "zao" }, { -11024, "ze" }, { -11020, "zei" }, { -11019, "zen" }, { -11018, "zeng" }, -{ -11014, "zha" }, { -10838, "zhai" }, { -10832, "zhan" }, { -10815, "zhang" }, { -10800, "zhao" }, { -10790, "zhe" }, -{ -10780, "zhen" }, { -10764, "zheng" }, { -10587, "zhi" }, { -10544, "zhong" }, { -10533, "zhou" }, { -10519, "zhu" }, -{ -10331, "zhua" }, { -10329, "zhuai" }, { -10328, "zhuan" }, { -10322, "zhuang" }, { -10315, "zhui" }, { -10309, "zhun" }, -{ -10307, "zhuo" }, { -10296, "zi" }, { -10281, "zong" }, { -10274, "zou" }, { -10270, "zu" }, { -10262, "zuan" }, { -10260, "zui" } -, { -10256, "zun" }, { -10254, "zuo" } }; - /// - /// 汉字转拼音 - /// - /// 需要转换的汉字 - /// 返回汉字对应的拼音 - public static string ToPinYin(string txt) - { - txt = txt.Trim(); - byte[] arr = new byte[2]; //每个汉字为2字节 - StringBuilder result = new StringBuilder();//使用StringBuilder优化字符串连接 - int charCode = 0; - int arr1 = 0; - int arr2 = 0; - char[] arrChar = txt.ToCharArray(); - for (int j = 0; j < arrChar.Length; j++) //遍历输入的字符 - { - arr = Encoding.Default.GetBytes(arrChar[j].ToString());//根据系统默认编码得到字节码 - if (arr.Length == 1)//如果只有1字节说明该字符不是汉字,结束本次循环 - { - result.Append(arrChar[j].ToString()); - continue; - - } - arr1 = (short)(arr[0]); //取字节1 - arr2 = (short)(arr[1]); //取字节2 - charCode = arr1 * 256 + arr2 - 65536;//计算汉字的编码 - - if (charCode > -10254 || charCode < -20319) //如果不在汉字编码范围内则不改变 - { - result.Append(arrChar[j]); - } - else - { - //根据汉字编码范围查找对应的拼音并保存到结果中 - //由于charCode的键不一定存在,所以要找比他更小的键上一个键 - if (!CodeCollections.ContainsKey(charCode)) - { - for (int i = charCode; i <= 0; --i) - { - if (CodeCollections.ContainsKey(i)) - { - result.Append(" " + CodeCollections[i] + " "); - break; - } - } - } - else - { - result.Append(" " + CodeCollections[charCode] + " "); - } - } - } - return result.ToString(); - } - } -} +using System.Collections.Generic; +using System.Text; + +//From:http://blog.csdn.net/chamychen/article/details/7976125 +namespace Wox.Infrastructure +{ + public static class ChineseToPinYin + { + private static readonly Dictionary CodeCollections = new Dictionary { + { -20319, "a" }, { -20317, "ai" }, { -20304, "an" }, { -20295, "ang" }, { -20292, "ao" }, { -20283, "ba" }, { -20265, "bai" }, +{ -20257, "ban" }, { -20242, "bang" }, { -20230, "bao" }, { -20051, "bei" }, { -20036, "ben" }, { -20032, "beng" }, { -20026, "bi" } +, { -20002, "bian" }, { -19990, "biao" }, { -19986, "bie" }, { -19982, "bin" }, { -19976, "bing" }, { -19805, "bo" }, +{ -19784, "bu" }, { -19775, "ca" }, { -19774, "cai" }, { -19763, "can" }, { -19756, "cang" }, { -19751, "cao" }, { -19746, "ce" }, + { -19741, "ceng" }, { -19739, "cha" }, { -19728, "chai" }, { -19725, "chan" }, { -19715, "chang" }, { -19540, "chao" }, +{ -19531, "che" }, { -19525, "chen" }, { -19515, "cheng" }, { -19500, "chi" }, { -19484, "chong" }, { -19479, "chou" }, +{ -19467, "chu" }, { -19289, "chuai" }, { -19288, "chuan" }, { -19281, "chuang" }, { -19275, "chui" }, { -19270, "chun" }, + { -19263, "chuo" }, { -19261, "ci" }, { -19249, "cong" }, { -19243, "cou" }, { -19242, "cu" }, { -19238, "cuan" }, +{ -19235, "cui" }, { -19227, "cun" }, { -19224, "cuo" }, { -19218, "da" }, { -19212, "dai" }, { -19038, "dan" }, { -19023, "dang" }, + { -19018, "dao" }, { -19006, "de" }, { -19003, "deng" }, { -18996, "di" }, { -18977, "dian" }, { -18961, "diao" }, { -18952, "die" } +, { -18783, "ding" }, { -18774, "diu" }, { -18773, "dong" }, { -18763, "dou" }, { -18756, "du" }, { -18741, "duan" }, +{ -18735, "dui" }, { -18731, "dun" }, { -18722, "duo" }, { -18710, "e" }, { -18697, "en" }, { -18696, "er" }, { -18526, "fa" }, + { -18518, "fan" }, { -18501, "fang" }, { -18490, "fei" }, { -18478, "fen" }, { -18463, "feng" }, { -18448, "fo" }, { -18447, "fou" } +, { -18446, "fu" }, { -18239, "ga" }, { -18237, "gai" }, { -18231, "gan" }, { -18220, "gang" }, { -18211, "gao" }, { -18201, "ge" }, + { -18184, "gei" }, { -18183, "gen" }, { -18181, "geng" }, { -18012, "gong" }, { -17997, "gou" }, { -17988, "gu" }, { -17970, "gua" } +, { -17964, "guai" }, { -17961, "guan" }, { -17950, "guang" }, { -17947, "gui" }, { -17931, "gun" }, { -17928, "guo" }, +{ -17922, "ha" }, { -17759, "hai" }, { -17752, "han" }, { -17733, "hang" }, { -17730, "hao" }, { -17721, "he" }, { -17703, "hei" }, + { -17701, "hen" }, { -17697, "heng" }, { -17692, "hong" }, { -17683, "hou" }, { -17676, "hu" }, { -17496, "hua" }, +{ -17487, "huai" }, { -17482, "huan" }, { -17468, "huang" }, { -17454, "hui" }, { -17433, "hun" }, { -17427, "huo" }, +{ -17417, "ji" }, { -17202, "jia" }, { -17185, "jian" }, { -16983, "jiang" }, { -16970, "jiao" }, { -16942, "jie" }, +{ -16915, "jin" }, { -16733, "jing" }, { -16708, "jiong" }, { -16706, "jiu" }, { -16689, "ju" }, { -16664, "juan" }, +{ -16657, "jue" }, { -16647, "jun" }, { -16474, "ka" }, { -16470, "kai" }, { -16465, "kan" }, { -16459, "kang" }, { -16452, "kao" }, + { -16448, "ke" }, { -16433, "ken" }, { -16429, "keng" }, { -16427, "kong" }, { -16423, "kou" }, { -16419, "ku" }, { -16412, "kua" } +, { -16407, "kuai" }, { -16403, "kuan" }, { -16401, "kuang" }, { -16393, "kui" }, { -16220, "kun" }, { -16216, "kuo" }, +{ -16212, "la" }, { -16205, "lai" }, { -16202, "lan" }, { -16187, "lang" }, { -16180, "lao" }, { -16171, "le" }, { -16169, "lei" }, +{ -16158, "leng" }, { -16155, "li" }, { -15959, "lia" }, { -15958, "lian" }, { -15944, "liang" }, { -15933, "liao" }, +{ -15920, "lie" }, { -15915, "lin" }, { -15903, "ling" }, { -15889, "liu" }, { -15878, "long" }, { -15707, "lou" }, { -15701, "lu" }, + { -15681, "lv" }, { -15667, "luan" }, { -15661, "lue" }, { -15659, "lun" }, { -15652, "luo" }, { -15640, "ma" }, { -15631, "mai" }, + { -15625, "man" }, { -15454, "mang" }, { -15448, "mao" }, { -15436, "me" }, { -15435, "mei" }, { -15419, "men" }, +{ -15416, "meng" }, { -15408, "mi" }, { -15394, "mian" }, { -15385, "miao" }, { -15377, "mie" }, { -15375, "min" }, +{ -15369, "ming" }, { -15363, "miu" }, { -15362, "mo" }, { -15183, "mou" }, { -15180, "mu" }, { -15165, "na" }, { -15158, "nai" }, +{ -15153, "nan" }, { -15150, "nang" }, { -15149, "nao" }, { -15144, "ne" }, { -15143, "nei" }, { -15141, "nen" }, { -15140, "neng" } +, { -15139, "ni" }, { -15128, "nian" }, { -15121, "niang" }, { -15119, "niao" }, { -15117, "nie" }, { -15110, "nin" }, +{ -15109, "ning" }, { -14941, "niu" }, { -14937, "nong" }, { -14933, "nu" }, { -14930, "nv" }, { -14929, "nuan" }, { -14928, "nue" } +, { -14926, "nuo" }, { -14922, "o" }, { -14921, "ou" }, { -14914, "pa" }, { -14908, "pai" }, { -14902, "pan" }, { -14894, "pang" }, + { -14889, "pao" }, { -14882, "pei" }, { -14873, "pen" }, { -14871, "peng" }, { -14857, "pi" }, { -14678, "pian" }, +{ -14674, "piao" }, { -14670, "pie" }, { -14668, "pin" }, { -14663, "ping" }, { -14654, "po" }, { -14645, "pu" }, { -14630, "qi" }, + { -14594, "qia" }, { -14429, "qian" }, { -14407, "qiang" }, { -14399, "qiao" }, { -14384, "qie" }, { -14379, "qin" }, + { -14368, "qing" }, { -14355, "qiong" }, { -14353, "qiu" }, { -14345, "qu" }, { -14170, "quan" }, { -14159, "que" }, +{ -14151, "qun" }, { -14149, "ran" }, { -14145, "rang" }, { -14140, "rao" }, { -14137, "re" }, { -14135, "ren" }, { -14125, "reng" } +, { -14123, "ri" }, { -14122, "rong" }, { -14112, "rou" }, { -14109, "ru" }, { -14099, "ruan" }, { -14097, "rui" }, { -14094, "run" } +, { -14092, "ruo" }, { -14090, "sa" }, { -14087, "sai" }, { -14083, "san" }, { -13917, "sang" }, { -13914, "sao" }, { -13910, "se" } +, { -13907, "sen" }, { -13906, "seng" }, { -13905, "sha" }, { -13896, "shai" }, { -13894, "shan" }, { -13878, "shang" }, +{ -13870, "shao" }, { -13859, "she" }, { -13847, "shen" }, { -13831, "sheng" }, { -13658, "shi" }, { -13611, "shou" }, + { -13601, "shu" }, { -13406, "shua" }, { -13404, "shuai" }, { -13400, "shuan" }, { -13398, "shuang" }, { -13395, "shui" }, + { -13391, "shun" }, { -13387, "shuo" }, { -13383, "si" }, { -13367, "song" }, { -13359, "sou" }, { -13356, "su" }, +{ -13343, "suan" }, { -13340, "sui" }, { -13329, "sun" }, { -13326, "suo" }, { -13318, "ta" }, { -13147, "tai" }, { -13138, "tan" }, + { -13120, "tang" }, { -13107, "tao" }, { -13096, "te" }, { -13095, "teng" }, { -13091, "ti" }, { -13076, "tian" }, +{ -13068, "tiao" }, { -13063, "tie" }, { -13060, "ting" }, { -12888, "tong" }, { -12875, "tou" }, { -12871, "tu" }, +{ -12860, "tuan" }, { -12858, "tui" }, { -12852, "tun" }, { -12849, "tuo" }, { -12838, "wa" }, { -12831, "wai" }, { -12829, "wan" } +, { -12812, "wang" }, { -12802, "wei" }, { -12607, "wen" }, { -12597, "weng" }, { -12594, "wo" }, { -12585, "wu" }, { -12556, "xi" } +, { -12359, "xia" }, { -12346, "xian" }, { -12320, "xiang" }, { -12300, "xiao" }, { -12120, "xie" }, { -12099, "xin" }, +{ -12089, "xing" }, { -12074, "xiong" }, { -12067, "xiu" }, { -12058, "xu" }, { -12039, "xuan" }, { -11867, "xue" }, +{ -11861, "xun" }, { -11847, "ya" }, { -11831, "yan" }, { -11798, "yang" }, { -11781, "yao" }, { -11604, "ye" }, { -11589, "yi" }, + { -11536, "yin" }, { -11358, "ying" }, { -11340, "yo" }, { -11339, "yong" }, { -11324, "you" }, { -11303, "yu" }, +{ -11097, "yuan" }, { -11077, "yue" }, { -11067, "yun" }, { -11055, "za" }, { -11052, "zai" }, { -11045, "zan" }, + { -11041, "zang" }, { -11038, "zao" }, { -11024, "ze" }, { -11020, "zei" }, { -11019, "zen" }, { -11018, "zeng" }, +{ -11014, "zha" }, { -10838, "zhai" }, { -10832, "zhan" }, { -10815, "zhang" }, { -10800, "zhao" }, { -10790, "zhe" }, +{ -10780, "zhen" }, { -10764, "zheng" }, { -10587, "zhi" }, { -10544, "zhong" }, { -10533, "zhou" }, { -10519, "zhu" }, +{ -10331, "zhua" }, { -10329, "zhuai" }, { -10328, "zhuan" }, { -10322, "zhuang" }, { -10315, "zhui" }, { -10309, "zhun" }, +{ -10307, "zhuo" }, { -10296, "zi" }, { -10281, "zong" }, { -10274, "zou" }, { -10270, "zu" }, { -10262, "zuan" }, { -10260, "zui" } +, { -10256, "zun" }, { -10254, "zuo" } }; + /// + /// 汉字转拼音 + /// + /// 需要转换的汉字 + /// 返回汉字对应的拼音 + public static string ToPinYin(string txt) + { + txt = txt.Trim(); + byte[] arr = new byte[2]; //每个汉字为2字节 + StringBuilder result = new StringBuilder();//使用StringBuilder优化字符串连接 + int charCode = 0; + int arr1 = 0; + int arr2 = 0; + char[] arrChar = txt.ToCharArray(); + for (int j = 0; j < arrChar.Length; j++) //遍历输入的字符 + { + arr = Encoding.Default.GetBytes(arrChar[j].ToString());//根据系统默认编码得到字节码 + if (arr.Length == 1)//如果只有1字节说明该字符不是汉字,结束本次循环 + { + result.Append(arrChar[j].ToString()); + continue; + + } + arr1 = (short)(arr[0]); //取字节1 + arr2 = (short)(arr[1]); //取字节2 + charCode = arr1 * 256 + arr2 - 65536;//计算汉字的编码 + + if (charCode > -10254 || charCode < -20319) //如果不在汉字编码范围内则不改变 + { + result.Append(arrChar[j]); + } + else + { + //根据汉字编码范围查找对应的拼音并保存到结果中 + //由于charCode的键不一定存在,所以要找比他更小的键上一个键 + if (!CodeCollections.ContainsKey(charCode)) + { + for (int i = charCode; i <= 0; --i) + { + if (CodeCollections.ContainsKey(i)) + { + result.Append(" " + CodeCollections[i] + " "); + break; + } + } + } + else + { + result.Append(" " + CodeCollections[charCode] + " "); + } + } + } + return result.ToString(); + } + } +} diff --git a/Wox.WorkflowInstaller/IniParser.cs b/Wox.Infrastructure/IniParser.cs similarity index 99% rename from Wox.WorkflowInstaller/IniParser.cs rename to Wox.Infrastructure/IniParser.cs index 05515093a..95d080d5e 100644 --- a/Wox.WorkflowInstaller/IniParser.cs +++ b/Wox.Infrastructure/IniParser.cs @@ -2,7 +2,7 @@ using System.Collections; using System.IO; -namespace Wox.Helper +namespace Wox.Infrastructure { public class IniParser { diff --git a/Wox.Infrastructure/UAC.cs b/Wox.Infrastructure/UAC.cs new file mode 100644 index 000000000..565c56a60 --- /dev/null +++ b/Wox.Infrastructure/UAC.cs @@ -0,0 +1,96 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security.Principal; +using System.Text; +using System.Windows; +using System.Windows.Forms; +using System.Windows.Media.Imaging; +using Size = System.Drawing.Size; + +namespace Wox.Infrastructure +{ + + public static class UAC + { + /// + /// Execute methods that require Admin role, which will popup UAC window. + /// + /// Notes: + /// 1. Invoker method shouldn't have any parameters + /// 2. Add attribute [MethodImpl(MethodImplOptions.NoInlining)] to invoker method + /// + /// Example: + /// [MethodImpl(MethodImplOptions.NoInlining)] + /// private void OnStartWithWindowUnChecked() + /// { + /// UAC.ExecuteAdminMethod(() => SetStartup(false)); + /// } + /// + /// + /// + public static void ExecuteAdminMethod(Action method) + { + if (method == null) return; + if (Environment.OSVersion.Version.Major <= 5 || IsAdministrator()) + { + method(); + return; + } + + StackTrace stackTrace = new StackTrace(); + // Get calling method name + MethodBase callingMethod = stackTrace.GetFrame(1).GetMethod(); + string methodName = callingMethod.Name; + if (callingMethod.ReflectedType == null) return; + + string className = callingMethod.ReflectedType.Name; + string nameSpace = callingMethod.ReflectedType.Namespace; + string args = string.Format("UAC {0} {1} {2}", nameSpace,className,methodName); + Debug.WriteLine(args); + var psi = new ProcessStartInfo + { + FileName = Path.Combine(Directory.GetCurrentDirectory(), "Wox.UAC.exe"), + Arguments = args, + CreateNoWindow = true, + Verb = "runas" + }; + + try + { + var process = new Process(); + process.StartInfo = psi; + process.Start(); + process.WaitForExit(); + } + catch (Exception e) + { + MessageBox.Show("Execute failed: " + e); +#if (DEBUG) + { + throw; + } +#endif + + } + + } + + private static bool IsAdministrator() + { + var identity = WindowsIdentity.GetCurrent(); + if (identity != null) + { + var principal = new WindowsPrincipal(identity); + return principal.IsInRole(WindowsBuiltInRole.Administrator); + } + + return false; + } + } +} \ No newline at end of file diff --git a/Wox.Infrastructure/Wox.Infrastructure.csproj b/Wox.Infrastructure/Wox.Infrastructure.csproj index 9192eed42..f538f4219 100644 --- a/Wox.Infrastructure/Wox.Infrastructure.csproj +++ b/Wox.Infrastructure/Wox.Infrastructure.csproj @@ -35,15 +35,22 @@ ..\packages\Newtonsoft.Json.5.0.8\lib\net35\Newtonsoft.Json.dll + + + + + + + diff --git a/Wox.Plugin.System/BrowserBookmarks.cs b/Wox.Plugin.System/BrowserBookmarks.cs index 588db7c42..e0dcc307c 100644 --- a/Wox.Plugin.System/BrowserBookmarks.cs +++ b/Wox.Plugin.System/BrowserBookmarks.cs @@ -8,7 +8,7 @@ using System.Text; using System.Text.RegularExpressions; using System.Windows.Forms; using Newtonsoft.Json; -using Wox.Plugin.System.Common; +using Wox.Infrastructure; namespace Wox.Plugin.System { diff --git a/Wox.Plugin.System/Programs.cs b/Wox.Plugin.System/Programs.cs index 62cedb1a0..277a39155 100644 --- a/Wox.Plugin.System/Programs.cs +++ b/Wox.Plugin.System/Programs.cs @@ -7,7 +7,7 @@ using System.Runtime.InteropServices; using System.Text; using System.Windows.Forms; using Microsoft.Win32; -using Wox.Plugin.System.Common; +using Wox.Infrastructure; namespace Wox.Plugin.System { diff --git a/Wox.Plugin.System/Wox.Plugin.System.csproj b/Wox.Plugin.System/Wox.Plugin.System.csproj index 2dadddea1..936808d29 100644 --- a/Wox.Plugin.System/Wox.Plugin.System.csproj +++ b/Wox.Plugin.System/Wox.Plugin.System.csproj @@ -50,7 +50,6 @@ - diff --git a/Wox.Plugin/AllowedLanguage.cs b/Wox.Plugin/AllowedLanguage.cs index bdbea52d1..c6d0fa805 100644 --- a/Wox.Plugin/AllowedLanguage.cs +++ b/Wox.Plugin/AllowedLanguage.cs @@ -22,4 +22,4 @@ namespace Wox.Plugin return language.ToUpper() == Python.ToUpper() || language.ToUpper() == CSharp.ToUpper(); } } -} +} \ No newline at end of file diff --git a/Wox.WorkflowInstaller/App.xaml b/Wox.UAC/App.xaml similarity index 83% rename from Wox.WorkflowInstaller/App.xaml rename to Wox.UAC/App.xaml index e6c6300fb..8404afa41 100644 --- a/Wox.WorkflowInstaller/App.xaml +++ b/Wox.UAC/App.xaml @@ -1,4 +1,4 @@ - diff --git a/Wox.WorkflowInstaller/App.xaml.cs b/Wox.UAC/App.xaml.cs similarity index 88% rename from Wox.WorkflowInstaller/App.xaml.cs rename to Wox.UAC/App.xaml.cs index 7cffc9d62..7f977d58d 100644 --- a/Wox.WorkflowInstaller/App.xaml.cs +++ b/Wox.UAC/App.xaml.cs @@ -1,16 +1,16 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Data; -using System.Linq; -using System.Windows; - -namespace Wox.WorkflowInstaller -{ - /// - /// App.xaml 的交互逻辑 - /// - public partial class App : Application - { - } -} +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Windows; + +namespace Wox.UAC +{ + /// + /// App.xaml 的交互逻辑 + /// + public partial class App : Application + { + } +} diff --git a/Wox.WorkflowInstaller/MainWindow.xaml b/Wox.UAC/MainWindow.xaml similarity index 81% rename from Wox.WorkflowInstaller/MainWindow.xaml rename to Wox.UAC/MainWindow.xaml index 9f4085b3d..48db273c9 100644 --- a/Wox.WorkflowInstaller/MainWindow.xaml +++ b/Wox.UAC/MainWindow.xaml @@ -1,4 +1,4 @@ - diff --git a/Wox.UAC/MainWindow.xaml.cs b/Wox.UAC/MainWindow.xaml.cs new file mode 100644 index 000000000..594161b66 --- /dev/null +++ b/Wox.UAC/MainWindow.xaml.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Wox.UAC +{ + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + string[] param = Environment.GetCommandLineArgs(); + if (param.Length > 2) + { + switch (param[1]) + { + case "UAC": + Invoke(param[2], param[3], param[4]); + break; + } + } + Application.Current.Shutdown(0); + } + + private static void Invoke(string namespaceName, string className, string methodName) + { + Type type = Type.GetType(namespaceName + "." + className + "," + namespaceName); + if (type != null) + { + object instance = Activator.CreateInstance(type); + MethodInfo method = type.GetMethod(methodName, BindingFlags.NonPublic | BindingFlags.Instance); + if (method != null) method.Invoke(instance, null); + } + } + } +} diff --git a/Wox.WorkflowInstaller/Properties/AssemblyInfo.cs b/Wox.UAC/Properties/AssemblyInfo.cs similarity index 73% rename from Wox.WorkflowInstaller/Properties/AssemblyInfo.cs rename to Wox.UAC/Properties/AssemblyInfo.cs index 6b815f432..f3f96879a 100644 --- a/Wox.WorkflowInstaller/Properties/AssemblyInfo.cs +++ b/Wox.UAC/Properties/AssemblyInfo.cs @@ -1,55 +1,55 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Windows; - -// 有关程序集的常规信息通过以下 -// 特性集控制。更改这些特性值可修改 -// 与程序集关联的信息。 -[assembly: AssemblyTitle("Wox.WorkflowInstaller")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("qianlifeng")] -[assembly: AssemblyProduct("Wox.WorkflowInstaller")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 将 ComVisible 设置为 false 使此程序集中的类型 -// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, -// 则将该类型上的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -//若要开始生成可本地化的应用程序,请在 -// 中的 .csproj 文件中 -//设置 CultureYouAreCodingWith。例如,如果您在源文件中 -//使用的是美国英语,请将 设置为 en-US。然后取消 -//对以下 NeutralResourceLanguage 特性的注释。更新 -//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //主题特定资源词典所处位置 - //(在页面或应用程序资源词典中 - // 未找到某个资源的情况下使用) - ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 - //(在页面、应用程序或任何主题特定资源词典中 - // 未找到某个资源的情况下使用) -)] - - -// 程序集的版本信息由下面四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("Wox.UAC")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Wox.UAC")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +//若要开始生成可本地化的应用程序,请在 +// 中的 .csproj 文件中 +//设置 CultureYouAreCodingWith。 例如,如果您在源文件中 +//使用的是美国英语,请将 设置为 en-US。 然后取消 +//对以下 NeutralResourceLanguage 特性的注释。 更新 +//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //主题特定资源词典所处位置 + //(在页面或应用程序资源词典中 + // 未找到某个资源的情况下使用) + ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 + //(在页面、应用程序或任何主题特定资源词典中 + // 未找到某个资源的情况下使用) +)] + + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Wox.WorkflowInstaller/Properties/Resources.Designer.cs b/Wox.UAC/Properties/Resources.Designer.cs similarity index 91% rename from Wox.WorkflowInstaller/Properties/Resources.Designer.cs rename to Wox.UAC/Properties/Resources.Designer.cs index 41c4e469f..e8a1c490e 100644 --- a/Wox.WorkflowInstaller/Properties/Resources.Designer.cs +++ b/Wox.UAC/Properties/Resources.Designer.cs @@ -1,71 +1,71 @@ -//------------------------------------------------------------------------------ -// -// 此代码由工具生成。 -// 运行时版本: 4.0.30319.18052 -// -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将丢失。 -// -//------------------------------------------------------------------------------ - -namespace Wox.WorkflowInstaller.Properties -{ - - - /// - /// 一个强类型的资源类,用于查找本地化的字符串等。 - /// - // 此类是由 StronglyTypedResourceBuilder - // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 - // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen - // (以 /str 作为命令选项),或重新生成 VS 项目。 - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// 返回此类使用的、缓存的 ResourceManager 实例。 - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Wox.WorkflowInstaller.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// 为所有资源查找重写当前线程的 CurrentUICulture 属性, - /// 方法是使用此强类型资源类。 - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本: 4.0.30319.18408 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace Wox.UAC.Properties +{ + + + /// + /// 一个强类型的资源类,用于查找本地化的字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// 返回此类使用的、缓存的 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Wox.UAC.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 为所有资源查找重写当前线程的 CurrentUICulture 属性, + /// 方法是使用此强类型资源类。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Wox.WorkflowInstaller/Properties/Resources.resx b/Wox.UAC/Properties/Resources.resx similarity index 100% rename from Wox.WorkflowInstaller/Properties/Resources.resx rename to Wox.UAC/Properties/Resources.resx diff --git a/Wox.WorkflowInstaller/Properties/Settings.Designer.cs b/Wox.UAC/Properties/Settings.Designer.cs similarity index 92% rename from Wox.WorkflowInstaller/Properties/Settings.Designer.cs rename to Wox.UAC/Properties/Settings.Designer.cs index b8436c2c3..6dbc8f74b 100644 --- a/Wox.WorkflowInstaller/Properties/Settings.Designer.cs +++ b/Wox.UAC/Properties/Settings.Designer.cs @@ -1,14 +1,14 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18052 +// Runtime Version:4.0.30319.18408 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ -namespace Wox.WorkflowInstaller.Properties +namespace Wox.UAC.Properties { diff --git a/Wox.WorkflowInstaller/Properties/Settings.settings b/Wox.UAC/Properties/Settings.settings similarity index 100% rename from Wox.WorkflowInstaller/Properties/Settings.settings rename to Wox.UAC/Properties/Settings.settings diff --git a/Wox.WorkflowInstaller/Wox.WorkflowInstaller.csproj b/Wox.UAC/Wox.UAC.csproj similarity index 70% rename from Wox.WorkflowInstaller/Wox.WorkflowInstaller.csproj rename to Wox.UAC/Wox.UAC.csproj index 2e369d5c7..84abe0597 100644 --- a/Wox.WorkflowInstaller/Wox.WorkflowInstaller.csproj +++ b/Wox.UAC/Wox.UAC.csproj @@ -1,129 +1,141 @@ - - - - - Debug - AnyCPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928} - WinExe - Properties - Wox.WorkflowInstaller - Wox.WorkflowInstaller - v3.5 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - ..\ - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - app.manifest - - - app.ico - - - - ..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll - - - - - - - - - - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - App.xaml - Code - - - - MainWindow.xaml - Code - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - - - Designer - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - - Always - - - - - {8451ECDD-2EA4-4966-BB0A-7BBC40138E80} - Wox.Plugin - - - - - xcopy /Y $(TargetPath) $(SolutionDir)Wox\bin\Debug\ -xcopy /Y $(TargetDir)ICSharpCode.SharpZipLib.dll $(SolutionDir)Wox\bin\Debug\ - - - + + + + + Debug + AnyCPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233} + WinExe + Properties + Wox.UAC + Wox.UAC + v3.5 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + ..\ + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + app.ico + + + app.manifest + + + + ..\packages\log4net.2.0.3\lib\net35-full\log4net.dll + + + + + + + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + {4fd29318-a8ab-4d8f-aa47-60bc241b8da3} + Wox.Infrastructure + + + {69ce0206-cb41-453d-88af-df86092ef9b8} + Wox.Plugin.System + + + {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} + Wox.Plugin + + + {DB90F671-D861-46BB-93A3-F1304F5BA1C5} + Wox + + + + + + + + xcopy /Y /E $(TargetPath) $(SolutionDir)Wox\bin\Debug\ + + + + + 这台计算机上缺少此项目引用的 NuGet 程序包。启用“NuGet 程序包还原”可下载这些程序包。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 + + + + \ No newline at end of file diff --git a/Wox.WorkflowInstaller/app.ico b/Wox.UAC/app.ico similarity index 79% rename from Wox.WorkflowInstaller/app.ico rename to Wox.UAC/app.ico index c5f72ba8bb07e0e31e882d482a8576843a2f6192..8e914ac566fafe5d7bad0b1c78520ae7b8b4f34a 100644 GIT binary patch delta 14641 zcmaJ{30PIt+I}|c#PNo|*u@z%{gZ;i#L^s6lhho_DK)Lkp=_{Ql-=gKTGnl_ZfQGR zrRF?kYR*SdQBXk;5fu?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CmvK9@z~OG?RJjH&OmfEQh_q(0bFy&#a^}7 z5J#CkU~@}DyAw(;p`-HVVAa8wG#oodCp^p%8NwCNHjR+IpGI@xw$a|$it14%dempU z_;(IwsF>KhT!0$w>$yO6iVQLc(9#P5ZJ|rr9usTe4ABY4NXKLSoi+(mHvzHfGXZ@- zL7CE?@%#t+g=f&8;{R6Q&q-ec`X>bq_n?G*>}r6PL&Y<$1$wbkjDQx>xWezSeC50- zG{XFQcyewOcs19&aDsF3YS|?r`$yGgu+{keC$BWgI(T|1Hwy->G=u0wCxh*AvFMku z_8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Wox.UAC/packages.config b/Wox.UAC/packages.config new file mode 100644 index 000000000..7eb67aa24 --- /dev/null +++ b/Wox.UAC/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Wox.WorkflowInstaller/packages.config b/Wox.WorkflowInstaller/packages.config deleted file mode 100644 index e2a24c16d..000000000 --- a/Wox.WorkflowInstaller/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Wox.sln b/Wox.sln index f89daaf8b..c68543b67 100644 --- a/Wox.sln +++ b/Wox.sln @@ -1,6 +1,8 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Test", "Wox.Test\Wox.Test.csproj", "{FF742965-9A80-41A5-B042-D6C7D3A21708}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin", "Wox.Plugin\Wox.Plugin.csproj", "{8451ECDD-2EA4-4966-BB0A-7BBC40138E80}" @@ -13,8 +15,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.System", "Wox.Pl EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Fanyi", "Plugins\Wox.Plugin.Fanyi\Wox.Plugin.Fanyi.csproj", "{353769D3-D11C-4D86-BD06-AC8C1D68642B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.WorkflowInstaller", "Wox.WorkflowInstaller\Wox.WorkflowInstaller.csproj", "{FAFCAD04-C37E-477B-88C9-0C945E4FB928}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Python.Runtime", "Pythonnet.Runtime\Python.Runtime.csproj", "{097B4AC0-74E9-4C58-BCF8-C69746EC8271}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Doc", "Plugins\Wox.Plugin.Doc\Wox.Plugin.Doc.csproj", "{6B6696B1-A547-4FD4-85EF-E1FD0F54AD2C}" @@ -23,6 +23,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Infrastructure", "Wox.I EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Everything", "Plugins\Wox.Plugin.Everything\Wox.Plugin.Everything.csproj", "{230AE83F-E92E-4E69-8355-426B305DA9C0}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.UAC", "Wox.UAC\Wox.UAC.csproj", "{C9BC17A0-C2BC-4185-AC1F-32E3352C1233}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -196,34 +198,6 @@ Global {353769D3-D11C-4D86-BD06-AC8C1D68642B}.UnitTests|Win32.ActiveCfg = Release|Any CPU {353769D3-D11C-4D86-BD06-AC8C1D68642B}.UnitTests|x64.ActiveCfg = Release|Any CPU {353769D3-D11C-4D86-BD06-AC8C1D68642B}.UnitTests|x86.ActiveCfg = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.Debug|Win32.ActiveCfg = Debug|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.Debug|x64.ActiveCfg = Debug|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.Debug|x86.ActiveCfg = Debug|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.EmbeddingTest|Any CPU.ActiveCfg = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.EmbeddingTest|Any CPU.Build.0 = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.EmbeddingTest|Mixed Platforms.ActiveCfg = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.EmbeddingTest|Mixed Platforms.Build.0 = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.EmbeddingTest|Win32.ActiveCfg = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.EmbeddingTest|x64.ActiveCfg = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.EmbeddingTest|x86.ActiveCfg = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.Release|Any CPU.Build.0 = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.Release|Win32.ActiveCfg = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.Release|x64.ActiveCfg = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.Release|x86.ActiveCfg = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.UnitTests|Any CPU.ActiveCfg = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.UnitTests|Any CPU.Build.0 = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.UnitTests|Mixed Platforms.ActiveCfg = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.UnitTests|Mixed Platforms.Build.0 = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.UnitTests|Win32.ActiveCfg = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.UnitTests|x64.ActiveCfg = Release|Any CPU - {FAFCAD04-C37E-477B-88C9-0C945E4FB928}.UnitTests|x86.ActiveCfg = Release|Any CPU {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Debug|Any CPU.Build.0 = Debug|Any CPU {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -344,6 +318,34 @@ Global {230AE83F-E92E-4E69-8355-426B305DA9C0}.UnitTests|x64.ActiveCfg = Release|x64 {230AE83F-E92E-4E69-8355-426B305DA9C0}.UnitTests|x64.Build.0 = Release|x64 {230AE83F-E92E-4E69-8355-426B305DA9C0}.UnitTests|x86.ActiveCfg = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.Debug|Win32.ActiveCfg = Debug|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.Debug|x64.ActiveCfg = Debug|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.Debug|x86.ActiveCfg = Debug|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.EmbeddingTest|Any CPU.ActiveCfg = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.EmbeddingTest|Any CPU.Build.0 = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.EmbeddingTest|Mixed Platforms.ActiveCfg = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.EmbeddingTest|Mixed Platforms.Build.0 = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.EmbeddingTest|Win32.ActiveCfg = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.EmbeddingTest|x64.ActiveCfg = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.EmbeddingTest|x86.ActiveCfg = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.Release|Any CPU.Build.0 = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.Release|Win32.ActiveCfg = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.Release|x64.ActiveCfg = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.Release|x86.ActiveCfg = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.UnitTests|Any CPU.ActiveCfg = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.UnitTests|Any CPU.Build.0 = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.UnitTests|Mixed Platforms.ActiveCfg = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.UnitTests|Mixed Platforms.Build.0 = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.UnitTests|Win32.ActiveCfg = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.UnitTests|x64.ActiveCfg = Release|Any CPU + {C9BC17A0-C2BC-4185-AC1F-32E3352C1233}.UnitTests|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Wox/Commands/PluginCommand.cs b/Wox/Commands/PluginCommand.cs index b11729ed6..18dafe662 100644 --- a/Wox/Commands/PluginCommand.cs +++ b/Wox/Commands/PluginCommand.cs @@ -53,7 +53,6 @@ namespace Wox.Commands { if (currentPythonModulePath != thirdPlugin.Metadata.PluginDirecotry) { - //this must initial in main thread currentPythonModulePath = thirdPlugin.Metadata.PluginDirecotry; if (GIL != IntPtr.Zero) @@ -63,8 +62,8 @@ namespace Wox.Commands } PythonEngine.Initialize(); IntPtr pyStrPtr = Runtime.PyString_FromString(thirdPlugin.Metadata.PluginDirecotry); - IntPtr SysDotPath = Runtime.PySys_GetObject("path"); - Runtime.PyList_Append(SysDotPath, pyStrPtr); + IntPtr sysDotPath = Runtime.PySys_GetObject("path"); + Runtime.PyList_Append(sysDotPath, pyStrPtr); GIL = PythonEngine.BeginAllowThreads(); } } diff --git a/Wox/Helper/IniParser.cs b/Wox/Helper/IniParser.cs deleted file mode 100644 index 05515093a..000000000 --- a/Wox/Helper/IniParser.cs +++ /dev/null @@ -1,217 +0,0 @@ -using System; -using System.Collections; -using System.IO; - -namespace Wox.Helper -{ - public class IniParser - { - private Hashtable keyPairs = new Hashtable(); - private String iniFilePath; - - private struct SectionPair - { - public String Section; - public String Key; - } - - /// - /// Opens the INI file at the given path and enumerates the values in the IniParser. - /// - /// Full path to INI file. - public IniParser(String iniPath) - { - TextReader iniFile = null; - String strLine = null; - String currentRoot = null; - String[] keyPair = null; - - iniFilePath = iniPath; - - if (File.Exists(iniPath)) - { - try - { - iniFile = new StreamReader(iniPath); - - strLine = iniFile.ReadLine(); - - while (strLine != null) - { - strLine = strLine.Trim(); - - if (strLine != "") - { - if (strLine.StartsWith("[") && strLine.EndsWith("]")) - { - currentRoot = strLine.Substring(1, strLine.Length - 2).ToUpper(); - } - else - { - keyPair = strLine.Split(new char[] { '=' }, 2); - - SectionPair sectionPair; - String value = null; - - if (currentRoot == null) - currentRoot = "ROOT"; - - sectionPair.Section = currentRoot; - sectionPair.Key = keyPair[0].ToUpper().Trim(); - - if (keyPair.Length > 1) - value = keyPair[1]; - - keyPairs.Add(sectionPair, value.Trim()); - } - } - - strLine = iniFile.ReadLine(); - } - - } - catch (Exception ex) - { - throw ex; - } - finally - { - if (iniFile != null) - iniFile.Close(); - } - } - else - throw new FileNotFoundException("Unable to locate " + iniPath); - } - - /// - /// Returns the value for the given section, key pair. - /// - /// Section name. - /// Key name. - public String GetSetting(String sectionName, String settingName) - { - SectionPair sectionPair; - sectionPair.Section = sectionName.ToUpper().Trim(); - sectionPair.Key = settingName.ToUpper().Trim(); - - return (String)keyPairs[sectionPair]; - } - - /// - /// Enumerates all lines for given section. - /// - /// Section to enum. - public String[] EnumSection(String sectionName) - { - ArrayList tmpArray = new ArrayList(); - - foreach (SectionPair pair in keyPairs.Keys) - { - if (pair.Section == sectionName.ToUpper()) - tmpArray.Add(pair.Key); - } - - return (String[])tmpArray.ToArray(typeof(String)); - } - - /// - /// Adds or replaces a setting to the table to be saved. - /// - /// Section to add under. - /// Key name to add. - /// Value of key. - public void AddSetting(String sectionName, String settingName, String settingValue) - { - SectionPair sectionPair; - sectionPair.Section = sectionName.ToUpper(); - sectionPair.Key = settingName.ToUpper(); - - if (keyPairs.ContainsKey(sectionPair)) - keyPairs.Remove(sectionPair); - - keyPairs.Add(sectionPair, settingValue); - } - - /// - /// Adds or replaces a setting to the table to be saved with a null value. - /// - /// Section to add under. - /// Key name to add. - public void AddSetting(String sectionName, String settingName) - { - AddSetting(sectionName, settingName, null); - } - - /// - /// Remove a setting. - /// - /// Section to add under. - /// Key name to add. - public void DeleteSetting(String sectionName, String settingName) - { - SectionPair sectionPair; - sectionPair.Section = sectionName.ToUpper(); - sectionPair.Key = settingName.ToUpper(); - - if (keyPairs.ContainsKey(sectionPair)) - keyPairs.Remove(sectionPair); - } - - /// - /// Save settings to new file. - /// - /// New file path. - public void SaveSettings(String newFilePath) - { - ArrayList sections = new ArrayList(); - String tmpValue = ""; - String strToSave = ""; - - foreach (SectionPair sectionPair in keyPairs.Keys) - { - if (!sections.Contains(sectionPair.Section)) - sections.Add(sectionPair.Section); - } - - foreach (String section in sections) - { - strToSave += ("[" + section + "]\r\n"); - - foreach (SectionPair sectionPair in keyPairs.Keys) - { - if (sectionPair.Section == section) - { - tmpValue = (String)keyPairs[sectionPair]; - - if (tmpValue != null) - tmpValue = "=" + tmpValue; - - strToSave += (sectionPair.Key + tmpValue + "\r\n"); - } - } - - strToSave += "\r\n"; - } - - try - { - TextWriter tw = new StreamWriter(newFilePath); - tw.Write(strToSave); - tw.Close(); - } - catch (Exception ex) - { - throw ex; - } - } - - /// - /// Save settings back to ini file. - /// - public void SaveSettings() - { - SaveSettings(iniFilePath); - } - } -} \ No newline at end of file diff --git a/Wox.WorkflowInstaller/MainWindow.xaml.cs b/Wox/Helper/PluginInstaller.cs similarity index 86% rename from Wox.WorkflowInstaller/MainWindow.xaml.cs rename to Wox/Helper/PluginInstaller.cs index 07ee4868e..66af34c36 100644 --- a/Wox.WorkflowInstaller/MainWindow.xaml.cs +++ b/Wox/Helper/PluginInstaller.cs @@ -1,47 +1,72 @@ using System; -using System.Collections.Generic; using System.Diagnostics; using System.IO; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; using ICSharpCode.SharpZipLib.Zip; using Microsoft.Win32; -using Wox.Helper; +using Wox.Infrastructure; using Wox.Plugin; -using Path = System.IO.Path; -namespace Wox.WorkflowInstaller +namespace Wox.Helper { - - public partial class MainWindow + public class PluginInstaller { - public MainWindow() + [DllImport("shell32.dll")] + private static extern void SHChangeNotify(uint wEventId, uint uFlags, IntPtr dwItem1, IntPtr dwItem2); + + /// + /// associate filetype with specified program + /// + /// + /// + /// + /// + private static void SaveReg(string filePath, string fileType, string iconPath, bool overrides) { - InitializeComponent(); - Loaded += MainWindow_Loaded; - string[] param = Environment.GetCommandLineArgs(); - if (param.Length == 2) + RegistryKey classRootKey = Registry.ClassesRoot.OpenSubKey("", true); + RegistryKey woxKey = classRootKey.OpenSubKey(fileType, true); + if (woxKey != null) { - string workflowPath = param[1]; - //string workflowPath = @"c:\Users\Scott\Desktop\Desktop.wox"; - if (workflowPath.EndsWith(".wox")) + if (!overrides) { - InstallWorkflow(workflowPath); + return; } + classRootKey.DeleteSubKeyTree(fileType); } + classRootKey.CreateSubKey(fileType); + woxKey = classRootKey.OpenSubKey(fileType, true); + woxKey.SetValue("", "wox.wox"); + woxKey.SetValue("Content Type", "application/wox"); + + RegistryKey iconKey = woxKey.CreateSubKey("DefaultIcon"); + iconKey.SetValue("", iconPath); + + woxKey.CreateSubKey("shell"); + RegistryKey shellKey = woxKey.OpenSubKey("shell", true); + shellKey.SetValue("", "Open"); + RegistryKey openKey = shellKey.CreateSubKey("open"); + openKey.SetValue("", "Open with wox"); + + openKey = shellKey.OpenSubKey("open", true); + openKey.CreateSubKey("command"); + RegistryKey commandKey = openKey.OpenSubKey("command", true); + string pathString = "\"" + filePath + "\" \"%1\""; + commandKey.SetValue("", pathString); + + //refresh cache + SHChangeNotify(0x8000000, 0, IntPtr.Zero, IntPtr.Zero); } - private void InstallWorkflow(string path) + public void RegisterInstaller() + { + string filePath = Directory.GetCurrentDirectory() + "\\Wox.Installer.exe"; + string iconPath = Directory.GetCurrentDirectory() + "\\app.ico"; + + SaveReg(filePath, ".wox", iconPath, false); + } + + public void Install(string path) { if (File.Exists(path)) { @@ -56,7 +81,6 @@ namespace Wox.WorkflowInstaller if (!File.Exists(iniPath)) { MessageBox.Show("Install failed: config is missing"); - Close(); return; } @@ -64,7 +88,6 @@ namespace Wox.WorkflowInstaller if (plugin == null || plugin.Name == null) { MessageBox.Show("Install failed: config of this workflow is invalid"); - Close(); return; } @@ -72,7 +95,6 @@ namespace Wox.WorkflowInstaller if (!Directory.Exists(pluginFolerPath)) { MessageBox.Show("Install failed: cound't find workflow directory"); - Close(); return; } @@ -122,16 +144,11 @@ namespace Wox.WorkflowInstaller { MessageBox.Show("You have installed workflow " + plugin.Name + " successfully. Please restart your wox to use new workflow."); } - Close(); - } - else - { - Close(); } } } - private static PluginMetadata GetMetadataFromIni(string directory) + private PluginMetadata GetMetadataFromIni(string directory) { string iniPath = directory + "\\plugin.ini"; @@ -182,7 +199,7 @@ namespace Wox.WorkflowInstaller /// The ziped file. /// The STR directory. /// overwirte - public void UnZip(string zipedFile, string strDirectory, bool overWrite) + private void UnZip(string zipedFile, string strDirectory, bool overWrite) { if (strDirectory == "") strDirectory = Directory.GetCurrentDirectory(); @@ -231,52 +248,5 @@ namespace Wox.WorkflowInstaller s.Close(); } } - - void MainWindow_Loaded(object sender, RoutedEventArgs e) - { - string filePath = Directory.GetCurrentDirectory() + "\\Wox.WorkflowInstaller.exe"; - string iconPath = Directory.GetCurrentDirectory() + "\\app.ico"; - - SaveReg(filePath, ".wox", iconPath, false); - } - - [DllImport("shell32.dll")] - private static extern void SHChangeNotify(uint wEventId, uint uFlags, IntPtr dwItem1, IntPtr dwItem2); - - private static void SaveReg(string filePath, string fileType, string iconPath, bool overrides) - { - RegistryKey classRootKey = Registry.ClassesRoot.OpenSubKey("", true); - RegistryKey woxKey = classRootKey.OpenSubKey(fileType, true); - if (woxKey != null) - { - if (!overrides) - { - return; - } - classRootKey.DeleteSubKeyTree(fileType); - } - classRootKey.CreateSubKey(fileType); - woxKey = classRootKey.OpenSubKey(fileType, true); - woxKey.SetValue("", "wox.wox"); - woxKey.SetValue("Content Type", "application/wox"); - - RegistryKey iconKey = woxKey.CreateSubKey("DefaultIcon"); - iconKey.SetValue("", iconPath); - - woxKey.CreateSubKey("shell"); - RegistryKey shellKey = woxKey.OpenSubKey("shell", true); - shellKey.SetValue("", "Open"); - RegistryKey openKey = shellKey.CreateSubKey("open"); - openKey.SetValue("", "Open with wox"); - - openKey = shellKey.OpenSubKey("open", true); - openKey.CreateSubKey("command"); - RegistryKey commandKey = openKey.OpenSubKey("command", true); - string pathString = "\"" + filePath + "\" \"%1\""; - commandKey.SetValue("", pathString); - - //refresh cache - SHChangeNotify(0x8000000, 0, IntPtr.Zero, IntPtr.Zero); - } } } diff --git a/Wox/MainWindow.xaml.cs b/Wox/MainWindow.xaml.cs index 75e4bad97..9ccc201ad 100644 --- a/Wox/MainWindow.xaml.cs +++ b/Wox/MainWindow.xaml.cs @@ -182,9 +182,9 @@ namespace Wox { if (args != null && args.Length > 0) { - switch (args[0]) + switch (args[0].ToLower()) { - case "reloadWorkflows": + case "reloadworkflows": Plugins.Init(); break; diff --git a/Wox/PluginLoader/BasePluginLoader.cs b/Wox/PluginLoader/BasePluginLoader.cs index 38bc29eef..7109c7d00 100644 --- a/Wox/PluginLoader/BasePluginLoader.cs +++ b/Wox/PluginLoader/BasePluginLoader.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Reflection; using System.Windows.Forms; using Wox.Helper; +using Wox.Infrastructure; using Wox.Plugin; using Wox.Plugin.System; diff --git a/Wox/SettingWindow.xaml b/Wox/SettingWindow.xaml index ea3d4fd79..d8cc3f69c 100644 --- a/Wox/SettingWindow.xaml +++ b/Wox/SettingWindow.xaml @@ -10,14 +10,18 @@ - + + + + + + + + + - - - - diff --git a/Wox/SettingWindow.xaml.cs b/Wox/SettingWindow.xaml.cs index 955ea0d22..be8c241b8 100644 --- a/Wox/SettingWindow.xaml.cs +++ b/Wox/SettingWindow.xaml.cs @@ -1,11 +1,18 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Runtime.CompilerServices; +using System.Security.Permissions; using System.Windows; using System.Windows.Controls; +using System.Windows.Forms; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using Microsoft.Win32; using Wox.Helper; using Wox.Infrastructure; using Wox.Infrastructure.UserSettings; +using MessageBox = System.Windows.MessageBox; namespace Wox { @@ -13,6 +20,11 @@ namespace Wox { private MainWindow mainWindow; + public SettingWidow() + { + InitializeComponent(); + } + public SettingWidow(MainWindow mainWindow) { this.mainWindow = mainWindow; @@ -98,5 +110,47 @@ namespace Wox MessageBox.Show("Please select a web search"); } } + + + private void CbStartWithWindows_OnChecked(object sender, RoutedEventArgs e) + { + OnStartWithWindowsChecked(); + } + + private void CbStartWithWindows_OnUnchecked(object sender, RoutedEventArgs e) + { + OnStartWithWindowUnChecked(); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private void OnStartWithWindowUnChecked() + { + UAC.ExecuteAdminMethod(() => SetStartup(false)); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private void OnStartWithWindowsChecked() + { + UAC.ExecuteAdminMethod(() => SetStartup(true)); + } + + private void SetStartup(bool startup) + { + RegistryKey rk = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); + + if (rk != null) + { + if (startup) + { + rk.SetValue("Wox",Path.Combine(Directory.GetCurrentDirectory(),"Wox.exe startHide")); + } + else + { + rk.DeleteValue("Wox", false); + } + } + } + + } } diff --git a/Wox/WebSearchSetting.xaml b/Wox/WebSearchSetting.xaml index 39465b19b..be0eccb6b 100644 --- a/Wox/WebSearchSetting.xaml +++ b/Wox/WebSearchSetting.xaml @@ -4,13 +4,14 @@ Icon="Images\app.png" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" - Title="WebSearchSetting" Height="300" Width="674.766"> + Title="WebSearchSetting" Height="350" Width="674.766"> + @@ -29,7 +30,13 @@ Enable: - + Icon: + + + + + + diff --git a/Wox/WebSearchSetting.xaml.cs b/Wox/WebSearchSetting.xaml.cs index 7483bf792..23d8ceceb 100644 --- a/Wox/WebSearchSetting.xaml.cs +++ b/Wox/WebSearchSetting.xaml.cs @@ -42,12 +42,25 @@ namespace Wox update = true; lblAdd.Text = "Update"; + tbIconPath.Text = webSearch.IconPath; + ShowIcon(webSearch.IconPath); cbEnable.IsChecked = webSearch.Enabled; tbTitle.Text = webSearch.Title; tbUrl.Text = webSearch.Url; tbActionword.Text = webSearch.ActionWord; } + private void ShowIcon(string path) + { + try + { + imgIcon.Source = new BitmapImage(new Uri(path)); + } + catch (Exception) + { + } + } + private void BtnCancel_OnClick(object sender, RoutedEventArgs e) { Close(); @@ -88,7 +101,7 @@ namespace Wox { ActionWord = action, Enabled = cbEnable.IsChecked ?? false, - IconPath = "", + IconPath = tbIconPath.Text, Url = url, Title = title }); @@ -97,7 +110,7 @@ namespace Wox else { updateWebSearch.ActionWord = action; - updateWebSearch.IconPath = ""; + updateWebSearch.IconPath = tbIconPath.Text; updateWebSearch.Enabled = cbEnable.IsChecked ?? false; updateWebSearch.Url = url; updateWebSearch.Title= title; @@ -107,5 +120,23 @@ namespace Wox settingWidow.ReloadWebSearchView(); Close(); } + + private void BtnSelectIcon_OnClick(object sender, RoutedEventArgs e) + { + var dlg = new Microsoft.Win32.OpenFileDialog + { + DefaultExt = ".png", + Filter = + "JPEG Files (*.jpeg)|*.jpeg|PNG Files (*.png)|*.png|JPG Files (*.jpg)|*.jpg|GIF Files (*.gif)|*.gif" + }; + + bool? result = dlg.ShowDialog(); + if (result == true) + { + string filename = dlg.FileName; + tbIconPath.Text = filename; + ShowIcon(filename); + } + } } } diff --git a/Wox/Wox.csproj b/Wox/Wox.csproj index 865cc9ce7..314661241 100644 --- a/Wox/Wox.csproj +++ b/Wox/Wox.csproj @@ -78,6 +78,10 @@ + + False + ..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll + ..\packages\log4net.2.0.3\lib\net35-full\log4net.dll @@ -119,6 +123,7 @@ + @@ -126,7 +131,6 @@ -