From fd1ee23adc47ba5468a4fa7c13ad00fa7748b4c4 Mon Sep 17 00:00:00 2001 From: qianlifeng Date: Thu, 19 Dec 2013 23:51:20 +0800 Subject: [PATCH] init --- .gitignore | 2 + Packages.dgml | 15 +++ WinAlfred.Plugin.Everything/EverythingAPI.cs | 98 ++++++++++++++ WinAlfred.Plugin.Everything/Main.cs | 33 +++++ .../Properties/AssemblyInfo.cs | 36 ++++++ .../WinAlfred.Plugin.Everything.csproj | 59 +++++++++ WinAlfred.Plugin/IPlugin.cs | 11 ++ WinAlfred.Plugin/Properties/AssemblyInfo.cs | 36 ++++++ WinAlfred.Plugin/Query.cs | 22 ++++ WinAlfred.Plugin/Result.cs | 11 ++ WinAlfred.Plugin/WinAlfred.Plugin.csproj | 54 ++++++++ WinAlfred.Test/Properties/AssemblyInfo.cs | 36 ++++++ WinAlfred.Test/QueryTest.cs | 29 +++++ WinAlfred.Test/WinAlfred.Test.csproj | 68 ++++++++++ WinAlfred.Test/packages.config | 4 + WinAlfred.sln | 43 +++++++ WinAlfred/FrmMain.Designer.cs | 66 ++++++++++ WinAlfred/FrmMain.cs | 19 +++ WinAlfred/FrmMain.resx | 120 ++++++++++++++++++ WinAlfred/Program.cs | 21 +++ WinAlfred/Properties/AssemblyInfo.cs | 36 ++++++ WinAlfred/Properties/Resources.Designer.cs | 71 +++++++++++ WinAlfred/Properties/Resources.resx | 117 +++++++++++++++++ WinAlfred/Properties/Settings.Designer.cs | 30 +++++ WinAlfred/Properties/Settings.settings | 7 + WinAlfred/WinAlfred.csproj | 84 ++++++++++++ 26 files changed, 1128 insertions(+) create mode 100644 Packages.dgml create mode 100644 WinAlfred.Plugin.Everything/EverythingAPI.cs create mode 100644 WinAlfred.Plugin.Everything/Main.cs create mode 100644 WinAlfred.Plugin.Everything/Properties/AssemblyInfo.cs create mode 100644 WinAlfred.Plugin.Everything/WinAlfred.Plugin.Everything.csproj create mode 100644 WinAlfred.Plugin/IPlugin.cs create mode 100644 WinAlfred.Plugin/Properties/AssemblyInfo.cs create mode 100644 WinAlfred.Plugin/Query.cs create mode 100644 WinAlfred.Plugin/Result.cs create mode 100644 WinAlfred.Plugin/WinAlfred.Plugin.csproj create mode 100644 WinAlfred.Test/Properties/AssemblyInfo.cs create mode 100644 WinAlfred.Test/QueryTest.cs create mode 100644 WinAlfred.Test/WinAlfred.Test.csproj create mode 100644 WinAlfred.Test/packages.config create mode 100644 WinAlfred.sln create mode 100644 WinAlfred/FrmMain.Designer.cs create mode 100644 WinAlfred/FrmMain.cs create mode 100644 WinAlfred/FrmMain.resx create mode 100644 WinAlfred/Program.cs create mode 100644 WinAlfred/Properties/AssemblyInfo.cs create mode 100644 WinAlfred/Properties/Resources.Designer.cs create mode 100644 WinAlfred/Properties/Resources.resx create mode 100644 WinAlfred/Properties/Settings.Designer.cs create mode 100644 WinAlfred/Properties/Settings.settings create mode 100644 WinAlfred/WinAlfred.csproj diff --git a/.gitignore b/.gitignore index bdc3535f74..ee40d233aa 100644 --- a/.gitignore +++ b/.gitignore @@ -106,3 +106,5 @@ Generated_Code #added for RIA/Silverlight projects _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML + +*.DotSettings diff --git a/Packages.dgml b/Packages.dgml new file mode 100644 index 0000000000..2f84352926 --- /dev/null +++ b/Packages.dgml @@ -0,0 +1,15 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/WinAlfred.Plugin.Everything/EverythingAPI.cs b/WinAlfred.Plugin.Everything/EverythingAPI.cs new file mode 100644 index 0000000000..524030dc7b --- /dev/null +++ b/WinAlfred.Plugin.Everything/EverythingAPI.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; + +namespace WinAlfred.Plugin.Everything +{ + public sealed class EverythingAPI + { + const int EVERYTHING_OK = 0; + const int EVERYTHING_ERROR_MEMORY = 1; + const int EVERYTHING_ERROR_IPC = 2; + const int EVERYTHING_ERROR_REGISTERCLASSEX = 3; + const int EVERYTHING_ERROR_CREATEWINDOW = 4; + const int EVERYTHING_ERROR_CREATETHREAD = 5; + const int EVERYTHING_ERROR_INVALIDINDEX = 6; + const int EVERYTHING_ERROR_INVALIDCALL = 7; + + [DllImport("Everything.dll")] + private static extern int Everything_SetSearch(string lpSearchString); + [DllImport("Everything.dll")] + private static extern void Everything_SetMatchPath(bool bEnable); + [DllImport("Everything.dll")] + private static extern void Everything_SetMatchCase(bool bEnable); + [DllImport("Everything.dll")] + private static extern void Everything_SetMatchWholeWord(bool bEnable); + [DllImport("Everything.dll")] + private static extern void Everything_SetRegex(bool bEnable); + [DllImport("Everything.dll")] + private static extern void Everything_SetMax(int dwMax); + [DllImport("Everything.dll")] + private static extern void Everything_SetOffset(int dwOffset); + + [DllImport("Everything.dll")] + private static extern bool Everything_GetMatchPath(); + [DllImport("Everything.dll")] + private static extern bool Everything_GetMatchCase(); + [DllImport("Everything.dll")] + private static extern bool Everything_GetMatchWholeWord(); + [DllImport("Everything.dll")] + private static extern bool Everything_GetRegex(); + [DllImport("Everything.dll")] + private static extern UInt32 Everything_GetMax(); + [DllImport("Everything.dll")] + private static extern UInt32 Everything_GetOffset(); + [DllImport("Everything.dll")] + private static extern string Everything_GetSearch(); + [DllImport("Everything.dll")] + private static extern int Everything_GetLastError(); + + [DllImport("Everything.dll")] + private static extern bool Everything_Query(); + + [DllImport("Everything.dll")] + private static extern void Everything_SortResultsByPath(); + + [DllImport("Everything.dll")] + private static extern int Everything_GetNumFileResults(); + [DllImport("Everything.dll")] + private static extern int Everything_GetNumFolderResults(); + [DllImport("Everything.dll")] + private static extern int Everything_GetNumResults(); + [DllImport("Everything.dll")] + private static extern int Everything_GetTotFileResults(); + [DllImport("Everything.dll")] + private static extern int Everything_GetTotFolderResults(); + [DllImport("Everything.dll")] + private static extern int Everything_GetTotResults(); + [DllImport("Everything.dll")] + private static extern bool Everything_IsVolumeResult(int nIndex); + [DllImport("Everything.dll")] + private static extern bool Everything_IsFolderResult(int nIndex); + [DllImport("Everything.dll")] + private static extern bool Everything_IsFileResult(int nIndex); + [DllImport("Everything.dll")] + private static extern void Everything_GetResultFullPathName(int nIndex, StringBuilder lpString, int nMaxCount); + [DllImport("Everything.dll")] + private static extern void Everything_Reset(); + + + public void Search(string query) + { + int i; + const int bufsize = 260; + StringBuilder buf = new StringBuilder(bufsize); + + Everything_SetSearch(query); + Everything_Query(); + // loop through the results, adding each result to the listbox. + for (i = 0; i < Everything_GetNumResults(); i++) + { + // get the result's full path and file name. + Everything_GetResultFullPathName(i, buf, bufsize); + } + } + } +} diff --git a/WinAlfred.Plugin.Everything/Main.cs b/WinAlfred.Plugin.Everything/Main.cs new file mode 100644 index 0000000000..eccd1246a3 --- /dev/null +++ b/WinAlfred.Plugin.Everything/Main.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WinAlfred.Plugin.Everything +{ + public class Main : IPlugin + { + EverythingAPI api = new EverythingAPI(); + + public string GetActionName() + { + return "ev"; + } + + public List Query(Query query) + { + var results = new List(); + if (query.ActionParameters.Count > 0) + { + api.Search(query.ActionParameters[0]); + } + + return results; + } + + public void Init() + { + //init everything + } + } +} diff --git a/WinAlfred.Plugin.Everything/Properties/AssemblyInfo.cs b/WinAlfred.Plugin.Everything/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..00a62361a2 --- /dev/null +++ b/WinAlfred.Plugin.Everything/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("WinAlfred.Plugin.Everything")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("WinAlfred.Plugin.Everything")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("97f6ccd0-e9dc-4aa2-b4ce-6b9f14ea20a7")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WinAlfred.Plugin.Everything/WinAlfred.Plugin.Everything.csproj b/WinAlfred.Plugin.Everything/WinAlfred.Plugin.Everything.csproj new file mode 100644 index 0000000000..23c688e9a1 --- /dev/null +++ b/WinAlfred.Plugin.Everything/WinAlfred.Plugin.Everything.csproj @@ -0,0 +1,59 @@ + + + + + Debug + AnyCPU + {230AE83F-E92E-4E69-8355-426B305DA9C0} + Library + Properties + WinAlfred.Plugin.Everything + WinAlfred.Plugin.Everything + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + {8451ecdd-2ea4-4966-bb0a-7bbc40138e80} + WinAlfred.Plugin + + + + + \ No newline at end of file diff --git a/WinAlfred.Plugin/IPlugin.cs b/WinAlfred.Plugin/IPlugin.cs new file mode 100644 index 0000000000..f33bf5346b --- /dev/null +++ b/WinAlfred.Plugin/IPlugin.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; + +namespace WinAlfred.Plugin +{ + public interface IPlugin + { + string GetActionName(); + List Query(Query query); + void Init(); + } +} \ No newline at end of file diff --git a/WinAlfred.Plugin/Properties/AssemblyInfo.cs b/WinAlfred.Plugin/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..a67eee8c0f --- /dev/null +++ b/WinAlfred.Plugin/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("WinAlfred.Plugin")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("WinAlfred.Plugin")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("c22be00d-a6f5-4e45-8ecc-09ebf297c812")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WinAlfred.Plugin/Query.cs b/WinAlfred.Plugin/Query.cs new file mode 100644 index 0000000000..9a8c046a59 --- /dev/null +++ b/WinAlfred.Plugin/Query.cs @@ -0,0 +1,22 @@ +using System.Collections.Generic; + +namespace WinAlfred.Plugin +{ + public class Query + { + public string RawQuery { get; set; } + public string ActionName { get; private set; } + public List ActionParameters { get; private set; } + + public Query(string rawQuery) + { + RawQuery = rawQuery; + ParseQuery(); + } + + private void ParseQuery() + { + + } + } +} diff --git a/WinAlfred.Plugin/Result.cs b/WinAlfred.Plugin/Result.cs new file mode 100644 index 0000000000..f01ac2d1b8 --- /dev/null +++ b/WinAlfred.Plugin/Result.cs @@ -0,0 +1,11 @@ +using System; + +namespace WinAlfred.Plugin +{ + public class Result + { + public string Title { get; set; } + public Action Action { get; set; } + public int Score { get; set; } + } +} \ No newline at end of file diff --git a/WinAlfred.Plugin/WinAlfred.Plugin.csproj b/WinAlfred.Plugin/WinAlfred.Plugin.csproj new file mode 100644 index 0000000000..eab3782330 --- /dev/null +++ b/WinAlfred.Plugin/WinAlfred.Plugin.csproj @@ -0,0 +1,54 @@ + + + + + Debug + AnyCPU + {8451ECDD-2EA4-4966-BB0A-7BBC40138E80} + Library + Properties + WinAlfred.Plugin + WinAlfred.Plugin + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WinAlfred.Test/Properties/AssemblyInfo.cs b/WinAlfred.Test/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..55e30fbc06 --- /dev/null +++ b/WinAlfred.Test/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("WinAlfred.Test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("WinAlfred.Test")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("c42c2b1b-ead4-498c-a06d-7cbde85760e4")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WinAlfred.Test/QueryTest.cs b/WinAlfred.Test/QueryTest.cs new file mode 100644 index 0000000000..f40115f1b8 --- /dev/null +++ b/WinAlfred.Test/QueryTest.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using NUnit.Framework; +using WinAlfred.Plugin; + +namespace WinAlfred.Test +{ + public class QueryTest + { + [Test] + public void QueryActionTest() + { + Query q = new Query("this"); + Assert.AreEqual(q.ActionName,"this"); + + q = new Query("ev file.txt"); + Assert.AreEqual(q.ActionName,"ev"); + Assert.AreEqual(q.ActionParameters.Count,1); + Assert.AreEqual(q.ActionParameters[0],"file.txt"); + + q = new Query("ev file.txt file2.txt"); + Assert.AreEqual(q.ActionName,"ev"); + Assert.AreEqual(q.ActionParameters.Count,2); + Assert.AreEqual(q.ActionParameters[1],"file2.txt"); + } + } +} diff --git a/WinAlfred.Test/WinAlfred.Test.csproj b/WinAlfred.Test/WinAlfred.Test.csproj new file mode 100644 index 0000000000..d6fd6e7a9c --- /dev/null +++ b/WinAlfred.Test/WinAlfred.Test.csproj @@ -0,0 +1,68 @@ + + + + + Debug + AnyCPU + {FF742965-9A80-41A5-B042-D6C7D3A21708} + Library + Properties + WinAlfred.Test + WinAlfred.Test + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\NUnit.2.6.3\lib\nunit.framework.dll + + + + + + + + + + + + + + + + + + {8451ECDD-2EA4-4966-BB0A-7BBC40138E80} + WinAlfred.Plugin + + + {2770F339-701C-4698-8C9F-0FE007DFDFC5} + WinAlfred + + + + + \ No newline at end of file diff --git a/WinAlfred.Test/packages.config b/WinAlfred.Test/packages.config new file mode 100644 index 0000000000..11e8d22bed --- /dev/null +++ b/WinAlfred.Test/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/WinAlfred.sln b/WinAlfred.sln new file mode 100644 index 0000000000..bdcf955158 --- /dev/null +++ b/WinAlfred.sln @@ -0,0 +1,43 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinAlfred", "WinAlfred\WinAlfred.csproj", "{2770F339-701C-4698-8C9F-0FE007DFDFC5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinAlfred.Test", "WinAlfred.Test\WinAlfred.Test.csproj", "{FF742965-9A80-41A5-B042-D6C7D3A21708}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinAlfred.Plugin", "WinAlfred.Plugin\WinAlfred.Plugin.csproj", "{8451ECDD-2EA4-4966-BB0A-7BBC40138E80}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugin", "Plugin", "{3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinAlfred.Plugin.Everything", "WinAlfred.Plugin.Everything\WinAlfred.Plugin.Everything.csproj", "{230AE83F-E92E-4E69-8355-426B305DA9C0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2770F339-701C-4698-8C9F-0FE007DFDFC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2770F339-701C-4698-8C9F-0FE007DFDFC5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2770F339-701C-4698-8C9F-0FE007DFDFC5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2770F339-701C-4698-8C9F-0FE007DFDFC5}.Release|Any CPU.Build.0 = Release|Any CPU + {FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FF742965-9A80-41A5-B042-D6C7D3A21708}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FF742965-9A80-41A5-B042-D6C7D3A21708}.Release|Any CPU.Build.0 = Release|Any CPU + {8451ECDD-2EA4-4966-BB0A-7BBC40138E80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8451ECDD-2EA4-4966-BB0A-7BBC40138E80}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8451ECDD-2EA4-4966-BB0A-7BBC40138E80}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8451ECDD-2EA4-4966-BB0A-7BBC40138E80}.Release|Any CPU.Build.0 = Release|Any CPU + {230AE83F-E92E-4E69-8355-426B305DA9C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {230AE83F-E92E-4E69-8355-426B305DA9C0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {230AE83F-E92E-4E69-8355-426B305DA9C0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {230AE83F-E92E-4E69-8355-426B305DA9C0}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {230AE83F-E92E-4E69-8355-426B305DA9C0} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} + EndGlobalSection +EndGlobal diff --git a/WinAlfred/FrmMain.Designer.cs b/WinAlfred/FrmMain.Designer.cs new file mode 100644 index 0000000000..e3f672f95f --- /dev/null +++ b/WinAlfred/FrmMain.Designer.cs @@ -0,0 +1,66 @@ +namespace WinAlfred +{ + partial class FrmMain + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows 窗体设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.textBox1 = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // textBox1 + // + this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.textBox1.Location = new System.Drawing.Point(12, 12); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(471, 21); + this.textBox1.TabIndex = 0; + // + // FrmMain + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(495, 45); + this.Controls.Add(this.textBox1); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FrmMain"; + this.ShowIcon = false; + this.Text = "Form1"; + this.TopMost = true; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox textBox1; + + + } +} + diff --git a/WinAlfred/FrmMain.cs b/WinAlfred/FrmMain.cs new file mode 100644 index 0000000000..5aaad25f42 --- /dev/null +++ b/WinAlfred/FrmMain.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace WinAlfred +{ + public partial class FrmMain : Form + { + public FrmMain() + { + InitializeComponent(); + } + } +} diff --git a/WinAlfred/FrmMain.resx b/WinAlfred/FrmMain.resx new file mode 100644 index 0000000000..7080a7d118 --- /dev/null +++ b/WinAlfred/FrmMain.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/WinAlfred/Program.cs b/WinAlfred/Program.cs new file mode 100644 index 0000000000..4e6377bc3f --- /dev/null +++ b/WinAlfred/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace WinAlfred +{ + static class Program + { + /// + /// 应用程序的主入口点。 + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new FrmMain()); + } + } +} diff --git a/WinAlfred/Properties/AssemblyInfo.cs b/WinAlfred/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..6e40bfb435 --- /dev/null +++ b/WinAlfred/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("WinAlfred")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("WinAlfred")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("5a68016d-17c8-4efb-9ecc-3ea7611d2b8f")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WinAlfred/Properties/Resources.Designer.cs b/WinAlfred/Properties/Resources.Designer.cs new file mode 100644 index 0000000000..d32addc9f5 --- /dev/null +++ b/WinAlfred/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本: 4.0.30319.18052 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace WinAlfred.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("WinAlfred.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/WinAlfred/Properties/Resources.resx b/WinAlfred/Properties/Resources.resx new file mode 100644 index 0000000000..af7dbebbac --- /dev/null +++ b/WinAlfred/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/WinAlfred/Properties/Settings.Designer.cs b/WinAlfred/Properties/Settings.Designer.cs new file mode 100644 index 0000000000..fbf9e505ae --- /dev/null +++ b/WinAlfred/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18052 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WinAlfred.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/WinAlfred/Properties/Settings.settings b/WinAlfred/Properties/Settings.settings new file mode 100644 index 0000000000..39645652af --- /dev/null +++ b/WinAlfred/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/WinAlfred/WinAlfred.csproj b/WinAlfred/WinAlfred.csproj new file mode 100644 index 0000000000..9921764eb4 --- /dev/null +++ b/WinAlfred/WinAlfred.csproj @@ -0,0 +1,84 @@ + + + + + Debug + AnyCPU + {2770F339-701C-4698-8C9F-0FE007DFDFC5} + WinExe + Properties + WinAlfred + WinAlfred + v3.5 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + Form + + + FrmMain.cs + + + + + FrmMain.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + \ No newline at end of file