diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..f905cbc
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,64 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
+.vs
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ff4070c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,263 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# DNX
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+*_i.c
+*_p.c
+*_i.h
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# TODO: Comment the next line if you want to checkin your web deploy settings
+# but database connection strings (with potential passwords) will be unencrypted
+#*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/packages/*
+# except build/, which is used as an MSBuild target.
+!**/packages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/packages/repositories.config
+# NuGet v3's project.json files produces more ignoreable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+node_modules/
+orleans.codegen.cs
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+
+# SQL Server files
+*.mdf
+*.ldf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+# CodeRush
+.cr/
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+.vs
\ No newline at end of file
diff --git a/Bin/Debug4KSO/config/EXCEL.xml b/Bin/Debug4KSO/config/EXCEL.xml
new file mode 100644
index 0000000..0d41f95
--- /dev/null
+++ b/Bin/Debug4KSO/config/EXCEL.xml
@@ -0,0 +1,374 @@
+
+
+ excel.application
+ 33
+ 115
+ 70
+ Application.Left
+ Application.Width
+ Application.Top
+ Selection.Text
+
+
+
+ 字体颜色[zitiyanse] : 自动[zidong]
+ Selection.Font.Color
+ 将所选字体的颜色设置为自动
+
+ -16777216
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 红色[hongse]
+ Selection.Font.Color
+ 将所选字体的颜色设置为红色
+
+ 255
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 蓝色[lanse]
+ Selection.Font.Color
+ 将所选字体的颜色设置为蓝色
+
+ 16711680
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 白色[baise]
+ Selection.Font.Color
+ 将所选字体的颜色设置为白色
+
+ 16777215
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 黄色[huangse]
+ Selection.Font.Color
+ 将所选字体的颜色设置为黄色
+
+ 65535
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 绿色[lvse]
+ Selection.Font.Color
+ 将所选字体的颜色设置为绿色
+
+ 32768
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 黑色[heise]
+ Selection.Font.Color
+ 将所选字体的颜色设置为黑色
+
+ 0
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 选择颜色[xuanzeyanse]
+ @Win32Color("Selection.Font.Color")!Selection.Font.Color
+ 从颜色对话框中选择字体颜色
+
+ -16777216
+ 0
+
+
+
+ 字体[ziti] : 宋体[songti]
+ Selection.Font.Name
+ 将所选文字的字体设置为宋体
+
+ 宋体
+ 0
+
+
+
+ 字体[ziti] : 仿宋[fangsong]
+ Selection.Font.Name
+ 将所选文字的字体设置为仿宋
+
+ 仿宋
+ 0
+
+
+
+ 字体[ziti] : 隶书[lishu]
+ Selection.Font.Name
+ 将所选文字的字体设置为隶书
+
+ 隶书
+ 0
+
+
+
+ 字体[ziti] : 微软雅黑[weiruanyahei]
+ Selection.Font.Name
+ 将所选文字的字体设置为微软雅黑
+
+ 微软雅黑
+ 0
+
+
+
+ 字体[ziti] : 黑体[heiti]
+ Selection.Font.Name
+ 将所选文字的字体设置为黑体
+
+ 黑体
+ 0
+
+
+
+ 字体[ziti] : Times New Roman
+ Selection.Font.Name
+ 将所选文字的字体设置为Times New Roman
+
+ "Times New Roman"
+ 0
+
+
+
+ 字体[ziti] : Consolas
+ Selection.Font.Name
+ 将所选文字的字体设置为Consolas
+
+ Consolas
+ 0
+
+
+
+ 字体[ziti] : Arial
+ Selection.Font.Name
+ 将所选文字的字体设置为Arial
+
+ Arial
+ 0
+
+
+
+ 字体[ziti] : 字体名
+ Selection.Font.Name
+ 将所选的文字设置为指定名称的字体
+ .
+
+ 0
+
+
+
+ 视图[shitu] : 分页预览[fenyeyulan]
+ ActiveWindow.View
+ 将视图设置为分页预览
+
+ 2
+ 0
+
+
+
+ 视图[shitu] : 普通视图[putongshitu]
+ ActiveWindow.View
+ 将视图设置为普通视图
+
+ 1
+ 0
+
+
+
+ 填充[tianchong] : 自动[zidong]
+ Selection.Interior.Color
+ 将所选单元格的填充颜色设置为自动
+
+ -16777216
+ 0
+
+
+
+ 填充[tianchong] : 红色[hongse]
+ Selection.Interior.Color
+ 将所选单元格的填充颜色设置为红色
+
+ 255
+ 0
+
+
+
+ 填充[tianchong] : 蓝色[lanse]
+ Selection.Interior.Color
+ 将所选单元格的填充颜色设置为蓝色
+
+ 16711680
+ 0
+
+
+
+ 填充[tianchong] : 白色[baise]
+ Selection.Interior.Color
+ 将所选单元格的填充颜色设置为白色
+
+ 16777215
+ 0
+
+
+
+ 填充[tianchong] : 黄色[huangse]
+ Selection.Interior.Color
+ 将所选单元格的填充颜色设置为黄色
+
+ 65535
+ 0
+
+
+
+ 填充[tianchong] : 绿色[lvse]
+ Selection.Interior.Color
+ 将所选单元格的填充颜色设置为绿色
+
+ 32768
+ 0
+
+
+
+ 填充[tianchong] : 黑色[heise]
+ Selection.Interior.Color
+ 将所选单元格的填充颜色设置为黑色
+
+ 0
+ 0
+
+
+
+ 填充[tianchong] : 选择颜色[xuanzeyanse]
+ @Win32Color("Selection.Interior.Color")!Selection.Interior.Color
+ 从颜色对话框中选择字体颜色
+
+ -16777216
+ 0
+
+
+
+ 批注[pizhu] : 插入[charupizhu]
+ @AuthorAndContent("Application.UserName", "{$1}")!ActiveCell.AddComment("{$1}")
+ 为单元格插入一个批注
+ .
+
+ 0
+
+
+
+ 纸张方向[zhizhangfangxiang] : 横向[hengxiang]
+ ActiveSheet.PageSetup.Orientation
+ 更改页面设置中的纸张方向为横向
+
+ 2
+ 0
+
+
+
+ 纸张方向[zhizhangfangxiang] : 纵向[zongxiang]
+ ActiveSheet.PageSetup.Orientation
+ 更改页面设置中的纸张方向为纵向
+
+ 1
+ 0
+
+
+
+ 纸张大小[zhizhangdaxiao] : A3
+ ActiveWorkbook.ActiveSheet.PageSetup.PaperSize
+ 将纸张大小更改为A3
+
+ 8
+ 0
+
+
+
+ 纸张大小[zhizhangdaxiao] : A4
+ ActiveWorkbook.ActiveSheet.PageSetup.PaperSize
+ 将纸张大小更改为A4
+
+ 9
+ 0
+
+
+
+ 纸张大小[zhizhangdaxiao] : B4
+ ActiveWorkbook.ActiveSheet.PageSetup.PaperSize
+ 将纸张大小更改为B4
+
+ 12
+ 0
+
+
+
+ 纸张大小[zhizhangdaxiao] : B5
+ ActiveWorkbook.ActiveSheet.PageSetup.PaperSize
+ 将纸张大小更改为B5
+
+ 13
+ 0
+
+
+
+ 纸张大小[zhizhangdaxiao] : 信纸[xinzhi]
+ ActiveWorkbook.ActiveSheet.PageSetup.PaperSize
+ 将纸张大小更改为Letter
+
+ 1
+ 0
+
+
+
+ 纸张大小[zhizhangdaxiao] : 法律专用纸[falvzhuanyongzhi]
+ ActiveWorkbook.ActiveSheet.PageSetup.PaperSize
+ 将纸张大小更改为Legal
+
+ 5
+ 0
+
+
+
+ 设置打印区域[shezhidayinquyu]
+ @GetObject("{$1}")!ActiveSheet.PageSetup.PrintArea
+ 将当前选择区域设置为打印区域
+
+ Selection.Address
+ 0
+
+
+
+ 取消打印区域[quxiaodayinquyu]
+ @EmptyString()!ActiveSheet.PageSetup.PrintArea
+ 清除之前设置的打印区域
+
+
+ 0
+
+
+
+ 窗口最大化[chuangkouzuidahua maximum]
+ Application.WindowState
+ 使程序窗口最大化
+
+ -4137
+ 0
+
+
+
+ 窗口还原[chuangkouhuanyuan normal]
+ Application.WindowState
+ 使程序窗口大小还原
+
+ -4143
+ 0
+
+
+
+
\ No newline at end of file
diff --git a/Bin/Debug4KSO/config/POWERPNT.xml b/Bin/Debug4KSO/config/POWERPNT.xml
new file mode 100644
index 0000000..4427f41
--- /dev/null
+++ b/Bin/Debug4KSO/config/POWERPNT.xml
@@ -0,0 +1,185 @@
+
+
+ powerpoint.application
+ 231
+ 121
+ 55
+ Left
+ Width
+ Top
+ ActiveWindow.Selection.TextRange.Text
+
+
+
+ 字体颜色[zitiyanse] : 自动[zidong]
+ ActiveWindow.Selection.TextRange.Font.Color
+ 将所选字体的颜色设置为自动
+
+ -16777216
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 红色[hongse]
+ ActiveWindow.Selection.TextRange.Font.Color
+ 将所选字体的颜色设置为红色
+
+ 255
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 蓝色[lanse]
+ ActiveWindow.Selection.TextRange.Font.Color
+ 将所选字体的颜色设置为蓝色
+
+ 16711680
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 白色[baise]
+ ActiveWindow.Selection.TextRange.Font.Color
+ 将所选字体的颜色设置为白色
+
+ 16777215
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 黄色[huangse]
+ ActiveWindow.Selection.TextRange.Font.Color
+ 将所选字体的颜色设置为黄色
+
+ 65535
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 绿色[lvse]
+ ActiveWindow.Selection.TextRange.Font.Color
+ 将所选字体的颜色设置为绿色
+
+ 32768
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 黑色[heise]
+ ActiveWindow.Selection.TextRange.Font.Color
+ 将所选字体的颜色设置为黑色
+
+ 0
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 选择颜色[xuanzeyanse]
+ @Win32Color("ActiveWindow.Selection.TextRange.Font.Color.RGB")!ActiveWindow.Selection.TextRange.Font.Color
+ 从颜色对话框中选择字体颜色
+
+
+ 0
+
+
+
+ 字体[ziti] : 宋体[songti]
+ ActiveWindow.Selection.TextRange.Font.Name
+ 将所选文字的字体设置为宋体
+
+ 宋体
+ 0
+
+
+
+ 字体[ziti] : 仿宋[fangsong]
+ ActiveWindow.Selection.TextRange.Font.Name
+ 将所选文字的字体设置为仿宋
+
+ 仿宋
+ 0
+
+
+
+ 字体[ziti] : 隶书[lishu]
+ ActiveWindow.Selection.TextRange.Font.Name
+ 将所选文字的字体设置为隶书
+
+ 隶书
+ 0
+
+
+
+ 字体[ziti] : 微软雅黑[weiruanyahei]
+ ActiveWindow.Selection.TextRange.Font.Name
+ 将所选文字的字体设置为微软雅黑
+
+ 微软雅黑
+ 0
+
+
+
+ 字体[ziti] : 黑体[heiti]
+ ActiveWindow.Selection.TextRange.Font.Name
+ 将所选文字的字体设置为黑体
+
+ 黑体
+ 0
+
+
+
+ 字体[ziti] : Times New Roman
+ ActiveWindow.Selection.TextRange.Font.Name
+ 将所选文字的字体设置为Times New Roman
+
+ "Times New Roman"
+ 0
+
+
+
+ 字体[ziti] : Consolas
+ ActiveWindow.Selection.TextRange.Font.Name
+ 将所选文字的字体设置为Consolas
+
+ Consolas
+ 0
+
+
+
+ 字体[ziti] : Arial
+ ActiveWindow.Selection.TextRange.Font.Name
+ 将所选文字的字体设置为Arial
+
+ Arial
+ 0
+
+
+
+ 字体[ziti] : 字体名
+ ActiveWindow.Selection.TextRange.Font.Name
+ 将所选文字的字体设置为指定名称的字体
+ .
+
+ 0
+
+
+
+ 窗口最大化[chuangkouzuidahua maximum]
+ WindowState
+ 使程序窗口最大化
+
+ 3
+ 0
+
+
+
+ 窗口还原[chuangkouhuanyuan normal]
+ WindowState
+ 使程序窗口大小还原
+
+ 1
+ 0
+
+
+
+
\ No newline at end of file
diff --git a/Bin/Debug4KSO/config/WINWORD.xml b/Bin/Debug4KSO/config/WINWORD.xml
new file mode 100644
index 0000000..1b63920
--- /dev/null
+++ b/Bin/Debug4KSO/config/WINWORD.xml
@@ -0,0 +1,697 @@
+
+
+ word.application
+ 77
+ 130
+ 228
+ Application.Left
+ Application.Width
+ Application.Top
+ Selection.Text
+
+
+
+ 标尺[biaochi] : 切换[qiehuan]
+ !ActiveWindow.DisplayRulers
+ 显示或隐藏标尺
+
+ True
+ 0
+
+
+
+ 表格[biaoge] : 插入[charubiaoge] {x,y}
+ Selection.Tables.Add(Selection.Range, {$1}, {$2})
+ 在光标位置插入一个x行、y列的表格,默认为5行2列
+ \d
+ 5,2
+ 0
+
+
+
+ 表格[biaoge] : 删除[shanchubiaoge]
+ Selection.Tables[1].Delete()
+ 删除光标所在的表格
+
+
+ 0
+
+
+
+ 表格[biaoge] : 拆分单元格[chaifendanyuange] {x,y}
+ Selection.Cells.Split({$1}, {$2})
+ 拆分光标所在的表格为x行、y列
+ \d
+
+ 0
+
+
+
+ 表格[biaoge] : 合并单元格[hebingdanyuange]
+ Selection.Cells.Merge()
+ 合并所选单元格
+
+
+ 0
+
+
+
+ 表格[biaoge] : 拆分表格[chaifenbiaoge]
+ Selection.SplitTable()
+ 拆分当前表格
+
+
+ 0
+
+
+
+ 表格[biaoge] : 删除行[shanchuhang]
+ Selection.Rows.Delete()
+ 删除光标所选的表格行
+
+
+ 0
+
+
+
+ 表格[biaoge] : 删除列[shanchulie]
+ Selection.Columns.Delete()
+ 删除光标所选的表格列
+
+
+ 0
+
+
+
+ 表格[biaoge] : 插入行[charuhang] 上[shang]
+ Selection.Rows.Add(Selection.Rows[1])
+ 在光标所在表格行的上方插入新的一表格行
+
+
+ 0
+
+
+
+ 表格[biaoge] : 插入行[charuhang] 下[xia]
+ Selection.Rows.Add()
+ 在光标所在表格行的下方插入新的一表格行
+
+
+ 0
+
+
+
+ 表格[biaoge] : 插入列[charulie] 左[zuo]
+ Selection.Columns.Add(Selection.Columns[1])
+ 在光标所在表格列的左方插入新的一表格列
+
+
+ 0
+
+
+
+ 表格[biaoge] : 插入列[charulie] 右[you]
+ Selection.Columns.Add()
+ 在光标所在表格列的右方插入新的一表格列
+
+
+ 0
+
+
+
+ 画布[huabu] : 插入画布[charuhuabu]
+ ActiveDocument.Shapes.AddCanvas(90, 70, 420, 140)
+ 在默认位置插入一个画布
+
+
+ 0
+
+
+
+ 上标[shangbiao] : 开[kai]
+ Selection.Font.Superscript
+ 为所选文字设置上标
+
+ 1
+ 0
+
+
+
+ 上标[shangbiao] : 关[guan]
+ Selection.Font.Superscript
+ 为所选文字取消设置上标
+
+ 0
+ 0
+
+
+
+ 下标[xiabiao] : 开[kai]
+ Selection.Font.Subscript
+ 为所选文字设置下标
+
+ 1
+ 0
+
+
+
+ 下标[xiabiao] : 关[guan]
+ Selection.Font.Subscript
+ 为所选文字取消设置下标
+
+ 0
+ 0
+
+
+
+ 阴影[yinying] : 开[kai]
+ Selection.Font.Shadow
+ 为所选文字设置阴影
+
+ 1
+ 0
+
+
+
+ 阴影[yinying] : 关[guan]
+ Selection.Font.Shadow
+ 为所选文字取消设置阴影
+
+ 0
+ 0
+
+
+
+ 清除字体格式[qingchuzitigeshi]
+ Selection.ClearFormatting()
+ 清除所选文字的格式
+
+
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 自动[zidong]
+ Selection.Font.Color
+ 将所选字体的颜色设置为自动
+
+ -16777216
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 红色[hongse]
+ Selection.Font.Color
+ 将所选字体的颜色设置为红色
+
+ 255
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 蓝色[lanse]
+ Selection.Font.Color
+ 将所选字体的颜色设置为蓝色
+
+ 16711680
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 白色[baise]
+ Selection.Font.Color
+ 将所选字体的颜色设置为白色
+
+ 16777215
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 黄色[huangse]
+ Selection.Font.Color
+ 将所选字体的颜色设置为黄色
+
+ 65535
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 绿色[lvse]
+ Selection.Font.Color
+ 将所选字体的颜色设置为绿色
+
+ 32768
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 黑色[heise]
+ Selection.Font.Color
+ 将所选字体的颜色设置为黑色
+
+ 0
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 选择颜色[xuanzeyanse]
+ @Win32Color("Selection.Font.Color")!Selection.Font.Color
+ 从颜色对话框中选择字体颜色
+
+
+ 0
+
+
+
+ 字体[ziti] : 宋体[songti]
+ Selection.Font.Name
+ 将所选文字的字体设置为宋体
+
+ 宋体
+ 0
+
+
+
+ 字体[ziti] : 仿宋[fangsong]
+ Selection.Font.Name
+ 将所选文字的字体设置为仿宋
+
+ 仿宋
+ 0
+
+
+
+ 字体[ziti] : 隶书[lishu]
+ Selection.Font.Name
+ 将所选文字的字体设置为隶书
+
+ 隶书
+ 0
+
+
+
+ 字体[ziti] : 微软雅黑[weiruanyahei]
+ Selection.Font.Name
+ 将所选文字的字体设置为微软雅黑
+
+ 微软雅黑
+ 0
+
+
+
+ 字体[ziti] : 黑体[heiti]
+ Selection.Font.Name
+ 将所选文字的字体设置为黑体
+
+ 黑体
+ 0
+
+
+
+ 字体[ziti] : Times New Roman
+ Selection.Font.Name
+ 将所选文字的字体设置为Times New Roman
+
+ "Times New Roman"
+ 0
+
+
+
+ 字体[ziti] : Consolas
+ Selection.Font.Name
+ 将所选文字的字体设置为Consolas
+
+ Consolas
+ 0
+
+
+
+ 字体[ziti] : Arial
+ Selection.Font.Name
+ 将所选文字的字体设置为Arial
+
+ Arial
+ 0
+
+
+
+ 字体[ziti] : 字体名
+ Selection.Font.Name
+ 将所选文字的字体设置为指定名称的字体
+ .
+
+ 0
+
+
+
+ 批注[pizhu] : 插入[charupizhu] 批注内容
+ Selection.Comments.Add(Selection.Range, "{$1}")
+ 为所选内容插入一个批注
+ .
+ 修改批注
+ 0
+
+
+
+ 批注[pizhu] : 删除[shanchupizhu]
+ Selection.Comments[1].Delete()
+ 删除当前批注
+
+
+ 0
+
+
+
+ 批注[pizhu] : 修改[xiugaipizhu] 批注内容
+ Selection.Comments[1].Range.Text
+ 修改当前批注
+ .
+
+ 0
+
+
+
+ 书签[shuqian] : 插入[charushuqian] 书签名
+ Selection.Bookmarks.Add("{$1}", Selection.Range)
+ 在当前位置插入一个书签
+ .
+
+ 0
+
+
+
+ 修订[xiuding] : 开[kai]
+ ActiveDocument.TrackRevisions
+ 打开修订模式
+
+ True
+ 0
+
+
+
+ 修订[xiuding] : 关[guan]
+ ActiveDocument.TrackRevisions
+ 关闭修订模式
+
+ False
+ 0
+
+
+
+ 修订[xiuding] : 接受此处[jieshoucichu]
+ Selection.Range.Revisions.AcceptAll()
+ 接受光标选择区域的所有修订
+
+
+ 0
+
+
+
+ 修订[xiuding] : 拒绝此处[jujuecichu]
+ Selection.Range.Revisions.RejectAll()
+ 接受光标选择区域的所有修订
+
+
+ 0
+
+
+
+ 修订[xiuding] : 接受全部[jieshouquanbu]
+ ActiveDocument.AcceptAllRevisions()
+ 接受文档中的全部修订
+
+
+ 0
+
+
+
+ 修订[xiuding] : 拒绝全部[jujuequanbu]
+ ActiveDocument.RejectAllRevisions()
+ 拒绝文档中的全部修订
+
+
+ 0
+
+
+
+ 书签[shuqian] : 删除[shanchushuqian]
+ Selection.Bookmarks[1].Delete()
+ 修改当前书签
+
+
+ 0
+
+
+
+ 跳转[gotopage tiaozhuan] : 页码[yema]
+ Selection.GoTo(1, 1, {$1}, "")
+ 光标跳转到指定页码
+ \d
+
+ 0
+
+
+
+ 跳转[gotosection tiaozhuan] : 节[jie]
+ Selection.GoTo(0, 1, {$1}, "")
+ 光标跳转到指定节
+ \d
+
+ 0
+
+
+
+ 跳转[gotoline tiaozhuan] : 行[hang]
+ Selection.GoTo(3, 1, {$1}, "")
+ 光标跳转到指定行
+ \d
+
+ 0
+
+
+
+ 跳转[gotobookmark tiaozhuan] : 书签[shuqian] 书签名
+ Selection.GoTo(-1, 1, 0, "{$1}")
+ 光标跳转到指定书签
+ .
+
+ 0
+
+
+
+ 样式[yangshi] : 正文[zhengwen]
+ Selection.Range.Style
+ 将所选内容的样式设置为正文
+
+ 正文
+ 0
+
+
+
+ 样式[yangshi] : 标题 1[biaoti 1]
+ Selection.Range.Style
+ 将所选内容的样式设置为标题 1
+
+ "标题 1"
+ 0
+
+
+
+ 样式[yangshi] : 标题 2[biaoti 2]
+ Selection.Range.Style
+ 将所选内容的样式设置为标题 2
+
+ "标题 2"
+ 0
+
+
+
+ 样式[yangshi] : 标题 3[biaoti 3]
+ Selection.Range.Style
+ 将所选内容的样式设置为标题 3
+
+ "标题 3"
+ 0
+
+
+
+ 样式[yangshi] : 样式名
+ Selection.Range.Style
+ 将所选内容的样式设置为输入的样式名
+ .
+
+ 0
+
+
+
+ 视图[shitu] : 页面视图[yemianshitu]
+ ActiveWindow.View.Type
+ 将页面视图切换为页面视图
+
+ 3
+ 0
+
+
+
+ 视图[shitu] : 大纲视图[dagangshitu]
+ ActiveWindow.View.Type
+ 将页面视图切换为大纲视图
+
+ 2
+ 0
+
+
+
+ 视图[shitu] : Web视图[shitu]
+ ActiveWindow.View.Type
+ 将页面视图切换为Web视图
+
+ 6
+ 0
+
+
+
+ 拆分窗口[chaifenchuangkou] 切换[qiehuan]
+ !ActiveWindow.Split
+ 打开或取消拆分窗口
+
+
+ 0
+
+
+
+ 打印[dayin] : 全部[quanbu]
+ ActiveDocument.PrintOut(false, true, 0)
+ 打印文档的全部内容
+
+
+ 0
+
+
+
+ 打印[dayin] : 当前页[dangqianye]
+ ActiveDocument.PrintOut(false, true, 2)
+ 打印文档的当前页
+
+
+ 0
+
+
+
+ 打印[dayin] : 页码范围[yemafanwei] {x,y}
+ ActiveDocument.PrintOut(false, true, 3, "", {$1}, {$2})
+ 打印文档的第a页到第b页
+ \d
+
+ 0
+
+
+
+ 纸张方向[zhizhangfangxiang] : 横向[hengxiang]
+ ActiveDocument.PageSetup.Orientation
+ 更改页面设置中的纸张方向为横向
+
+ 1
+ 0
+
+
+
+ 纸张方向[zhizhangfangxiang] : 纵向[zongxiang]
+ ActiveDocument.PageSetup.Orientation
+ 更改页面设置中的纸张方向为纵向
+
+ 0
+ 0
+
+
+
+ 纸张大小[zhizhangdaxiao] : A3
+ ActiveDocument.PageSetup.PaperSize
+ 将纸张大小更改为A3
+
+ 6
+ 0
+
+
+
+ 纸张大小[zhizhangdaxiao] : A4
+ ActiveDocument.PageSetup.PaperSize
+ 将纸张大小更改为A4
+
+ 7
+ 0
+
+
+
+ 纸张大小[zhizhangdaxiao] : B4
+ ActiveDocument.PageSetup.PaperSize
+ 将纸张大小更改为B4
+
+ 10
+ 0
+
+
+
+ 纸张大小[zhizhangdaxiao] : B5
+ ActiveDocument.PageSetup.PaperSize
+ 将纸张大小更改为B5
+
+ 11
+ 0
+
+
+
+ 纸张大小[zhizhangdaxiao] : 信纸[xinzhi]
+ ActiveDocument.PageSetup.PaperSize
+ 将纸张大小更改为Letter
+
+ 2
+ 0
+
+
+
+ 纸张大小[zhizhangdaxiao] : 法律专用纸[falvzhuanyongzhi]
+ ActiveDocument.PageSetup.PaperSize
+ 将纸张大小更改为Legal
+
+ 4
+ 0
+
+
+
+ 兼容模式[jianrongmoshi]
+ ActiveDocument.SetCompatibilityMode(11)
+ 将文档模式改为wdWord2003
+
+
+ 0
+
+
+
+ 非兼容模式[feijianrongmoshi]
+ ActiveDocument.SetCompatibilityMode(14)
+ 将文档模式改为wdWord2010
+
+
+ 0
+
+
+
+ 窗口最大化[chuangkouzuidahua maximum]
+ Application.WindowState
+ 使程序窗口最大化
+
+ 1
+ 0
+
+
+
+ 窗口还原[chuangkouhuanyuan normal]
+ Application.WindowState
+ 使程序窗口大小还原
+
+ 0
+ 0
+
+
+
\ No newline at end of file
diff --git a/Bin/Debug4KSO/config/__global.xml b/Bin/Debug4KSO/config/__global.xml
new file mode 100644
index 0000000..13db282
--- /dev/null
+++ b/Bin/Debug4KSO/config/__global.xml
@@ -0,0 +1,45 @@
+
+
+
+ 255
+ 255
+ 255
+ Left
+ Width
+ Top
+ GetSelection
+
+
+ BM
+ Call("http://wpswebsvr.wps.kingsoft.net/ksbm/", "")
+ 打开Bug Manager
+
+
+ 0
+
+
+ BM {ID}
+ Call("http://wpswebsvr.wps.kingsoft.net/ksbm/ViewIssue.aspx?IssueID={$1}", "")
+ 跳转到Bug Mananger中指定的Bug ID
+ .
+
+ 0
+
+
+ 代码审查[daimashencha]
+ Call("http://10.20.172.159/reviews/dashboard/", "")
+ 打开在线代码审查页面
+
+
+ 0
+
+
+ 代码审查[daimashencha] {ID}
+ Call("http://10.20.172.159/reviews/r/{$1}/", "")
+ 跳转到在线代码审查中指定的条目
+ .
+
+ 0
+
+
+
\ No newline at end of file
diff --git a/Bin/Debug4KSO/config/et.xml b/Bin/Debug4KSO/config/et.xml
new file mode 100644
index 0000000..4e5421b
--- /dev/null
+++ b/Bin/Debug4KSO/config/et.xml
@@ -0,0 +1,374 @@
+
+
+ ket.application, et.application
+ 99
+ 180
+ 47
+ Application.Left
+ Application.Width
+ Application.Top
+ Selection.Text
+
+
+
+ 字体颜色[zitiyanse] : 自动[zidong]
+ Selection.Font.Color
+ 将所选字体的颜色设置为自动
+
+ -16777216
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 红色[hongse]
+ Selection.Font.Color
+ 将所选字体的颜色设置为红色
+
+ 255
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 蓝色[lanse]
+ Selection.Font.Color
+ 将所选字体的颜色设置为蓝色
+
+ 16711680
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 白色[baise]
+ Selection.Font.Color
+ 将所选字体的颜色设置为白色
+
+ 16777215
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 黄色[huangse]
+ Selection.Font.Color
+ 将所选字体的颜色设置为黄色
+
+ 65535
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 绿色[lvse]
+ Selection.Font.Color
+ 将所选字体的颜色设置为绿色
+
+ 32768
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 黑色[heise]
+ Selection.Font.Color
+ 将所选字体的颜色设置为黑色
+
+ 0
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 选择颜色[xuanzeyanse]
+ @Win32Color("Selection.Font.Color")!Selection.Font.Color
+ 从颜色对话框中选择字体颜色
+
+ -16777216
+ 0
+
+
+
+ 字体[ziti] : 宋体[songti]
+ Selection.Font.Name
+ 将所选文字的字体设置为宋体
+
+ 宋体
+ 0
+
+
+
+ 字体[ziti] : 仿宋[fangsong]
+ Selection.Font.Name
+ 将所选文字的字体设置为仿宋
+
+ 仿宋
+ 0
+
+
+
+ 字体[ziti] : 隶书[lishu]
+ Selection.Font.Name
+ 将所选文字的字体设置为隶书
+
+ 隶书
+ 0
+
+
+
+ 字体[ziti] : 微软雅黑[weiruanyahei]
+ Selection.Font.Name
+ 将所选文字的字体设置为微软雅黑
+
+ 微软雅黑
+ 0
+
+
+
+ 字体[ziti] : 黑体[heiti]
+ Selection.Font.Name
+ 将所选文字的字体设置为黑体
+
+ 黑体
+ 0
+
+
+
+ 字体[ziti] : Times New Roman
+ Selection.Font.Name
+ 将所选文字的字体设置为Times New Roman
+
+ "Times New Roman"
+ 0
+
+
+
+ 字体[ziti] : Consolas
+ Selection.Font.Name
+ 将所选文字的字体设置为Consolas
+
+ Consolas
+ 0
+
+
+
+ 字体[ziti] : Arial
+ Selection.Font.Name
+ 将所选文字的字体设置为Arial
+
+ Arial
+ 0
+
+
+
+ 字体[ziti] : 字体名
+ Selection.Font.Name
+ 将所选的文字设置为指定名称的字体
+ .
+
+ 0
+
+
+
+ 视图[shitu] : 分页预览[fenyeyulan]
+ ActiveWindow.View
+ 将视图设置为分页预览
+
+ 2
+ 0
+
+
+
+ 视图[shitu] : 普通视图[putongshitu]
+ ActiveWindow.View
+ 将视图设置为普通视图
+
+ 1
+ 0
+
+
+
+ 填充[tianchong] : 自动[zidong]
+ Selection.Interior.Color
+ 将所选单元格的填充颜色设置为自动
+
+ -16777216
+ 0
+
+
+
+ 填充[tianchong] : 红色[hongse]
+ Selection.Interior.Color
+ 将所选单元格的填充颜色设置为红色
+
+ 255
+ 0
+
+
+
+ 填充[tianchong] : 蓝色[lanse]
+ Selection.Interior.Color
+ 将所选单元格的填充颜色设置为蓝色
+
+ 16711680
+ 0
+
+
+
+ 填充[tianchong] : 白色[baise]
+ Selection.Interior.Color
+ 将所选单元格的填充颜色设置为白色
+
+ 16777215
+ 0
+
+
+
+ 填充[tianchong] : 黄色[huangse]
+ Selection.Interior.Color
+ 将所选单元格的填充颜色设置为黄色
+
+ 65535
+ 0
+
+
+
+ 填充[tianchong] : 绿色[lvse]
+ Selection.Interior.Color
+ 将所选单元格的填充颜色设置为绿色
+
+ 32768
+ 0
+
+
+
+ 填充[tianchong] : 黑色[heise]
+ Selection.Interior.Color
+ 将所选单元格的填充颜色设置为黑色
+
+ 0
+ 0
+
+
+
+ 填充[tianchong] : 选择颜色[xuanzeyanse]
+ @Win32Color("Selection.Interior.Color")!Selection.Interior.Color
+ 从颜色对话框中选择字体颜色
+
+ -16777216
+ 0
+
+
+
+ 批注[pizhu] : 插入[charupizhu]
+ @AuthorAndContent("Application.UserName", "{$1}")!ActiveCell.AddComment("{$1}")
+ 为单元格插入一个批注
+ .
+
+ 0
+
+
+
+ 纸张方向[zhizhangfangxiang] : 横向[hengxiang]
+ ActiveSheet.PageSetup.Orientation
+ 更改页面设置中的纸张方向为横向
+
+ 2
+ 0
+
+
+
+ 纸张方向[zhizhangfangxiang] : 纵向[zongxiang]
+ ActiveSheet.PageSetup.Orientation
+ 更改页面设置中的纸张方向为纵向
+
+ 1
+ 0
+
+
+
+ 纸张大小[zhizhangdaxiao] : A3
+ ActiveWorkbook.ActiveSheet.PageSetup.PaperSize
+ 将纸张大小更改为A3
+
+ 8
+ 0
+
+
+
+ 纸张大小[zhizhangdaxiao] : A4
+ ActiveWorkbook.ActiveSheet.PageSetup.PaperSize
+ 将纸张大小更改为A4
+
+ 9
+ 0
+
+
+
+ 纸张大小[zhizhangdaxiao] : B4
+ ActiveWorkbook.ActiveSheet.PageSetup.PaperSize
+ 将纸张大小更改为B4
+
+ 12
+ 0
+
+
+
+ 纸张大小[zhizhangdaxiao] : B5
+ ActiveWorkbook.ActiveSheet.PageSetup.PaperSize
+ 将纸张大小更改为B5
+
+ 13
+ 0
+
+
+
+ 纸张大小[zhizhangdaxiao] : 信纸[xinzhi]
+ ActiveWorkbook.ActiveSheet.PageSetup.PaperSize
+ 将纸张大小更改为Letter
+
+ 1
+ 0
+
+
+
+ 纸张大小[zhizhangdaxiao] : 法律专用纸[falvzhuanyongzhi]
+ ActiveWorkbook.ActiveSheet.PageSetup.PaperSize
+ 将纸张大小更改为Legal
+
+ 5
+ 0
+
+
+
+ 设置打印区域[shezhidayinquyu]
+ @GetObject("{$1}")!ActiveSheet.PageSetup.PrintArea
+ 将当前选择区域设置为打印区域
+
+ Selection.Address
+ 0
+
+
+
+ 取消打印区域[quxiaodayinquyu]
+ @EmptyString()!ActiveSheet.PageSetup.PrintArea
+ 清除之前设置的打印区域
+
+
+ 0
+
+
+
+ 窗口最大化[chuangkouzuidahua maximum]
+ Application.WindowState
+ 使程序窗口最大化
+
+ -4137
+ 0
+
+
+
+ 窗口还原[chuangkouhuanyuan normal]
+ Application.WindowState
+ 使程序窗口大小还原
+
+ -4143
+ 0
+
+
+
+
\ No newline at end of file
diff --git a/Bin/Debug4KSO/config/wpp.xml b/Bin/Debug4KSO/config/wpp.xml
new file mode 100644
index 0000000..f2ee0e9
--- /dev/null
+++ b/Bin/Debug4KSO/config/wpp.xml
@@ -0,0 +1,185 @@
+
+
+ kwpp.application, wpp.application
+ 231
+ 121
+ 55
+ Left
+ Width
+ Top
+ ActiveWindow.Selection.TextRange.Text
+
+
+
+ 字体颜色[zitiyanse] : 自动[zidong]
+ ActiveWindow.Selection.TextRange.Font.Color
+ 将所选字体的颜色设置为自动
+
+ -16777216
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 红色[hongse]
+ ActiveWindow.Selection.TextRange.Font.Color
+ 将所选字体的颜色设置为红色
+
+ 255
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 蓝色[lanse]
+ ActiveWindow.Selection.TextRange.Font.Color
+ 将所选字体的颜色设置为蓝色
+
+ 16711680
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 白色[baise]
+ ActiveWindow.Selection.TextRange.Font.Color
+ 将所选字体的颜色设置为白色
+
+ 16777215
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 黄色[huangse]
+ ActiveWindow.Selection.TextRange.Font.Color
+ 将所选字体的颜色设置为黄色
+
+ 65535
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 绿色[lvse]
+ ActiveWindow.Selection.TextRange.Font.Color
+ 将所选字体的颜色设置为绿色
+
+ 32768
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 黑色[heise]
+ ActiveWindow.Selection.TextRange.Font.Color
+ 将所选字体的颜色设置为黑色
+
+ 0
+ 0
+
+
+
+ 字体颜色[zitiyanse] : 选择颜色[xuanzeyanse]
+ @Win32Color("ActiveWindow.Selection.TextRange.Font.Color.RGB")!ActiveWindow.Selection.TextRange.Font.Color
+ 从颜色对话框中选择字体颜色
+
+
+ 0
+
+
+
+ 字体[ziti] : 宋体[songti]
+ ActiveWindow.Selection.TextRange.Font.Name
+ 将所选文字的字体设置为宋体
+
+ 宋体
+ 0
+
+
+
+ 字体[ziti] : 仿宋[fangsong]
+ ActiveWindow.Selection.TextRange.Font.Name
+ 将所选文字的字体设置为仿宋
+
+ 仿宋
+ 0
+
+
+
+ 字体[ziti] : 隶书[lishu]
+ ActiveWindow.Selection.TextRange.Font.Name
+ 将所选文字的字体设置为隶书
+
+ 隶书
+ 0
+
+
+
+ 字体[ziti] : 微软雅黑[weiruanyahei]
+ ActiveWindow.Selection.TextRange.Font.Name
+ 将所选文字的字体设置为微软雅黑
+
+ 微软雅黑
+ 0
+
+
+
+ 字体[ziti] : 黑体[heiti]
+ ActiveWindow.Selection.TextRange.Font.Name
+ 将所选文字的字体设置为黑体
+
+ 黑体
+ 0
+
+
+
+ 字体[ziti] : Times New Roman
+ ActiveWindow.Selection.TextRange.Font.Name
+ 将所选文字的字体设置为Times New Roman
+
+ "Times New Roman"
+ 0
+
+
+
+ 字体[ziti] : Consolas
+ ActiveWindow.Selection.TextRange.Font.Name
+ 将所选文字的字体设置为Consolas
+
+ Consolas
+ 0
+
+
+
+ 字体[ziti] : Arial
+ ActiveWindow.Selection.TextRange.Font.Name
+ 将所选文字的字体设置为Arial
+
+ Arial
+ 0
+
+
+
+ 字体[ziti] : 字体名
+ ActiveWindow.Selection.TextRange.Font.Name
+ 将所选文字的字体设置为指定名称的字体
+ .
+
+ 0
+
+
+
+ 窗口最大化[chuangkouzuidahua maximum]
+ WindowState
+ 使程序窗口最大化
+
+ 3
+ 0
+
+
+
+ 窗口还原[chuangkouhuanyuan normal]
+ WindowState
+ 使程序窗口大小还原
+
+ 1
+ 0
+
+
+
+
\ No newline at end of file
diff --git a/Bin/Debug4KSO/config/wps.xml b/Bin/Debug4KSO/config/wps.xml
new file mode 100644
index 0000000..4305414
--- /dev/null
+++ b/Bin/Debug4KSO/config/wps.xml
@@ -0,0 +1,629 @@
+
+
+ kwps.application, wps.application
+ 77
+ 130
+ 228
+ Application.Left
+ Application.Width
+ Application.Top
+ Selection.Text
+
+
+ 标尺[biaochi] : 切换[qiehuan]
+ !ActiveWindow.DisplayRulers
+ 显示或隐藏标尺
+
+ True
+ 0
+
+
+ 表格[biaoge] : 插入[charubiaoge] {x,y}
+ Selection.Tables.Add(Selection.Range, {$1}, {$2})
+ 在光标位置插入一个x行、y列的表格,默认为5行2列
+ \d
+ 5,2
+ 0
+
+
+ 表格[biaoge] : 删除[shanchubiaoge]
+ Selection.Tables[1].Delete()
+ 删除光标所在的表格
+
+
+ 0
+
+
+ 表格[biaoge] : 拆分单元格[chaifendanyuange] {x,y}
+ Selection.Cells.Split({$1}, {$2})
+ 拆分光标所在的表格为x行、y列
+ \d
+
+ 0
+
+
+ 表格[biaoge] : 合并单元格[hebingdanyuange]
+ Selection.Cells.Merge()
+ 合并所选单元格
+
+
+ 0
+
+
+ 表格[biaoge] : 拆分表格[chaifenbiaoge]
+ Selection.SplitTable()
+ 拆分当前表格
+
+
+ 0
+
+
+ 表格[biaoge] : 删除行[shanchuhang]
+ Selection.Rows.Delete()
+ 删除光标所选的表格行
+
+
+ 0
+
+
+ 表格[biaoge] : 删除列[shanchulie]
+ Selection.Columns.Delete()
+ 删除光标所选的表格列
+
+
+ 0
+
+
+ 表格[biaoge] : 插入行[charuhang] 上[shang]
+ Selection.Rows.Add(Selection.Rows[1])
+ 在光标所在表格行的上方插入新的一表格行
+
+
+ 0
+
+
+ 表格[biaoge] : 插入行[charuhang] 下[xia]
+ Selection.Rows.Add()
+ 在光标所在表格行的下方插入新的一表格行
+
+
+ 0
+
+
+ 表格[biaoge] : 插入列[charulie] 左[zuo]
+ Selection.Columns.Add(Selection.Columns[1])
+ 在光标所在表格列的左方插入新的一表格列
+
+
+ 0
+
+
+ 表格[biaoge] : 插入列[charulie] 右[you]
+ Selection.Columns.Add()
+ 在光标所在表格列的右方插入新的一表格列
+
+
+ 0
+
+
+ 画布[huabu] : 插入画布[charuhuabu]
+ ActiveDocument.Shapes.AddCanvas(90, 70, 420, 140)
+ 在默认位置插入一个画布
+
+
+ 0
+
+
+ 上标[shangbiao] : 开[kai]
+ Selection.Font.Superscript
+ 为所选文字设置上标
+
+ 1
+ 0
+
+
+ 上标[shangbiao] : 关[guan]
+ Selection.Font.Superscript
+ 为所选文字取消设置上标
+
+ 0
+ 0
+
+
+ 下标[xiabiao] : 开[kai]
+ Selection.Font.Subscript
+ 为所选文字设置下标
+
+ 1
+ 0
+
+
+ 下标[xiabiao] : 关[guan]
+ Selection.Font.Subscript
+ 为所选文字取消设置下标
+
+ 0
+ 0
+
+
+ 阴影[yinying] : 开[kai]
+ Selection.Font.Shadow
+ 为所选文字设置阴影
+
+ 1
+ 0
+
+
+ 阴影[yinying] : 关[guan]
+ Selection.Font.Shadow
+ 为所选文字取消设置阴影
+
+ 0
+ 0
+
+
+ 清除字体格式[qingchuzitigeshi]
+ Selection.ClearFormatting()
+ 清除所选文字的格式
+
+
+ 0
+
+
+ 字体颜色[zitiyanse] : 自动[zidong]
+ Selection.Font.Color
+ 将所选字体的颜色设置为自动
+
+ -16777216
+ 0
+
+
+ 字体颜色[zitiyanse] : 红色[hongse]
+ Selection.Font.Color
+ 将所选字体的颜色设置为红色
+
+ 255
+ 0
+
+
+ 字体颜色[zitiyanse] : 蓝色[lanse]
+ Selection.Font.Color
+ 将所选字体的颜色设置为蓝色
+
+ 16711680
+ 0
+
+
+ 字体颜色[zitiyanse] : 白色[baise]
+ Selection.Font.Color
+ 将所选字体的颜色设置为白色
+
+ 16777215
+ 0
+
+
+ 字体颜色[zitiyanse] : 黄色[huangse]
+ Selection.Font.Color
+ 将所选字体的颜色设置为黄色
+
+ 65535
+ 0
+
+
+ 字体颜色[zitiyanse] : 绿色[lvse]
+ Selection.Font.Color
+ 将所选字体的颜色设置为绿色
+
+ 32768
+ 0
+
+
+ 字体颜色[zitiyanse] : 黑色[heise]
+ Selection.Font.Color
+ 将所选字体的颜色设置为黑色
+
+ 0
+ 0
+
+
+ 字体颜色[zitiyanse] : 选择颜色[xuanzeyanse]
+ @Win32Color("Selection.Font.Color")!Selection.Font.Color
+ 从颜色对话框中选择字体颜色
+
+
+ 0
+
+
+ 字体[ziti] : 宋体[songti]
+ Selection.Font.Name
+ 将所选文字的字体设置为宋体
+
+ 宋体
+ 0
+
+
+ 字体[ziti] : 仿宋[fangsong]
+ Selection.Font.Name
+ 将所选文字的字体设置为仿宋
+
+ 仿宋
+ 0
+
+
+ 字体[ziti] : 隶书[lishu]
+ Selection.Font.Name
+ 将所选文字的字体设置为隶书
+
+ 隶书
+ 0
+
+
+ 字体[ziti] : 微软雅黑[weiruanyahei]
+ Selection.Font.Name
+ 将所选文字的字体设置为微软雅黑
+
+ 微软雅黑
+ 0
+
+
+ 字体[ziti] : 黑体[heiti]
+ Selection.Font.Name
+ 将所选文字的字体设置为黑体
+
+ 黑体
+ 0
+
+
+ 字体[ziti] : Times New Roman
+ Selection.Font.Name
+ 将所选文字的字体设置为Times New Roman
+
+ "Times New Roman"
+ 0
+
+
+ 字体[ziti] : Consolas
+ Selection.Font.Name
+ 将所选文字的字体设置为Consolas
+
+ Consolas
+ 0
+
+
+ 字体[ziti] : Arial
+ Selection.Font.Name
+ 将所选文字的字体设置为Arial
+
+ Arial
+ 0
+
+
+ 字体[ziti] : 字体名
+ Selection.Font.Name
+ 将所选文字的字体设置为指定名称的字体
+ .
+
+ 0
+
+
+ 批注[pizhu] : 插入[charupizhu] 批注内容
+ Selection.Comments.Add(Selection.Range, "{$1}")
+ 为所选内容插入一个批注
+ .
+ 修改批注
+ 0
+
+
+ 批注[pizhu] : 删除[shanchupizhu]
+ Selection.Comments[1].Delete()
+ 删除当前批注
+
+
+ 0
+
+
+ 批注[pizhu] : 修改[xiugaipizhu] 批注内容
+ Selection.Comments[1].Range.Text
+ 修改当前批注
+ .
+
+ 0
+
+
+ 书签[shuqian] : 插入[charushuqian] 书签名
+ Selection.Bookmarks.Add("{$1}", Selection.Range)
+ 在当前位置插入一个书签
+ .
+
+ 0
+
+
+ 修订[xiuding] : 开[kai]
+ ActiveDocument.TrackRevisions
+ 打开修订模式
+
+ True
+ 0
+
+
+ 修订[xiuding] : 关[guan]
+ ActiveDocument.TrackRevisions
+ 关闭修订模式
+
+ False
+ 0
+
+
+ 修订[xiuding] : 接受此处[jieshoucichu]
+ Selection.Range.Revisions.AcceptAll()
+ 接受光标选择区域的所有修订
+
+
+ 0
+
+
+ 修订[xiuding] : 拒绝此处[jujuecichu]
+ Selection.Range.Revisions.RejectAll()
+ 接受光标选择区域的所有修订
+
+
+ 0
+
+
+ 修订[xiuding] : 接受全部[jieshouquanbu]
+ ActiveDocument.AcceptAllRevisions()
+ 接受文档中的全部修订
+
+
+ 0
+
+
+ 修订[xiuding] : 拒绝全部[jujuequanbu]
+ ActiveDocument.RejectAllRevisions()
+ 拒绝文档中的全部修订
+
+
+ 0
+
+
+ 书签[shuqian] : 删除[shanchushuqian]
+ Selection.Bookmarks[1].Delete()
+ 修改当前书签
+
+
+ 0
+
+
+ 跳转[gotopage tiaozhuan] : 页码[yema]
+ Selection.GoTo(1, 1, {$1}, "")
+ 光标跳转到指定页码
+ \d
+
+ 0
+
+
+ 跳转[gotosection tiaozhuan] : 节[jie]
+ Selection.GoTo(0, 1, {$1}, "")
+ 光标跳转到指定节
+ \d
+
+ 0
+
+
+ 跳转[gotoline tiaozhuan] : 行[hang]
+ Selection.GoTo(3, 1, {$1}, "")
+ 光标跳转到指定行
+ \d
+
+ 0
+
+
+ 跳转[gotobookmark tiaozhuan] : 书签[shuqian] 书签名
+ Selection.GoTo(-1, 1, 0, "{$1}")
+ 光标跳转到指定书签
+ .
+
+ 0
+
+
+ 样式[yangshi] : 正文[zhengwen]
+ Selection.Range.Style
+ 将所选内容的样式设置为正文
+
+ 正文
+ 0
+
+
+ 样式[yangshi] : 标题 1[biaoti 1]
+ Selection.Range.Style
+ 将所选内容的样式设置为标题 1
+
+ "标题 1"
+ 0
+
+
+ 样式[yangshi] : 标题 2[biaoti 2]
+ Selection.Range.Style
+ 将所选内容的样式设置为标题 2
+
+ "标题 2"
+ 0
+
+
+ 样式[yangshi] : 标题 3[biaoti 3]
+ Selection.Range.Style
+ 将所选内容的样式设置为标题 3
+
+ "标题 3"
+ 0
+
+
+ 样式[yangshi] : 样式名
+ Selection.Range.Style
+ 将所选内容的样式设置为输入的样式名
+ .
+
+ 0
+
+
+ 视图[shitu] : 页面视图[yemianshitu]
+ ActiveWindow.View.Type
+ 将页面视图切换为页面视图
+
+ 3
+ 0
+
+
+ 视图[shitu] : 大纲视图[dagangshitu]
+ ActiveWindow.View.Type
+ 将页面视图切换为大纲视图
+
+ 2
+ 0
+
+
+ 视图[shitu] : Web视图[shitu]
+ ActiveWindow.View.Type
+ 将页面视图切换为Web视图
+
+ 6
+ 0
+
+
+ 拆分窗口[chaifenchuangkou] 切换[qiehuan]
+ !ActiveWindow.Split
+ 打开或取消拆分窗口
+
+
+ 0
+
+
+ 打印[dayin] : 全部[quanbu]
+ ActiveDocument.PrintOut(false, true, 0)
+ 打印文档的全部内容
+
+
+ 0
+
+
+ 打印[dayin] : 当前页[dangqianye]
+ ActiveDocument.PrintOut(false, true, 2)
+ 打印文档的当前页
+
+
+ 0
+
+
+ 打印[dayin] : 页码范围[yemafanwei] {x,y}
+ ActiveDocument.PrintOut(false, true, 3, "", {$1}, {$2})
+ 打印文档的第a页到第b页
+ \d
+
+ 0
+
+
+ 纸张方向[zhizhangfangxiang] : 横向[hengxiang]
+ ActiveDocument.PageSetup.Orientation
+ 更改页面设置中的纸张方向为横向
+
+ 1
+ 0
+
+
+ 纸张方向[zhizhangfangxiang] : 纵向[zongxiang]
+ ActiveDocument.PageSetup.Orientation
+ 更改页面设置中的纸张方向为纵向
+
+ 0
+ 0
+
+
+ 纸张大小[zhizhangdaxiao] : A3
+ ActiveDocument.PageSetup.PaperSize
+ 将纸张大小更改为A3
+
+ 6
+ 0
+
+
+ 纸张大小[zhizhangdaxiao] : A4
+ ActiveDocument.PageSetup.PaperSize
+ 将纸张大小更改为A4
+
+ 7
+ 0
+
+
+ 纸张大小[zhizhangdaxiao] : B4
+ ActiveDocument.PageSetup.PaperSize
+ 将纸张大小更改为B4
+
+ 10
+ 0
+
+
+ 纸张大小[zhizhangdaxiao] : B5
+ ActiveDocument.PageSetup.PaperSize
+ 将纸张大小更改为B5
+
+ 11
+ 0
+
+
+ 纸张大小[zhizhangdaxiao] : 信纸[xinzhi]
+ ActiveDocument.PageSetup.PaperSize
+ 将纸张大小更改为Letter
+
+ 2
+ 0
+
+
+ 纸张大小[zhizhangdaxiao] : 法律专用纸[falvzhuanyongzhi]
+ ActiveDocument.PageSetup.PaperSize
+ 将纸张大小更改为Legal
+
+ 4
+ 0
+
+
+ 兼容模式[jianrongmoshi]
+ ActiveDocument.SetCompatibilityMode(11)
+ 将文档模式改为wdWord2003
+
+
+ 0
+
+
+ 非兼容模式[feijianrongmoshi]
+ ActiveDocument.SetCompatibilityMode(14)
+ 将文档模式改为wdWord2010
+
+
+ 0
+
+
+ 窗口最大化[chuangkouzuidahua maximum]
+ Application.WindowState
+ 使程序窗口最大化
+
+ 1
+ 0
+
+
+ 窗口还原[chuangkouhuanyuan normal]
+ Application.WindowState
+ 使程序窗口大小还原
+
+ 0
+ 0
+
+
+ CP
+ @RunFile("Utilities/wpscp.vbs","{$1}")
+ CP
+ \d
+
+ 0
+
+
+
\ No newline at end of file
diff --git a/Bin/Debug4KSO/plugins/3rdparty/everything/everything.exe b/Bin/Debug4KSO/plugins/3rdparty/everything/everything.exe
new file mode 100644
index 0000000..db310db
Binary files /dev/null and b/Bin/Debug4KSO/plugins/3rdparty/everything/everything.exe differ
diff --git a/Bin/Debug4KSO/plugins/3rdparty/everything/everything32.dll b/Bin/Debug4KSO/plugins/3rdparty/everything/everything32.dll
new file mode 100644
index 0000000..fab7296
Binary files /dev/null and b/Bin/Debug4KSO/plugins/3rdparty/everything/everything32.dll differ
diff --git a/Bin/Debug4KSO/plugins/3rdparty/everything/everything64.dll b/Bin/Debug4KSO/plugins/3rdparty/everything/everything64.dll
new file mode 100644
index 0000000..8f1b615
Binary files /dev/null and b/Bin/Debug4KSO/plugins/3rdparty/everything/everything64.dll differ
diff --git a/Bin/Intro.pptx b/Bin/Intro.pptx
new file mode 100644
index 0000000..ee8aef2
Binary files /dev/null and b/Bin/Intro.pptx differ
diff --git a/Bin/Release/QuickDotfuscator.xml b/Bin/Release/QuickDotfuscator.xml
new file mode 100644
index 0000000..9c83374
--- /dev/null
+++ b/Bin/Release/QuickDotfuscator.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Bin/Release4KSO/QuickDotfuscator.xml b/Bin/Release4KSO/QuickDotfuscator.xml
new file mode 100644
index 0000000..1f2f145
--- /dev/null
+++ b/Bin/Release4KSO/QuickDotfuscator.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Bin/Scripts/r4kso.bat b/Bin/Scripts/r4kso.bat
new file mode 100644
index 0000000..a459107
--- /dev/null
+++ b/Bin/Scripts/r4kso.bat
@@ -0,0 +1,21 @@
+@echo off
+echo ʼĿ...
+SET PATH=%PATH%;C:\Program Files\WinRAR
+cd /d %~dp0
+rd /s /q Release4KSO
+md Release4KSO
+xcopy /i /y ..\Debug4KSO\config .\Release4KSO\config
+copy /y ..\Release4KSO\Quick.exe .\Release4KSO\Quick.exe
+copy /y ..\Release4KSO\QuickUpdate.exe .\Release4KSO\QuickUpdate.exe
+copy /y ..\Release4KSO\QuickUI.dll .\Release4KSO\QuickUI.dll
+md Release4KSO\plugins\3rdparty\everything
+copy /y ..\Release4KSO\plugins\quickplugin.dll .\Release4KSO\plugins\quickplugin.dll
+copy /y ..\Release4KSO\plugins\3rdparty\everything\everything.exe .\Release4KSO\plugins\3rdparty\everything\everything.exe
+copy /y ..\Release4KSO\plugins\3rdparty\everything\everything32.dll .\Release4KSO\plugins\3rdparty\everything\everything32.dll
+copy /y ..\Release4KSO\plugins\3rdparty\everything\everything64.dll .\Release4KSO\plugins\3rdparty\everything\everything64.dll
+
+cd Release4KSO
+rar a -r Quick.rar
+
+echo
+pause
\ No newline at end of file
diff --git a/Bin/Scripts/release.bat b/Bin/Scripts/release.bat
new file mode 100644
index 0000000..2ed7224
--- /dev/null
+++ b/Bin/Scripts/release.bat
@@ -0,0 +1,21 @@
+@echo off
+echo ʼĿ...
+SET PATH=%PATH%;C:\Program Files\WinRAR
+cd /d %~dp0
+rd /s /q Release
+md Release
+xcopy /i /y ..\Debug4KSO\config .\Release\config
+copy /y ..\Release\Quick.exe .\Release\Quick.exe
+copy /y ..\Release\QuickUpdate.exe .\Release\QuickUpdate.exe
+copy /y ..\Release\QuickUI.dll .\Release\QuickUI.dll
+md Release\plugins\3rdparty\everything
+copy /y ..\Release\plugins\quickplugin.dll .\Release\plugins\quickplugin.dll
+copy /y ..\Release\plugins\3rdparty\everything\everything.exe .\Release\plugins\3rdparty\everything\everything.exe
+copy /y ..\Release\plugins\3rdparty\everything\everything32.dll .\Release\plugins\3rdparty\everything\everything32.dll
+copy /y ..\Release\plugins\3rdparty\everything\everything64.dll .\Release\plugins\3rdparty\everything\everything64.dll
+
+cd Release
+rar a -r Quick.rar
+
+echo
+pause
\ No newline at end of file
diff --git a/Coding/Quick.sln b/Coding/Quick.sln
new file mode 100644
index 0000000..25b23ca
--- /dev/null
+++ b/Coding/Quick.sln
@@ -0,0 +1,133 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.24720.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Quick", "Quick\Quick.csproj", "{D26B7BEA-D131-4801-A19B-E0AFC6740322}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickUpdate", "QuickUpdate\QuickUpdate.csproj", "{E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickPlugin", "QuickPlugin\QuickPlugin.csproj", "{EA358646-8755-4A40-AABC-200C03CF86CC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickUI", "QuickUI\QuickUI.csproj", "{F36B622E-4F74-4D69-912C-FB9DE8915362}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ D4KSO|Any CPU = D4KSO|Any CPU
+ D4KSO|Mixed Platforms = D4KSO|Mixed Platforms
+ D4KSO|Win32 = D4KSO|Win32
+ Debug|Any CPU = Debug|Any CPU
+ Debug|Mixed Platforms = Debug|Mixed Platforms
+ Debug|Win32 = Debug|Win32
+ R4KSO|Any CPU = R4KSO|Any CPU
+ R4KSO|Mixed Platforms = R4KSO|Mixed Platforms
+ R4KSO|Win32 = R4KSO|Win32
+ Release|Any CPU = Release|Any CPU
+ Release|Mixed Platforms = Release|Mixed Platforms
+ Release|Win32 = Release|Win32
+ Template|Any CPU = Template|Any CPU
+ Template|Mixed Platforms = Template|Mixed Platforms
+ Template|Win32 = Template|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.D4KSO|Any CPU.ActiveCfg = D4KSO|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.D4KSO|Any CPU.Build.0 = D4KSO|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.D4KSO|Mixed Platforms.ActiveCfg = D4KSO|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.D4KSO|Mixed Platforms.Build.0 = D4KSO|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.D4KSO|Win32.ActiveCfg = D4KSO|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.Debug|Win32.ActiveCfg = Debug|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.R4KSO|Any CPU.ActiveCfg = R4KSO|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.R4KSO|Any CPU.Build.0 = R4KSO|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.R4KSO|Any CPU.Deploy.0 = R4KSO|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.R4KSO|Mixed Platforms.ActiveCfg = R4KSO|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.R4KSO|Mixed Platforms.Build.0 = R4KSO|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.R4KSO|Win32.ActiveCfg = R4KSO|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.Release|Win32.ActiveCfg = Release|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.Template|Any CPU.ActiveCfg = Release|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.Template|Any CPU.Build.0 = Release|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.Template|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.Template|Mixed Platforms.Build.0 = Release|Any CPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}.Template|Win32.ActiveCfg = Release|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.D4KSO|Any CPU.ActiveCfg = D4KSO|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.D4KSO|Any CPU.Build.0 = D4KSO|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.D4KSO|Any CPU.Deploy.0 = D4KSO|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.D4KSO|Mixed Platforms.ActiveCfg = D4KSO|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.D4KSO|Win32.ActiveCfg = D4KSO|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.Debug|Win32.ActiveCfg = Debug|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.R4KSO|Any CPU.ActiveCfg = R4KSO|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.R4KSO|Any CPU.Build.0 = R4KSO|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.R4KSO|Mixed Platforms.ActiveCfg = R4KSO|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.R4KSO|Win32.ActiveCfg = R4KSO|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.Release|Win32.ActiveCfg = Release|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.Template|Any CPU.ActiveCfg = Release|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.Template|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {E197A7E7-B3E0-4ECF-AC0A-459BC80D2A28}.Template|Win32.ActiveCfg = Release|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.D4KSO|Any CPU.ActiveCfg = D4KSO|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.D4KSO|Any CPU.Build.0 = D4KSO|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.D4KSO|Mixed Platforms.ActiveCfg = D4KSO|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.D4KSO|Mixed Platforms.Build.0 = D4KSO|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.D4KSO|Win32.ActiveCfg = D4KSO|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.Debug|Win32.ActiveCfg = Debug|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.R4KSO|Any CPU.ActiveCfg = R4KSO|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.R4KSO|Any CPU.Build.0 = R4KSO|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.R4KSO|Mixed Platforms.ActiveCfg = R4KSO|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.R4KSO|Mixed Platforms.Build.0 = R4KSO|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.R4KSO|Win32.ActiveCfg = R4KSO|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.Release|Win32.ActiveCfg = Release|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.Template|Any CPU.ActiveCfg = Release|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.Template|Any CPU.Build.0 = Release|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.Template|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.Template|Mixed Platforms.Build.0 = Release|Any CPU
+ {EA358646-8755-4A40-AABC-200C03CF86CC}.Template|Win32.ActiveCfg = Release|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.D4KSO|Any CPU.ActiveCfg = D4KSO|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.D4KSO|Any CPU.Build.0 = D4KSO|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.D4KSO|Mixed Platforms.ActiveCfg = D4KSO|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.D4KSO|Mixed Platforms.Build.0 = D4KSO|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.D4KSO|Win32.ActiveCfg = D4KSO|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.Debug|Win32.ActiveCfg = Debug|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.R4KSO|Any CPU.ActiveCfg = R4KSO|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.R4KSO|Any CPU.Build.0 = R4KSO|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.R4KSO|Mixed Platforms.ActiveCfg = R4KSO|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.R4KSO|Mixed Platforms.Build.0 = R4KSO|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.R4KSO|Win32.ActiveCfg = R4KSO|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.Release|Win32.ActiveCfg = Release|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.Template|Any CPU.ActiveCfg = Release|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.Template|Any CPU.Build.0 = Release|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.Template|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.Template|Mixed Platforms.Build.0 = Release|Any CPU
+ {F36B622E-4F74-4D69-912C-FB9DE8915362}.Template|Win32.ActiveCfg = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Coding/Quick/Config.cs b/Coding/Quick/Config.cs
new file mode 100644
index 0000000..2f63b74
--- /dev/null
+++ b/Coding/Quick/Config.cs
@@ -0,0 +1,105 @@
+using System;
+using System.IO;
+using System.Windows.Forms;
+using System.Xml.Serialization;
+
+namespace Froser.Quick
+{
+ public class QuickConfig
+ {
+ public Boolean FirstRun { get; set; }
+ public Keys HotKey { get; set; }
+ public Int32 HotKeyFlags { get; set; }
+ public Boolean SearchToogle { get; set; }
+
+ private static String ConfigDir
+ {
+ get
+ {
+ String strConfigDirector = Application.StartupPath;
+ if (!Directory.Exists(strConfigDirector))
+ {
+ Directory.CreateDirectory(strConfigDirector);
+ }
+ return strConfigDirector;
+ }
+ }
+
+ private static String ConfigPath
+ {
+ get
+ {
+ return Path.Combine(ConfigDir, "quick.config");
+ }
+ }
+
+ private static QuickConfig _config;
+ public static QuickConfig ThisConfig
+ {
+ get
+ {
+ if (_config == null)
+ {
+ _config = Load();
+ }
+ return _config;
+ }
+ }
+
+ private QuickConfig()
+ {
+ FirstRun = true;
+ HotKey = Keys.Q;
+ HotKeyFlags = (int)Hotkey.KeyFlags.MOD_CONTROL;
+ SearchToogle = true;
+ }
+
+ public bool TrySave()
+ {
+ return TrySave(this);
+ }
+
+ ///
+ /// 读取一个配置文件,并返回一个PluginConfig对象。若XML配置文件不存在,则会用初始化本类的方式(使用默认初始化值)来创建一个配置文件。
+ ///
+ private static QuickConfig Load()
+ {
+ QuickConfig instance;
+ if (!File.Exists(ConfigPath))
+ {
+ //配置文件不存在,则创建一个新的实例
+ instance = new QuickConfig();
+ TrySave(instance);
+ }
+ else
+ {
+ //如果文件存在,则反序列化它
+ XmlSerializer xmlsLoad = new XmlSerializer(typeof(QuickConfig));
+ using (FileStream fs = new FileStream(ConfigPath, FileMode.Open, FileAccess.Read))
+ {
+ instance = (QuickConfig)xmlsLoad.Deserialize(fs);
+ }
+ }
+ return instance;
+ }
+
+ private static bool TrySave(QuickConfig instance)
+ {
+ try
+ {
+ //注意:以下操作线程不安全
+ //将密码暂时加密
+ XmlSerializer xmlsSave = new XmlSerializer(typeof(QuickConfig));
+ using (FileStream fs = new FileStream(ConfigPath, FileMode.Create, FileAccess.Write))
+ {
+ xmlsSave.Serialize(fs, instance);
+ }
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+ }
+}
diff --git a/Coding/Quick/Extension.cs b/Coding/Quick/Extension.cs
new file mode 100644
index 0000000..3776f6f
--- /dev/null
+++ b/Coding/Quick/Extension.cs
@@ -0,0 +1,128 @@
+using System.Windows.Forms;
+using System;
+using System.Text.RegularExpressions;
+using System.Collections;
+using System.Collections.Generic;
+using System.Windows.Media.Imaging;
+using System.Drawing;
+using System.Windows.Interop;
+using System.Windows;
+using System.Windows.Input;
+
+namespace Froser.Quick
+{
+ public static class Extension
+ {
+ //判断某字符串是否按顺序含有子字符串,如abcd含有ac但是不含有ca
+ public static bool HasString(this String str, String substr)
+ {
+ //包含在{}中的字符表示,不作为查找依据。例如,{x, y}中,忽略x, y这几个字符,当然{}本身也不包含在内
+ Regex brace = new Regex(@"\{(.*?)\}");
+ //先统一大小写
+ str = str.ToLower();
+ substr = substr.ToLower();
+
+ bool result = false;
+ String rec_str = brace.Replace(str, "");
+ for (int i = 0; i < substr.Length; i++)
+ {
+ int index = rec_str.IndexOf(substr[i]);
+ if (index < 0)
+ {
+ return false;
+ }
+ else
+ {
+ if (rec_str.Length == 1) return ( i == substr.Length - 1);
+ rec_str = rec_str.Substring(index + 1);
+ result = true;
+ }
+ }
+
+ return result;
+ }
+
+ public static int Plus(this object lhs, object addend)
+ {
+ if (lhs is int)
+ {
+ if (addend is int)
+ {
+ return (int)lhs + (int)addend;
+ }
+ else if (addend is float || addend is double)
+ {
+ return (int)((int)lhs + double.Parse(addend.ToString()));
+ }
+ else
+ {
+ throw new NotSupportedException();
+ }
+ }
+ else if (lhs is float || lhs is double)
+ {
+ if (addend is int)
+ {
+ return (int)(double.Parse (lhs.ToString ()) + (int)addend);
+ }
+ else if (addend is float || addend is double)
+ {
+ return (int)(double.Parse(lhs.ToString()) + double.Parse(addend.ToString()));
+ }
+ else
+ {
+ throw new NotSupportedException();
+ }
+ }
+ else
+ {
+ throw new NotSupportedException();
+ }
+ }
+
+ public static void ShowBalloonTip(this NotifyIcon notify, String text)
+ {
+ notify.ShowBalloonTip(500, System.Windows.Forms.Application.ProductName, text, ToolTipIcon.Info);
+ }
+
+ public static void Swap(this IList list, object a, object b)
+ {
+ int indexOfB = list.IndexOf (b);
+ list.Insert(list.IndexOf (a), b);
+ list.Remove(a);
+ list.Remove(b);
+ list.Insert(indexOfB, a);
+ }
+
+ public static string KeyToString(this Key key)
+ {
+ switch (key.ToString().ToLower())
+ {
+ case "oem3":
+ return "`";
+ default:
+ return key.ToString();
+ }
+ }
+
+ public static bool ContainsKey(this Dictionary dic, String key, bool ignoreCase, out string keyInModel)
+ {
+ keyInModel = "";
+ foreach (var item in dic.Keys)
+ {
+ if (String.Compare(item, key, ignoreCase) == 0) {
+ keyInModel = item;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static BitmapSource ToBitmapSource(this Icon icon)
+ {
+ var bitmap = icon.ToBitmap();
+ var hbitmap = bitmap.GetHbitmap();
+ return Imaging.CreateBitmapSourceFromHBitmap(hbitmap, IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
+ }
+ }
+}
diff --git a/Coding/Quick/Global.Designer.cs b/Coding/Quick/Global.Designer.cs
new file mode 100644
index 0000000..e86ec3d
--- /dev/null
+++ b/Coding/Quick/Global.Designer.cs
@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+namespace Froser.Quick {
+ using System;
+
+
+ ///
+ /// 一个强类型的资源类,用于查找本地化的字符串等。
+ ///
+ // 此类是由 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 Global {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Global() {
+ }
+
+ ///
+ /// 返回此类使用的缓存的 ResourceManager 实例。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Froser.Quick.Global", typeof(Global).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/Coding/Quick/Global.resx b/Coding/Quick/Global.resx
new file mode 100644
index 0000000..2f96abe
--- /dev/null
+++ b/Coding/Quick/Global.resx
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
\ No newline at end of file
diff --git a/Coding/Quick/Hotkey.cs b/Coding/Quick/Hotkey.cs
new file mode 100644
index 0000000..7a0f4d6
--- /dev/null
+++ b/Coding/Quick/Hotkey.cs
@@ -0,0 +1,87 @@
+using System;
+using System.Runtime.InteropServices;
+using System.Windows.Input;
+
+namespace Froser.Quick
+{
+ internal delegate void HotkeyEventHandler(int HotKeyID);
+
+ internal class Hotkey : global::System.Windows.Forms.IMessageFilter
+ {
+ global::System.Collections.Hashtable keyIDs = new global::System.Collections.Hashtable();
+ IntPtr hWnd;
+
+
+
+ public event HotkeyEventHandler OnHotkey;
+
+ public enum KeyFlags
+ {
+ MOD_NONE = 0x0,
+ MOD_ALT = 0x1,
+ MOD_CONTROL = 0x2,
+ MOD_SHIFT = 0x4,
+ MOD_WIN = 0x8,
+ MOD_NOREPEAT = 0x4000
+ }
+ [DllImport("user32.dll")]
+ private static extern UInt32 RegisterHotKey(IntPtr hWnd, UInt32 id, UInt32 fsModifiers, UInt32 vk);
+
+ [DllImport("user32.dll")]
+ private static extern UInt32 UnregisterHotKey(IntPtr hWnd, UInt32 id);
+
+ [DllImport("kernel32.dll")]
+ private static extern UInt32 GlobalAddAtom(String lpString);
+
+ [DllImport("kernel32.dll")]
+ private static extern UInt32 GlobalDeleteAtom(UInt32 nAtom);
+
+ public Hotkey(IntPtr hWnd)
+ {
+ this.hWnd = hWnd;
+ global::System.Windows.Forms.Application.AddMessageFilter(this);
+ }
+
+ public int RegisterHotkey(Key Key, KeyFlags keyflags)
+ {
+ try
+ {
+ UInt32 hotkeyid = GlobalAddAtom(global::System.Guid.NewGuid().ToString());
+ int keycode = KeyInterop.VirtualKeyFromKey(Key);
+ RegisterHotKey((IntPtr)hWnd, hotkeyid, (UInt32)keyflags, (UInt32)keycode);
+ keyIDs.Add(hotkeyid, hotkeyid);
+ return (int)hotkeyid;
+ }
+ catch { return 0; };
+ }
+
+ public void UnregisterHotkeys()
+ {
+ global::System.Windows.Forms.Application.RemoveMessageFilter(this);
+ foreach (UInt32 key in keyIDs.Values)
+ {
+ UnregisterHotKey(hWnd, key);
+ GlobalDeleteAtom(key);
+ }
+ }
+
+ public bool PreFilterMessage(ref global::System.Windows.Forms.Message m)
+ {
+ if (m.Msg == 0x312)
+ {
+ if (OnHotkey != null)
+ {
+ foreach (UInt32 key in keyIDs.Values)
+ {
+ if ((UInt32)m.WParam == key)
+ {
+ OnHotkey((int)m.WParam);
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Coding/Quick/IQuickPlugin.cs b/Coding/Quick/IQuickPlugin.cs
new file mode 100644
index 0000000..1e485ae
--- /dev/null
+++ b/Coding/Quick/IQuickPlugin.cs
@@ -0,0 +1,31 @@
+using System.Windows.Controls;
+using System.Windows.Input;
+using System.Windows.Media;
+
+namespace Froser.Quick
+{
+ public interface IQuickPlugin
+ {
+ IQuickPluginMethod[] GetMethods();
+ }
+
+ public interface IQuickPluginMethod
+ {
+ string GetName();
+ string GetDescription(IQuickWindow quickWindow);
+ string AvailableApplicationName();
+ void Invoke(object sender, IQuickWindow quickWindow);
+ bool AcceptArgs();
+ bool GetIcon(IQuickWindow quickWindow, out ImageSource icon);
+
+ // 事件回调
+ // 插件在激活状态下按下一个键时
+ void KeyDown(IQuickWindow quickWindow, KeyEventArgs e);
+ // 插件在激活状态下搜索文本有变化时
+ void TextChanged(IQuickWindow quickWindow, TextChangedEventArgs e);
+ // 主窗体关闭时
+ void Closed(IQuickWindow quickWindow);
+ void PageDown(IQuickWindow quickWindow);
+ void PageUp(IQuickWindow quickWindow);
+ }
+}
diff --git a/Coding/Quick/IQuickWindow.cs b/Coding/Quick/IQuickWindow.cs
new file mode 100644
index 0000000..cda3084
--- /dev/null
+++ b/Coding/Quick/IQuickWindow.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows.Controls;
+
+namespace Froser.Quick
+{
+ public interface IQuickWindow
+ {
+ string GetPluginsPath();
+ void SetQueryText(string text);
+ string GetQueryText();
+ string GetArgument();
+ RichTextBox GetQueryTextBox();
+ void ReplaceMethods(IQuickPluginMethod[] methods);
+ void ResetMethods();
+ void Refresh(int selectIndex);
+ int GetCurrentPage();
+ void LockWindow();
+ void UnlockWindow();
+ void AsyncInvoke(Action action);
+ }
+}
diff --git a/Coding/Quick/Program.cs b/Coding/Quick/Program.cs
new file mode 100644
index 0000000..a6cef1e
--- /dev/null
+++ b/Coding/Quick/Program.cs
@@ -0,0 +1,82 @@
+using System;
+using System.Threading;
+using System.Drawing;
+using System.Collections.Generic;
+using System.IO;
+using System.Xml.Linq;
+using System.Security.Principal;
+using System.Windows.Forms;
+
+namespace Froser.Quick
+{
+ static class Program
+ {
+ public static NotifyIcon notify = new NotifyIcon();
+ ///
+ /// 应用程序的主入口点。
+ ///
+ [STAThread]
+ static void Main()
+ {
+ if (QuickUpdate.LocalUpdate())
+ {
+ Environment.Exit(0);
+ return;
+ }
+
+ if (Init())
+ {
+ Application.Run();
+ }
+ }
+
+ public static void Quit()
+ {
+ notify.Visible = false;
+ Application.ExitThread();
+ }
+
+ static bool Init()
+ {
+ const string adminComment = "Quick当前是以管理员身份运行。此时,您的宿主程序也必须是以管理员身份运行,这样Quick快捷菜单才能正常出现。";
+
+ var mutexStr = "__QUICK____QUICK____QUICK____QUICK____QUICK__";
+ bool canCreateMutex;
+ Mutex programMutex = new Mutex(false, mutexStr, out canCreateMutex);
+ if (canCreateMutex)
+ {
+ notify = QuickNotify.GetNotify();
+ notify.Visible = true;
+
+ if (QuickConfig.ThisConfig.FirstRun)
+ {
+ QuickConfig.ThisConfig.FirstRun = false;
+ QuickConfig.ThisConfig.TrySave();
+
+ string additional = IsAdministrator() ? adminComment : string.Empty;
+
+ notify.ShowBalloonTip("Quick已经运行,您可以点击右键查看其选项。" + " " + adminComment);
+ }
+ else if (IsAdministrator())
+ notify.ShowBalloonTip(adminComment);
+
+ Action silenceUpdate = () =>
+ {
+ QuickUpdate.SilenceUpdate();
+ };
+ silenceUpdate.BeginInvoke(null, null);
+
+ QuickListener.Listener.Run();
+ return true;
+ }
+ return false;
+ }
+
+ public static bool IsAdministrator()
+ {
+ WindowsIdentity identity = WindowsIdentity.GetCurrent();
+ WindowsPrincipal principal = new WindowsPrincipal(identity);
+ return principal.IsInRole(WindowsBuiltInRole.Administrator);
+ }
+ }
+}
diff --git a/Coding/Quick/Properties/AssemblyInfo.cs b/Coding/Quick/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..ebfdc9f
--- /dev/null
+++ b/Coding/Quick/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的常规信息通过以下
+// 特性集控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("Quick")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Froser")]
+[assembly: AssemblyProduct("Quick")]
+[assembly: AssemblyCopyright("Froser")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 使此程序集中的类型
+// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
+// 则将该类型上的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("f3a5a152-cbb0-4ccf-9edc-3ad4ca42371c")]
+
+// 程序集的版本信息由下面四个值组成:
+//
+// 主版本
+// 次版本
+// 生成号
+// 修订号
+//
+// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.1.0.0")]
diff --git a/Coding/Quick/Properties/Resources.Designer.cs b/Coding/Quick/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..a9bc656
--- /dev/null
+++ b/Coding/Quick/Properties/Resources.Designer.cs
@@ -0,0 +1,73 @@
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+namespace Froser.Quick.Properties {
+ using System;
+
+
+ ///
+ /// 一个强类型的资源类,用于查找本地化的字符串等。
+ ///
+ // 此类是由 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 (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Froser.Quick.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;
+ }
+ }
+
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap quick {
+ get {
+ object obj = ResourceManager.GetObject("quick", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+ }
+}
diff --git a/Coding/Quick/Properties/Resources.resx b/Coding/Quick/Properties/Resources.resx
new file mode 100644
index 0000000..199bb5a
--- /dev/null
+++ b/Coding/Quick/Properties/Resources.resx
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
+ JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAACIUlEQVRYR7XXP0gWcRzH8SeNtCBJMojA
+ ooQgBCcDt1qaitw0NzcxaAtBabIlQfAPuAgKDdLkotDmpBKiIrQ0JeigSUFB0KOo5ftzfC8e5Mvd/c7z
+ A6/t9/18fR7vvLOUlvJqW+wt/uV0hG5EXUGxoYuYhVeexRbuw1oDoiFcxwa88ixGUA1rDYiG0Ixv8MrT
+ /MBDWGNgNIguHMBbkEa/uiuwxoBoCBcwCa88zR88RdQVHBu8ikV4C9Ks4AasMTAaxD3oKvYWJNGt14N8
+ n16x4efQV+ktSbKJJlhbYDRoJuAtSDOEKlhjYDSIOizDW5DkbLeeomE8wA68JUn+33qxoFQM9kIXk7ck
+ ySdMYRqvcA3WniE6jBrMwVsQ4hCvEfVmih2+g6/wSkONI/sFqYPIe/ud9gtPkO0biA9iFF5hiGO8wyXY
+ hpToIPR1fYBXGmIJt2DtGaLDZhB57oDYHh4j6guKDekl5AX6MWDe4DO8hZV05fch30uIFxXhMhbgLa30
+ EfoANl1AVIab+AJvaWwbrYhmCosVtuA7vMWyDz2C9RJjkwVFhehE0qvZDPQAs6mCokIzBm+x6Fejh1d0
+ ttBYqf6YzMNb/hsdKH65YsX1WMfp5X+h9/5a2ETBUTHuwns31KO3EXb6HKJy6Nb6icrlu3iE6My5xRY8
+ g26zeHkZL5H/vS9rtADtiH8APSOGke8/ntBoCW5jDVr+Hg2wE3lTKp0AUQK3//kdzGoAAAAASUVORK5C
+ YII=
+
+
+
\ No newline at end of file
diff --git a/Coding/Quick/Properties/Settings.Designer.cs b/Coding/Quick/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..d5f8b80
--- /dev/null
+++ b/Coding/Quick/Properties/Settings.Designer.cs
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.18444
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+namespace Froser.Quick.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/Coding/Quick/Properties/Settings.settings b/Coding/Quick/Properties/Settings.settings
new file mode 100644
index 0000000..3964565
--- /dev/null
+++ b/Coding/Quick/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/Coding/Quick/Properties/app.manifest b/Coding/Quick/Properties/app.manifest
new file mode 100644
index 0000000..8a1f331
--- /dev/null
+++ b/Coding/Quick/Properties/app.manifest
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Coding/Quick/Quick.csproj b/Coding/Quick/Quick.csproj
new file mode 100644
index 0000000..7843ce0
--- /dev/null
+++ b/Coding/Quick/Quick.csproj
@@ -0,0 +1,251 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {D26B7BEA-D131-4801-A19B-E0AFC6740322}
+ WinExe
+ Properties
+ Froser.Quick
+ Quick
+ v4.0
+ 512
+
+
+ false
+ 发布\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 1
+ 1.0.0.%2a
+ false
+ true
+ true
+
+
+ ..\..\obj\Debug\
+ AnyCPU
+ true
+ full
+ false
+ ..\..\Bin\Debug\
+ TRACE;DEBUG
+ prompt
+ 4
+
+
+ ..\..\obj\Release\
+ AnyCPU
+ pdbonly
+ true
+ ..\..\Bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+ quick.ico
+
+
+ Always
+
+
+ ..\..\obj\Debug4KSO\
+ ..\..\Bin\Debug4KSO\
+ TRACE;DEBUG;KSO
+ full
+ true
+ true
+
+
+ ..\..\obj\Release4KSO\
+ ..\..\Bin\Release4KSO\
+ TRACE;KSO
+ true
+ pdbonly
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+ false
+
+
+ EC45F88B427F93107FACAA7D83D542648AA13D1E
+
+
+ Quick_TemporaryKey.pfx
+
+
+ false
+
+
+ Custom
+
+
+
+ false
+
+
+ Properties\app.manifest
+
+
+ Froser.Quick.Program
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ True
+ True
+ Global.resx
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ResXFileCodeGenerator
+ Global.Designer.cs
+ Designer
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+ True
+
+
+
+ Designer
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
+
+
+
+ False
+ Microsoft .NET Framework 4 %28x86 和 x64%29
+ true
+
+
+ False
+ .NET Framework 3.5 SP1 Client Profile
+ false
+
+
+ False
+ .NET Framework 3.5 SP1
+ false
+
+
+ False
+ Windows Installer 4.5
+ true
+
+
+
+
+ {f36b622e-4f74-4d69-912c-fb9de8915362}
+ QuickUI
+
+
+
+
+
+
+
+
+ set config=$(ConfigurationName)
+IF /I %25config%25==Debug (
+xcopy /e /y /i $(OutDir)..\Debug4KSO\config $(OutDir)config
+xcopy /e /y /i $(OutDir)..\Debug4KSO\intro $(OutDir)intro
+md $(OutDir)plugins\3rdparty\everything
+copy /y $(OutDir)..\Debug4KSO\plugins\3rdparty\everything\everything.exe $(OutDir)plugins\3rdparty\everything\everything.exe
+copy /y $(OutDir)..\Debug4KSO\plugins\3rdparty\everything\everything32.dll $(OutDir)plugins\3rdparty\everything\everything32.dll
+copy /y $(OutDir)..\Debug4KSO\plugins\3rdparty\everything\everything64.dll $(OutDir)plugins\3rdparty\everything\everything64.dll
+)
+
+IF /I %25config%25==Release (
+xcopy /e /y /i $(OutDir)..\Debug4KSO\config $(OutDir)config
+xcopy /e /y /i $(OutDir)..\Debug4KSO\intro $(OutDir)intro
+md $(OutDir)plugins\3rdparty\everything
+copy /y $(OutDir)..\Debug4KSO\plugins\3rdparty\everything\everything.exe $(OutDir)plugins\3rdparty\everything\everything.exe
+copy /y $(OutDir)..\Debug4KSO\plugins\3rdparty\everything\everything32.dll $(OutDir)plugins\3rdparty\everything\everything32.dll
+copy /y $(OutDir)..\Debug4KSO\plugins\3rdparty\everything\everything64.dll $(OutDir)plugins\3rdparty\everything\everything64.dll
+)
+
+IF /I %25config%25==R4KSO (
+xcopy /e /y /i $(OutDir)..\Debug4KSO\config $(OutDir)config
+xcopy /e /y /i $(OutDir)..\Debug4KSO\intro $(OutDir)intro
+md $(OutDir)plugins\3rdparty\everything
+copy /y $(OutDir)..\Debug4KSO\plugins\3rdparty\everything\everything.exe $(OutDir)plugins\3rdparty\everything\everything.exe
+copy /y $(OutDir)..\Debug4KSO\plugins\3rdparty\everything\everything32.dll $(OutDir)plugins\3rdparty\everything\everything32.dll
+copy /y $(OutDir)..\Debug4KSO\plugins\3rdparty\everything\everything64.dll $(OutDir)plugins\3rdparty\everything\everything64.dll
+)
+
+
+
\ No newline at end of file
diff --git a/Coding/Quick/Quick.v11.suo b/Coding/Quick/Quick.v11.suo
new file mode 100644
index 0000000..ca2b65a
Binary files /dev/null and b/Coding/Quick/Quick.v11.suo differ
diff --git a/Coding/Quick/QuickCommonObject.cs b/Coding/Quick/QuickCommonObject.cs
new file mode 100644
index 0000000..8ea2348
--- /dev/null
+++ b/Coding/Quick/QuickCommonObject.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Drawing;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading;
+using System.Windows.Forms;
+
+namespace Froser.Quick
+{
+ [Serializable]
+ internal class QuickCommonObject
+ {
+ [DllImport("user32.dll", EntryPoint = "keybd_event")]
+ public static extern void keybd_event(
+ byte bVk, //虚拟键值
+ byte bScan,// 一般为0
+ int dwFlags, //这里是整数类型 0 为按下,2为释放
+ int dwExtraInfo //这里是整数类型 一般情况下设成为 0
+ );
+
+ [DllImport("user32.dll")]
+ private static extern int GetWindowRect(IntPtr hwnd, out Rect lpRect);
+ public struct Rect
+ {
+ public int Left;
+ public int Top;
+ public int Right;
+ public int Bottom;
+ }
+ private IntPtr currentWindowPtr;
+ private bool isGlobal;
+
+ public QuickCommonObject(IntPtr windowPtr, bool isGlobal)
+ {
+ currentWindowPtr = windowPtr;
+ this.isGlobal = isGlobal;
+ }
+
+
+ public Rect GetWindowRect()
+ {
+ Rect lpRect;
+ if (isGlobal)
+ {
+ var rect = Screen.GetWorkingArea(new Point(0, 0));
+ lpRect.Left = rect.Left;
+ lpRect.Right = rect.Right;
+ lpRect.Top = rect.Top;
+ lpRect.Bottom = rect.Bottom;
+ }
+ else
+ {
+ GetWindowRect(currentWindowPtr, out lpRect);
+ }
+ return lpRect;
+ }
+
+ public String GetSelection
+ {
+ get
+ {
+ keybd_event((byte)Keys.LControlKey, 0, 0, 0);
+ keybd_event((byte)Keys.C, 0, 0, 0);
+ keybd_event((byte)Keys.LControlKey, 0, 2, 0);
+ keybd_event((byte)Keys.C, 0, 2, 0);
+ Thread.Sleep(10);
+ return Clipboard.GetText();
+ }
+ }
+
+ public void Call(String cmd, String arg)
+ {
+ Process.Start(cmd, arg);
+ }
+ }
+}
diff --git a/Coding/Quick/QuickConfig.cs b/Coding/Quick/QuickConfig.cs
new file mode 100644
index 0000000..7656647
--- /dev/null
+++ b/Coding/Quick/QuickConfig.cs
@@ -0,0 +1,179 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Windows.Forms;
+using System.Windows.Input;
+using System.Xml.Serialization;
+namespace Froser.Quick
+{
+ public class QuickConfig
+ {
+ public class ContextMenuItem
+ {
+ public const string Replacement = "{$1}";
+ public string Name { get; set; }
+ public string Exec { get; set; }
+ public string Argument { get; set; }
+ public ContextMenuItem()
+ {
+ Name = "上下文名称";
+ Exec = "打开的地址";
+ Argument = "运行参数";
+ }
+ public ContextMenuItem(string name, string exec, string argument)
+ {
+ Name = name;
+ Exec = exec;
+ Argument = argument;
+ }
+ }
+
+ private static String ConfigDir
+ {
+ get
+ {
+ String strConfigDirector = Application.StartupPath;
+ if (!Directory.Exists(strConfigDirector))
+ {
+ Directory.CreateDirectory(strConfigDirector);
+ }
+ return strConfigDirector;
+ }
+ }
+
+ private static String ConfigPath
+ {
+ get
+ {
+ return Path.Combine(ConfigDir, "quick.config");
+ }
+ }
+
+ private static QuickConfig _config;
+ public static QuickConfig ThisConfig
+ {
+ get
+ {
+ if (_config == null)
+ {
+ _config = Load();
+ TrySave(_config);
+ }
+ return _config;
+ }
+ }
+
+ private QuickConfig(bool isTemplate)
+ {
+ Init();
+ if (isTemplate)
+ {
+ ModelName = new List();
+ ModelName.Add("wps");
+ ModelName.Add("et");
+ ModelName.Add("wpp");
+ ModelName.Add("winword");
+ ModelName.Add("excel");
+ ModelName.Add("powerpnt");
+
+ ContextMenuList = new List();
+ ContextMenuList.Add(new ContextMenuItem("用BugManager搜索", "http://wpswebsvr.wps.kingsoft.net/ksbm/ViewIssue.aspx?IssueID={$1}", ""));
+ ContextMenuList.Add(new ContextMenuItem("用Google搜索", "https://www.google.com.hk/webhp?hl=zh-CN&sourceid=cnhp&gws_rd=ssl#newwindow=1&safe=strict&hl=zh-CN&q={$1}", ""));
+ ContextMenuList.Add(new ContextMenuItem("用Baidu搜索", "http://www.baidu.com/baidu?wd={$1}", ""));
+ }
+ }
+
+ private QuickConfig()
+ {
+ Init();
+ }
+
+ private void Init()
+ {
+ FirstRun = true;
+ QuickHotKey = Key.Q;
+ QuickHotKeyFlags = (int)Hotkey.KeyFlags.MOD_CONTROL;
+ ContextMenuHotKey = Key.OemTilde;
+ ContextMenuHotKeyFlags = (int)Hotkey.KeyFlags.MOD_CONTROL;
+ ContextMenuToogle = true;
+ LockWindow = false;
+ }
+
+ public void SetDefaultConfig()
+ {
+ QuickHotKey = Key.Q;
+ QuickHotKeyFlags = (int)Hotkey.KeyFlags.MOD_CONTROL;
+ ContextMenuHotKey = Key.OemTilde;
+ ContextMenuHotKeyFlags = (int)Hotkey.KeyFlags.MOD_CONTROL;
+ ContextMenuToogle = true;
+
+ ContextMenuList = new List();
+ ContextMenuList.Add(new ContextMenuItem("用BugManager搜索", "http://wpswebsvr.wps.kingsoft.net/ksbm/ViewIssue.aspx?IssueID={$1}", ""));
+ ContextMenuList.Add(new ContextMenuItem("用Google搜索", "https://www.google.com.hk/webhp?hl=zh-CN&sourceid=cnhp&gws_rd=ssl#newwindow=1&safe=strict&hl=zh-CN&q={$1}", ""));
+ ContextMenuList.Add(new ContextMenuItem("用Baidu搜索", "http://www.baidu.com/baidu?wd={$1}", ""));
+ }
+
+ public bool TrySave()
+ {
+ return TrySave(this);
+ }
+
+ public void Reload()
+ {
+ _config = Load();
+ }
+
+ ///
+ /// 读取一个配置文件,并返回一个PluginConfig对象。若XML配置文件不存在,则会用初始化本类的方式(使用默认初始化值)来创建一个配置文件。
+ ///
+ private static QuickConfig Load()
+ {
+ QuickConfig instance;
+ if (!File.Exists(ConfigPath))
+ {
+ //配置文件不存在,则创建一个新的实例
+ instance = new QuickConfig(true);
+ TrySave(instance);
+ }
+ else
+ {
+ //如果文件存在,则反序列化它
+ XmlSerializer xmlsLoad = new XmlSerializer(typeof(QuickConfig));
+ using (FileStream fs = new FileStream(ConfigPath, FileMode.Open, FileAccess.Read))
+ {
+ instance = (QuickConfig)xmlsLoad.Deserialize(fs);
+ }
+ }
+ return instance;
+ }
+
+ private static bool TrySave(QuickConfig instance)
+ {
+ try
+ {
+ XmlSerializer xmlsSave = new XmlSerializer(typeof(QuickConfig));
+ using (FileStream fs = new FileStream(ConfigPath, FileMode.Create, FileAccess.Write))
+ {
+ xmlsSave.Serialize(fs, instance);
+ }
+ return true;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ public Boolean FirstRun { get; set; }
+ public Key QuickHotKey { get; set; }
+ public Int32 QuickHotKeyFlags { get; set; }
+ public Key ContextMenuHotKey { get; set; }
+ public Int32 ContextMenuHotKeyFlags { get; set; }
+ public Boolean ContextMenuToogle { get; set; }
+ public List ModelName { get; set; }
+ public List ContextMenuList { get; set; }
+ public String CurrentVersion { get; set; }
+ public List Plugins { get; set; }
+ public Boolean LockWindow { get; set; }
+ }
+}
diff --git a/Coding/Quick/QuickContext.cs b/Coding/Quick/QuickContext.cs
new file mode 100644
index 0000000..d2476f8
--- /dev/null
+++ b/Coding/Quick/QuickContext.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Media.Imaging;
+
+namespace Froser.Quick
+{
+ internal struct QuickContext
+ {
+ public void ClearSubModel()
+ {
+ m_subModel = null;
+ }
+
+ public QuickModel GetSubModel()
+ {
+ return m_subModel;
+ }
+
+ public void ReplaceSubModel(QuickModel m)
+ {
+ m_subModel = m;
+ }
+
+ // 有时候进入某些条目,需要替换掉当前的model
+ private QuickModel m_subModel;
+ }
+}
diff --git a/Coding/Quick/QuickListener.cs b/Coding/Quick/QuickListener.cs
new file mode 100644
index 0000000..cc2ed1c
--- /dev/null
+++ b/Coding/Quick/QuickListener.cs
@@ -0,0 +1,259 @@
+using Froser.Quick.UI;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Drawing;
+using System.Runtime.InteropServices;
+using System.Windows.Forms;
+using System.Windows.Forms.Integration;
+
+namespace Froser.Quick
+{
+ internal class QuickListener
+ {
+ [DllImport("user32.dll")]
+ public static extern IntPtr GetForegroundWindow();
+ [DllImport("User32.dll", CharSet = CharSet.Auto)]
+ public static extern int GetWindowThreadProcessId(IntPtr hwnd, out int ID);
+
+ public static QuickListener Listener
+ {
+ get{
+ return s_listener ?? (s_listener = new QuickListener());
+ }
+ }
+
+ private QuickListener()
+ {
+ m_notify = Program.notify;
+ m_quickHotkey = new Hotkey(IntPtr.Zero);
+ m_contextHotkey = new Hotkey(IntPtr.Zero);
+
+ Init();
+ }
+
+ public void Init()
+ {
+ QuickConfig.ThisConfig.Reload();
+ QuickConfig.ThisConfig.CurrentVersion = Application.ProductVersion;
+ QuickConfig.ThisConfig.TrySave();
+
+ m_quickModels = new Dictionary();
+
+ var globalModel = QuickModel.GetModel(QuickModel.GlobalModelName + ".xml");
+ m_quickModels.Add(QuickModel.GlobalModelName, globalModel); //添加全局Model
+
+ foreach (var item in QuickConfig.ThisConfig.ModelName)
+ {
+ if (!m_quickModels.ContainsKey(item))
+ {
+ m_quickModels.Add(item, QuickModel.GetModel(item + ".xml"));
+ }
+ }
+
+ //装载插件
+ QuickPluginLoader.AddAdditionQuickMethodTo(m_quickModels);
+
+ m_quickContextWindowHandler = new QuickContextWindowHandler();
+ m_quickContextWindow = new QuickContextWindow(m_quickContextWindowHandler);
+ ElementHost.EnableModelessKeyboardInterop(m_quickContextWindow);
+ }
+
+ public void Run()
+ {
+ m_quickHotkey.RegisterHotkey(QuickConfig.ThisConfig.QuickHotKey, (Hotkey.KeyFlags)QuickConfig.ThisConfig.QuickHotKeyFlags);
+ m_quickHotkey.OnHotkey += QuickHotkey_OnHotkey;
+
+ m_contextHotkey.RegisterHotkey(QuickConfig.ThisConfig.ContextMenuHotKey, (Hotkey.KeyFlags)QuickConfig.ThisConfig.ContextMenuHotKeyFlags);
+ m_contextHotkey.OnHotkey += ContextHotkey_OnHotkey;
+ }
+
+ public void Reload()
+ {
+ m_quickHotkey.UnregisterHotkeys();
+ m_contextHotkey.UnregisterHotkeys();
+ m_quickHotkey = new Hotkey(IntPtr.Zero);
+ m_contextHotkey = new Hotkey(IntPtr.Zero);
+ Init();
+ Run();
+ }
+
+ private void ContextHotkey_OnHotkey(int HotKeyID)
+ {
+ try
+ {
+ object obj = GetActiveObject(false);
+ if (QuickConfig.ThisConfig.ContextMenuToogle)
+ {
+ var textObject = QuickReflection.Invoke(m_currentModel.Search, obj);
+ if (textObject != null)
+ {
+ m_quickContextWindow.Show(textObject.ToString ());
+ QuickVitality.UpdateVitality("context", m_currentModel.ProgramName, textObject.ToString());
+ }
+ }
+ }
+ catch { }
+ }
+
+ public void QuickHotkey_OnHotkey(int HotKeyID)
+ {
+ Trigger(false);
+ }
+
+ private void Trigger(bool forceGetGlobalObject)
+ {
+ QuickContext quickContext = default(QuickContext);
+ bool isGlobal;
+ Process currentProcess;
+ IntPtr windowPtr;
+ object obj = GetActiveObject(forceGetGlobalObject, out isGlobal, out windowPtr, out currentProcess);
+ SetupQuickMainWindowAndHandler(obj, quickContext, windowPtr, isGlobal, currentProcess);
+ TriggerQuickMainWindow(isGlobal);
+ }
+
+ private void TriggerQuickMainWindow(bool isGlobal)
+ {
+ if (m_quickMainWindow != null && m_quickMainWindow.IsVisible)
+ {
+ m_quickMainWindow.Close(); //如果窗体已存在并在显示状态,则触发FormClosing,Hide()
+ if (!isGlobal)
+ {
+ // 非公共窗口,再次触发快捷键会打开Global的window
+ Trigger(true);
+ }
+ return;
+ }
+ else
+ {
+ if (m_currentModel.MethodList.Count > 0)
+ {
+ QuickVitality.UpdateVitality("showlist", m_currentModel.ProgramName, "");
+ m_quickMainWindow.Show();
+ m_quickMainWindow.Activate();
+ }
+ }
+ }
+
+ private object GetGlobalObject(IntPtr windowPtr, bool isGlobal)
+ {
+ if (m_commonObject == null)
+ m_commonObject = new QuickCommonObject(windowPtr, isGlobal); //调用公共的Model
+ return m_commonObject;
+ }
+
+ private object GetActiveObject(bool bForceGetGlobalObject)
+ {
+ bool isGlobal;
+ Process currentProcess;
+ IntPtr windowPtr;
+ return GetActiveObject(false, out isGlobal, out windowPtr, out currentProcess);
+ }
+
+ private object GetActiveObject(bool bForceGetGlobalObject, out bool isGlobalModel, out IntPtr windowPtr, out Process currentProcess)
+ {
+ object currentActiveObject = null;
+ windowPtr = GetForegroundWindow();
+ int currentPID;
+ GetWindowThreadProcessId(windowPtr, out currentPID);
+ currentProcess = Process.GetProcessById(currentPID); //获得活动窗口的进程
+
+ isGlobalModel = true;
+ string modelProcessName = string.Empty;
+ if (bForceGetGlobalObject || !m_quickModels.ContainsKey(currentProcess.ProcessName, true, out modelProcessName))
+ {
+ modelProcessName = QuickModel.GlobalModelName;
+ }
+
+ if (!isGlobalModel)
+ Validate(currentProcess.ProcessName);
+ m_currentModel = m_quickModels[modelProcessName];
+
+ if (m_currentModel.ProgramName.Trim() != "")
+ {
+ bool bFailed = true;
+ foreach (var name in m_currentModel.ProgramName.Split(','))
+ {
+ try
+ {
+ currentActiveObject = Marshal.GetActiveObject(name.Trim()); //调用当前的Model
+ bFailed = false;
+ break;
+ }
+ catch { }
+ }
+
+ if (!bFailed)
+ {
+ isGlobalModel = false;
+ }
+ else
+ {
+ m_currentModel = m_quickModels[QuickModel.GlobalModelName];
+ currentActiveObject = GetGlobalObject(windowPtr, true); //调用公共的Model
+ }
+ }
+ else
+ {
+ currentActiveObject = GetGlobalObject(windowPtr, true); //调用公共的Model
+ }
+
+ return currentActiveObject;
+ }
+
+ private void SetupQuickMainWindowAndHandler(object obj, QuickContext quickContext, IntPtr windowPtr, bool isGlobal, Process currentProcess)
+ {
+ if (m_handlerMap == null)
+ m_handlerMap = new Dictionary();
+ if (m_windowMap == null)
+ m_windowMap = new Dictionary();
+
+ QuickMainWindowHandler handler = null;
+ if (m_handlerMap.ContainsKey(m_currentModel))
+ {
+ handler = m_handlerMap[m_currentModel];
+ }
+ else
+ {
+ handler = new QuickMainWindowHandler(obj, m_currentModel, quickContext, windowPtr, isGlobal, currentProcess);
+ m_handlerMap.Add(m_currentModel, handler);
+ }
+
+ if (m_windowMap.ContainsKey(handler))
+ {
+ m_quickMainWindow = m_windowMap[handler];
+ }
+ else
+ {
+ m_quickMainWindow = new QuickMainWindow(handler);
+ ElementHost.EnableModelessKeyboardInterop(m_quickMainWindow);
+ m_windowMap.Add(handler, m_quickMainWindow);
+ }
+
+ System.Windows.Media.Color bgColor = System.Windows.Media.Color.FromRgb((byte)m_currentModel.BorderColorR, (byte)m_currentModel.BorderColorG, (byte)m_currentModel.BorderColorB);
+ m_quickMainWindow.SetBackgroundColor(bgColor);
+ }
+
+ private void Validate(String processName)
+ {
+ Process[] processes = Process.GetProcessesByName(processName);
+ if (processes.Length > 1)
+ {
+ m_notify.ShowBalloonTip("您开启了多个" + processName + "进程,当您调用快捷菜单时,只能对第一个进程进行操作,如果要对其他" + processName + "进行操作,请关闭多余的此类进程。");
+ }
+ }
+
+ private static QuickListener s_listener;
+ private Dictionary m_quickModels;
+ private Hotkey m_quickHotkey;
+ private Hotkey m_contextHotkey;
+ private QuickContextWindow m_quickContextWindow;
+ private QuickContextWindowHandler m_quickContextWindowHandler;
+ private QuickModel m_currentModel;
+ private QuickMainWindow m_quickMainWindow;
+ private NotifyIcon m_notify;
+ private QuickCommonObject m_commonObject;
+ private Dictionary m_handlerMap;
+ private Dictionary m_windowMap;
+ }
+}
diff --git a/Coding/Quick/QuickMethod.cs b/Coding/Quick/QuickMethod.cs
new file mode 100644
index 0000000..6711eba
--- /dev/null
+++ b/Coding/Quick/QuickMethod.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Xml.Serialization;
+
+namespace Froser.Quick
+{
+ public class QuickMethod
+ {
+ public String MethodName = "打开资源管理器 [dakaiziyuanguanliqi]";
+ public String MethodScript = "Call(\"explorer.exe\",\"\")";
+ public String MethodDescription = "打开资源管理器";
+ public String MethodParamRegex = @""; // 可接参数的正则表达式匹配,如\d表示任意数字,.表示任意字符,+表示一个或多个,*表示0个或多个
+ public String MethodDefArgs = ""; //动作执行的默认参数,用逗号分隔开
+ public Int32 MethodPriority = 0;
+ [XmlIgnore]
+ public String Application = ""; //针对特定程序的方法,如wps、et、wpp,用于插件中
+
+ public override String ToString()
+ {
+ return Regex.Replace(MethodName, @"\[.*?\]|\{|\}", "");
+ }
+
+ public void SetAdditionMethod(IQuickPluginMethod method)
+ {
+ m_method = method;
+ }
+
+ public IQuickPluginMethod GetPluginInterface()
+ {
+ if (m_method == null)
+ return null;
+ return new QuickSafePluginMethodRef(m_method);
+ }
+
+ private IQuickPluginMethod m_method;
+ }
+
+}
diff --git a/Coding/Quick/QuickModel.cs b/Coding/Quick/QuickModel.cs
new file mode 100644
index 0000000..6c41f03
--- /dev/null
+++ b/Coding/Quick/QuickModel.cs
@@ -0,0 +1,171 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Xml.Serialization;
+using System.Linq;
+using System.Text.RegularExpressions;
+
+namespace Froser.Quick
+{
+ public class QuickModel
+ {
+ [XmlIgnore]
+ public static String GlobalModelName
+ {
+ get
+ {
+ return "__global";
+ }
+ }
+
+ public QuickModel()
+ {
+ MethodList = new List();
+ }
+
+ public QuickModel(QuickModel cloneProperty)
+ {
+ MethodList = new List();
+ this.BorderColorB = cloneProperty.BorderColorB;
+ this.BorderColorG = cloneProperty.BorderColorG;
+ this.BorderColorR = cloneProperty.BorderColorR;
+ this.Left = cloneProperty.Left;
+ this.Search = cloneProperty.Search;
+ this.Top = cloneProperty.Top;
+ this.Width = cloneProperty.Width;
+ }
+
+ public static void CreateTemplate()
+ {
+ var template = new QuickModel();
+
+ template.ProgramName = "kwps.application";
+ template.MethodList.Add(new QuickMethod());
+
+ template.BorderColorR = 77;
+ template.BorderColorG = 130;
+ template.BorderColorB = 228;
+ using (var fs = File.Create(QuickUtilities.DirectoryFromDomain(@"config\template.xml")))
+ {
+ new XmlSerializer(template.GetType()).Serialize(fs, template);
+ }
+ }
+
+ public static QuickModel GetModel(String filename)
+ {
+ XmlSerializer ser = new XmlSerializer(typeof(QuickModel));
+ QuickModel ret = null;
+ using (FileStream fs =
+ new FileStream(Path.Combine(QuickUtilities.DirectoryFromDomain(@"config\"), filename), FileMode.Open,
+ FileAccess.Read))
+ {
+ ret = (QuickModel)ser.Deserialize(fs);
+ return ret;
+ }
+ }
+
+ public void Save(String filename)
+ {
+ Save(this, filename);
+ }
+
+ private static void Save(QuickModel instance, String filename)
+ {
+ XmlSerializer xmlsSave = new XmlSerializer(typeof(QuickModel));
+ using (FileStream fs = new FileStream(Path.Combine(QuickUtilities.DirectoryFromDomain(@"config\"), filename), FileMode.Create, FileAccess.Write))
+ {
+ xmlsSave.Serialize(fs, instance);
+ }
+ }
+
+ public static String[] GetArguments(string input)
+ {
+ char quote = '"';
+ char[] separator = new char[] { ' ', ',' };
+ //state:
+ //-1: parameter with no quote
+ //0: start
+ //1: in quote
+ int state = 0;
+ List result = new List();
+ string value = "";
+ for (int i = 0; i < input.Length; i++)
+ {
+ char c = input[i];
+ switch (state)
+ {
+ case -1:
+ if (separator.Contains(c))
+ {
+ state = 0;
+ result.Add(value);
+ value = "";
+ }
+ else
+ {
+ value += c;
+ }
+ break;
+
+ case 0:
+ if (c == quote)
+ {
+ state = 1;
+ }
+ else
+ {
+ state = -1;
+ i--;
+ }
+ break;
+
+ case 1:
+ if (c == quote)
+ {
+ state = 0;
+ result.Add(value);
+ value = "";
+ if (i < input.Length - 1 && separator.Contains(input[i + 1]))
+ i++;
+ }
+ else
+ {
+ value += c;
+ }
+ break;
+ }
+ }
+
+ if (value != "")
+ result.Add(value);
+ return result.ToArray();
+ }
+
+ public QuickModel GetFilteredModel(Func condition)
+ {
+ //condition为筛选条件,达到条件者被保留
+ QuickModel model = new QuickModel();
+ Action copyAction = (method) =>
+ {
+ if (condition(method))
+ {
+ model.MethodList.Add(method);
+ }
+ };
+ MethodList.ForEach(copyAction);
+ return model;
+ }
+
+ // meta,不要修改变量名
+ public String ProgramName { get; set; }
+
+ public int BorderColorR { get; set; }
+ public int BorderColorG { get; set; }
+ public int BorderColorB { get; set; }
+ public String Left { get; set; }
+ public String Width { get; set; }
+ public String Top { get; set; }
+ public String Search { get; set; }
+ public List MethodList { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Coding/Quick/QuickMultiVersion.cs b/Coding/Quick/QuickMultiVersion.cs
new file mode 100644
index 0000000..fbef695
--- /dev/null
+++ b/Coding/Quick/QuickMultiVersion.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Froser.Quick
+{
+ internal static class QuickMultiVersion
+ {
+#if KSO
+ public static string s_vitalityRequest = "http://10.20.133.13/vitality.aspx?action={0}&target={1}&api={2}";
+ public static string s_homePage = "http://10.20.133.13";
+ public static string s_commentPage = "http://10.20.133.13/comment.html";
+#else
+ public static string s_vitalityRequest = "http://quick.kd.net/vitality.aspx?action={0}&target={1}&api={2}";
+ public static string s_homePage = "http://quick.kd.net";
+ public static string s_commentPage = "http://quick.kd.net/comment.html";
+#endif
+ }
+}
diff --git a/Coding/Quick/QuickNotify.cs b/Coding/Quick/QuickNotify.cs
new file mode 100644
index 0000000..aebfb2d
--- /dev/null
+++ b/Coding/Quick/QuickNotify.cs
@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using System.Diagnostics;
+using Froser.Quick.UI;
+using System.Windows.Forms.Integration;
+using Froser.Quick.Properties;
+
+namespace Froser.Quick
+{
+ internal abstract class QuickNotify
+ {
+ public static NotifyIcon GetNotify()
+ {
+ NotifyIcon notify = new NotifyIcon();
+ notify.Text = "Quick";
+ notify.Icon = Icon.FromHandle(Resources.quick.GetHicon());
+ notify.MouseClick += (sender, e) => { if (e.Button == MouseButtons.Left) OnAbout(sender, e); };
+ notify.ContextMenuStrip = new ContextMenuStrip();
+ notify.ContextMenuStrip.Items.AddRange(new ToolStripItem[] {
+ new ToolStripMenuItem(Application.ProductName + " " + Application.ProductVersion ),
+ new ToolStripSeparator(),
+ new ToolStripMenuItem("访问主页", null, (sender, e) => Process.Start (QuickMultiVersion.s_homePage )),
+ new ToolStripMenuItem("功能缺失反馈", null, (sender, e) => Process.Start (QuickMultiVersion.s_commentPage )),
+ new ToolStripSeparator(),
+ new ToolStripMenuItem("重新载入配置", null, (sender, e) => QuickListener.Listener.Reload()),
+ new ToolStripMenuItem("偏好设置", null, (sender, e) => ShowPreference(false)),
+ new ToolStripMenuItem("关于", null, OnAbout),
+ new ToolStripSeparator(),
+ new ToolStripMenuItem("退出", null, (sender, e) => Program.Quit()),
+ }
+ );
+ return notify;
+ }
+
+ private static void OnAbout(object sender, EventArgs e)
+ {
+ ShowPreference(true);
+ }
+
+ private static void ShowPreference(bool about)
+ {
+ if (s_perferenceWindowHandler == null)
+ s_perferenceWindowHandler = new QuickPreferenceWindowHandler();
+
+ if (s_perferenceWindow == null)
+ {
+ s_perferenceWindow = new QuickPreferenceWindow(s_perferenceWindowHandler);
+ ElementHost.EnableModelessKeyboardInterop(s_perferenceWindow);
+ }
+
+ if (about)
+ s_perferenceWindow.ShowAbout();
+ else
+ s_perferenceWindow.Show();
+ }
+
+ static QuickPreferenceWindow s_perferenceWindow;
+ static QuickPreferenceWindowHandler s_perferenceWindowHandler;
+ }
+}
diff --git a/Coding/Quick/QuickPluginLoader.cs b/Coding/Quick/QuickPluginLoader.cs
new file mode 100644
index 0000000..15180a2
--- /dev/null
+++ b/Coding/Quick/QuickPluginLoader.cs
@@ -0,0 +1,91 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+
+namespace Froser.Quick
+{
+ internal static class QuickPluginLoader
+ {
+ public static void AddAdditionQuickMethodTo(Dictionary models)
+ {
+ // 从配置文件中读取出加载项,放入model中
+ var plugins = QuickConfig.ThisConfig.Plugins;
+ if (!plugins.Contains(s_defaultPlugin))
+ plugins.Insert(0, s_defaultPlugin);
+ List addedList = new List();
+ foreach (var pluginPath in plugins)
+ {
+ if (addedList.Contains(pluginPath))
+ continue;
+ addedList.Add(pluginPath);
+ string additionDir = QuickUtilities.DirectoryFromDomain(PLUGINS_PATH);
+ string addFullPath = Path.Combine(additionDir, pluginPath);
+ try
+ {
+ var methods = GetMethodsFromAssembly(addFullPath);
+ if (methods == null)
+ continue;
+ foreach (var method in methods)
+ AddToCorrectModel(models, method);
+ }
+ catch { }
+ }
+ }
+
+ private static IQuickPluginMethod[] GetMethodsFromAssembly(string path)
+ {
+ // 加载到当前程序集
+ Assembly asm = Assembly.LoadFrom(path);
+ object instance = asm.CreateInstance("Froser.Quick.QuickPlugin");
+ IQuickPlugin addition = new QuickSafePluginRef((IQuickPlugin)instance);
+ return addition.GetMethods();
+ }
+
+ private static void AddToCorrectModel(Dictionary models, IQuickPluginMethod method)
+ {
+ QuickMethod coreMethod = new QuickMethod();
+ coreMethod.MethodDefArgs = " ";
+ coreMethod.MethodName = method.GetName();
+ coreMethod.MethodDescription = method.GetDescription(null);
+ bool acceptArgs = method.AcceptArgs();
+ coreMethod.MethodParamRegex = acceptArgs ? "." : "";
+ coreMethod.SetAdditionMethod(method);
+
+ bool bAddedToSpecificModel = false;
+ foreach (var modelName in QuickConfig.ThisConfig.ModelName)
+ {
+ var availStr = method.AvailableApplicationName();
+ string[] avails = availStr != null ? availStr.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries) : null;
+ if (avails != null && avails.Contains(modelName, new ModelNameComparer()))
+ {
+ models[modelName].MethodList.Insert(0, coreMethod);
+ bAddedToSpecificModel = true;
+ }
+ }
+ if (!bAddedToSpecificModel)
+ {
+ // 如果没有加到特定的模块,则加到global中
+ models[QuickModel.GlobalModelName].MethodList.Insert(0, coreMethod);
+ }
+ }
+
+ private class ModelNameComparer : IEqualityComparer
+ {
+ public bool Equals(string x, string y)
+ {
+ return x.Trim().ToLower() == y.Trim().ToLower();
+ }
+
+ public int GetHashCode(string obj)
+ {
+ return obj.GetHashCode();
+ }
+ }
+
+ public const string PLUGINS_PATH = "plugins";
+ private const string s_defaultPlugin = "quickplugin.dll";
+ }
+}
diff --git a/Coding/Quick/QuickReflection.cs b/Coding/Quick/QuickReflection.cs
new file mode 100644
index 0000000..47e08a1
--- /dev/null
+++ b/Coding/Quick/QuickReflection.cs
@@ -0,0 +1,261 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Text.RegularExpressions;
+
+namespace Froser.Quick
+{
+ ///
+ /// 定义了一些反射方法的类
+ ///
+ internal static class QuickReflection
+ {
+ ///
+ /// 通过调用一些符合C#语法的语句,给对象的成员赋值
+ ///
+ /// 符合C#语法的语句
+ /// 需要赋的值
+ /// 需要赋值的对象
+ public static void Set(String api, object value, object targetObj)
+ {
+ object last_obj;
+ string last_member_name;
+ object obj = Invoke(api, out last_obj, out last_member_name, targetObj);
+ last_obj.GetType().InvokeMember(last_member_name, BindingFlags.SetProperty, null, last_obj, new object[] { value });
+ }
+
+ ///
+ /// 调用某个对象的特定方法或返回特定属性成员
+ ///
+ /// 符合C#语法的语句
+ /// 需要赋值的对象
+ /// 返回对象或属性的值
+ public static object Invoke(String api, object targetObj)
+ {
+ string strUseless = "";
+ object objUseless = null;
+ return Invoke(api, out objUseless, out strUseless, targetObj);
+ }
+
+ private static object Invoke(String api, out object last_obj, out string last_member_name, object targetObj)
+ {
+ last_member_name = "";
+ last_obj = null;
+ object _obj = targetObj;
+ string member_name;
+ object[] parameters;
+ BindingFlags flags;
+ bool loop = true;
+ try
+ {
+ //通过反射运行一段API,并获取返回值
+ //API返回值大致这样分类:
+ // 1. 属性值 ( {Property.Property...} = {pi} )
+ // 2. 方法返回值 ( {Property.Method (Param1, Param2 ...) )
+ while (loop)
+ {
+ loop = GetNextMember(api, _obj, out member_name, out flags, out parameters, out api, targetObj);
+ last_obj = _obj;
+ _obj = _obj.GetType().InvokeMember(member_name, flags, null, _obj, parameters);
+ last_member_name = member_name;
+ }
+ }
+ catch (Exception e)
+ {
+ throw e;
+ }
+ return _obj;
+ }
+
+ private static bool GetNextMember(string api_string, object COMObj, out string member_name, out BindingFlags flags, out object[] parameters, out string api_remaining_string, object top_obj)
+ {
+ Regex regIndexer = new Regex(@"\[(?(.*))\]");
+ string s = api_string;
+ while (s[0] == '.')
+ {
+ s = s.Remove(0, 1);
+ }
+ String[] sections = s.Split(new char[] { '.' }, StringSplitOptions.RemoveEmptyEntries);
+ Match mIndexer = regIndexer.Match(sections[0]);
+ while (mIndexer.Success)
+ {
+ string result = mIndexer.Result("${index}");
+ sections[0] = sections[0].Replace("[" + result + "]", ".Item(" + result + ")");
+ mIndexer = mIndexer.NextMatch();
+ }
+ s = "";
+ foreach (string frag in sections)
+ {
+ s += frag + ".";
+ }
+ s = s.Remove(s.Length - 1);
+
+ string recorder = "";
+ for (int i = 0; i < s.Length; i++)
+ {
+ if (char.IsWhiteSpace(s[i])) continue;
+ if (s[i] != '.' && s[i] != '(' && s[i] != '[')
+ {
+ recorder += s[i];
+ }
+ else if (s[i] == '.')
+ {
+ flags = BindingFlags.GetProperty;
+ member_name = recorder;
+ parameters = null;
+ api_remaining_string = s.Substring(i);
+ if (api_remaining_string == "") return false;
+ return true;
+ }
+ else if (s[i] == '(')
+ {
+ i++;
+ string pstring = "";
+ try
+ {
+ while (s[i] != ')' || s.Substring(0, i).CountOf('"') % 2 == 1)
+ {
+ pstring += s[i];
+ i++;
+ }
+ i++;
+ List