129 Commits

Author SHA1 Message Date
BookerLiu
e1fa15d624 📝 更新内容 2025-03-10 10:28:11 +08:00
BookerLiu
2381be3efc ⬆️ 升级依赖项 2025-03-07 13:02:31 +08:00
BookerLiu
7b2ffadf9c 🐛 修复不能实时自动排序 2025-03-07 11:29:41 +08:00
BookerLiu
32e91d6d23 :fire:增加自定义背景保存 2025-03-07 10:59:39 +08:00
BookerLiu
e74b6d75c4 🔨 更新信息 2024-08-08 11:22:49 +08:00
BookerLiu
2360cced09 🔨 更新信息 2024-08-08 11:19:51 +08:00
BookerLiu
60238ddb17 ♻️ 将检测更新改为任务模式 2024-08-08 11:16:22 +08:00
BookerLiu
39251b66f6 🐛 高分屏下的鼠标位置 2024-08-08 10:56:00 +08:00
BookerLiu
2a4f9a9bda 🐛 修复拾色器在高分屏缩放下的bug 2024-08-08 08:41:42 +08:00
BookerLiu
a61c69aa0b 增加多文件备份, 尝试修复UI假死状态, 修复高分屏缩放导致的鼠标追随bug 2024-08-07 11:04:48 +08:00
Booker
8fea77c304 优化时钟显示功能 2024-01-02 19:50:41 +08:00
Booker
f1b4698878 增加隐藏标题功能 2024-01-02 19:50:04 +08:00
Booker
7d3f1c9af0 Merge pull request #114 from BookerLiu/BookerLiu-patch-2
Update README.md
2023-05-29 17:04:04 +08:00
Booker
a3af8635fc Update README.md 2023-05-29 17:03:54 +08:00
Booker
b2a8effff9 Merge pull request #113 from BookerLiu/BookerLiu-patch-1
Update README-zh.md
2023-05-29 17:03:09 +08:00
Booker
060836d5cd Update README-zh.md 2023-05-29 17:02:48 +08:00
Booker
c7456cf66d Update README.md 2023-04-25 13:53:39 +08:00
Booker
4706f2b021 Update README-zh.md 2023-04-25 13:41:42 +08:00
Booker
0067f568de Update and rename Readmee.md to README.md 2023-04-25 13:40:00 +08:00
Booker
00acc0311c Rename README.md to README-zh.md 2023-04-25 13:36:19 +08:00
Booker
0613fe5e4a Create Readmee.md 2023-04-25 13:35:30 +08:00
Booker
42d729bf4c Update README.md 2023-04-25 13:27:58 +08:00
Booker
1c37517d86 Update Update.json 2023-04-24 17:30:41 +08:00
Booker
f340c5e357 Merge pull request #106 from BookerLiu/2.5.14
2.5.14
2023-04-24 17:08:28 +08:00
BookerLiu
087e98e6df 💥 发布吧 2023-04-24 17:03:25 +08:00
BookerLiu
8b2919c3b5 🚨 捕获异常, 取消崩溃通知 2023-04-23 21:46:55 +08:00
BookerLiu
1d6830b30b 🚨 捕获异常, 取消崩溃通知 2023-04-23 21:42:55 +08:00
BookerLiu
ac8302280f 🔀 禁用窗口最大化 2023-04-23 20:58:12 +08:00
BookerLiu
2df6582f83 💥 准备发行 2023-04-23 17:54:23 +08:00
BookerLiu
ece8787b8e 优化UI, 提取公共样式 2023-04-21 22:33:05 +08:00
BookerLiu
2e1cc7ee3c 优化UI, 提取公共代码 2023-04-21 21:56:49 +08:00
BookerLiu
f152aaf1f4 ♻️ 优化代码, 提取公共样式 2023-04-21 18:05:06 +08:00
BookerLiu
6fd1e65db7 更改部分样式 2023-04-21 17:35:18 +08:00
BookerLiu
ea39576709 💩 防止无法弹出更新窗口 2023-04-21 14:16:58 +08:00
BookerLiu
9485b801b6 💩 添加用户统计代码 2023-04-19 22:19:44 +08:00
BookerLiu
08424b0db0 🐛 防止点击关闭搜索框后打开列表项目 2023-04-19 16:51:56 +08:00
BookerLiu
9de5a19f7f 🎉 添加新手引导提示 2023-04-19 15:50:46 +08:00
BookerLiu
943e8bcefb 🎉 添加新手引导 2023-04-19 15:44:50 +08:00
BookerLiu
48732a0815 🎉 添加新手引导提示 2023-04-19 15:42:51 +08:00
BookerLiu
08b4596f31 🎉 添加新手引导提示 2023-04-18 18:13:25 +08:00
BookerLiu
4565dc5bd6 🐛 修复加密提示未显示的bug 2023-04-17 15:07:28 +08:00
BookerLiu
48fffa6da7 🥕 优化everything 搜索结果 2023-04-17 14:12:31 +08:00
BookerLiu
6072832654 🐛 修复列表显示不全的bug 2023-04-17 13:26:58 +08:00
BookerLiu
dd41635199 🐔 优化everything搜索 2023-04-14 21:30:15 +08:00
BookerLiu
85ad6a6bc4 优化everything搜索 2023-04-14 18:02:18 +08:00
BookerLiu
c34142923c 🧡优化拾色器 2023-04-14 17:44:39 +08:00
BookerLiu
29bb799f11 优化搜索结果显示UI 2023-04-14 14:26:42 +08:00
BookerLiu
41799251af 优化everything功能 2023-04-14 13:48:50 +08:00
BookerLiu
a7181f6973 🚀 减少everything搜索卡顿 2023-04-13 16:39:24 +08:00
BookerLiu
eba6d4770a 优化代码 2023-04-12 15:19:19 +08:00
BookerLiu
058ed5016a 🐛 优化代码 2023-04-07 16:10:29 +08:00
Booker
888c9d3330 Update README.md 2023-04-06 20:56:32 +08:00
BookerLiu
77a6233e63 优化everything启动 2023-04-06 20:51:17 +08:00
Booker
20071acc4e Update README.md 2023-04-06 20:40:49 +08:00
BookerLiu
98f332dc2e ♻️ 开启虚拟化防止卡顿, 增加自适应宽度 2023-04-06 20:36:20 +08:00
BookerLiu
3a18882372 ⚰️ 虚拟化环绕panel 2023-04-06 18:10:49 +08:00
BookerLiu
26e4a7e4d5 文件监听优化 2023-04-06 16:09:33 +08:00
BookerLiu
280e66f457 🎉 every thing 2023-04-04 18:07:27 +08:00
BookerLiu
1fce566f4a EveryThing搜索优化 2023-04-04 17:59:06 +08:00
BookerLiu
3654ec393a 调整合适宽度 2023-04-04 13:47:08 +08:00
BookerLiu
b12bbe9183 🎉 主面板增加是否置顶选项 2023-04-04 13:33:36 +08:00
Demo_Liu
37dd2f7fb2 🐛 控制主面板热键调用频率 2023-04-03 21:18:32 +08:00
BookerLiu
4b5cc7b7eb 🎉 增加是否置于顶层开关 2023-03-31 18:17:24 +08:00
BookerLiu
a18a66352c 🎉 集成everything 2023-03-31 09:06:04 +08:00
BookerLiu
d0547da214 💥 集成everything 开发 2023-03-27 18:10:39 +08:00
BookerLiu
300fcb78da 🚸 删除空菜单不进行确认 2023-03-21 17:54:23 +08:00
BookerLiu
05afacd3ae feture 增加关联实时文件夹 2023-03-21 17:48:12 +08:00
BookerLiu
425d1a4ce5 feture 增加关联实时文件夹 2023-03-21 17:18:18 +08:00
BookerLiu
32adce1815 👥 菜单删除增加询问确认 2023-03-20 14:38:36 +08:00
BookerLiu
80a9975140 ⬆️ 升级依赖 2023-03-20 14:19:56 +08:00
BookerLiu
c1e83e8a39 Revert "新增关联文件夹菜单功能"
This reverts commit ce17e7174e.
2023-03-20 11:29:59 +08:00
Booker
5fa5d3436d Merge pull request #100 from 1062406901/master
新增可关联实时文件夹功能,修改一下bug
2023-03-20 11:07:57 +08:00
Booker
f4a060eb00 Merge pull request #91 from Hsxxxxxx/master
修复直接拖动新图标到菜单导致的异常
2023-03-20 11:05:45 +08:00
huangcan
6fda2ea107 修改多显示器的拾色器显示问题 2023-01-29 16:11:54 +08:00
huangcan
ce17e7174e 新增关联文件夹菜单功能 2023-01-29 15:03:38 +08:00
IamTheViolence
2fd078f722 Merge pull request #1 from BookerLiu/master
Create LICENSE
2023-01-29 11:38:39 +08:00
Hsxxxxxx
753a4e4fa2 修复直接拖动新图标到菜单导致的异常 2022-10-14 15:46:49 +08:00
Booker
ca38d44feb Create LICENSE 2022-09-06 14:53:21 +08:00
Booker
546985f132 Merge pull request #68 from BookerLiu/2.5.13
2.5.13
2022-09-02 16:55:04 +08:00
BookerLiu
ee47443c34 Merge branch '2.5.13' of https://github.com/BookerLiu/GeekDesk into 2.5.13 2022-09-02 16:52:56 +08:00
BookerLiu
ad2556a216 🐛 2022-09-02 15:35:40 +08:00
Booker
ab5529f1e8 Merge pull request #65 from BookerLiu/2.5.13 2022-09-02 11:30:16 +08:00
Booker
7589736751 Merge branch 'master' into 2.5.13 2022-09-02 11:30:08 +08:00
BookerLiu
de57b8d78d 🎉 2022-09-02 11:05:17 +08:00
BookerLiu
d9b0a4de89 🎉 更改logo 2022-09-02 10:56:21 +08:00
BookerLiu
d5e0dc98db 优化代码 2022-09-01 15:23:44 +08:00
BookerLiu
e82af431b5 🚑 修复可能导致输入法特定场景卡顿的问题 2022-08-30 09:06:27 +08:00
Booker
7360412c97 Merge pull request #63 from 1062406901/master
修改密码输入问题与拾色器问题
2022-07-26 11:19:51 +08:00
huangcan
3fa3a42bb3 提交修改:在使用DPI缩放时可以正确的使用取色器 2022-07-25 17:01:16 +08:00
huangcan
904e9a2999 提交更改:将每次点击加密菜单的dialog type值改成input 2022-07-25 12:56:12 +08:00
Booker
39bb8e0c67 Merge pull request #61 from 1062406901/master
更改待办无法编辑或删除的问题
2022-07-20 17:20:09 +08:00
huangcan
01350dff43 提交修改:代办窗口初始化时,初始化type属性为NEW 2022-07-14 11:36:07 +08:00
Booker
8efab6bdee Merge pull request #51 from BookerLiu/2.5.11
2.5.11
2022-06-17 11:10:28 +08:00
liufei
cbaeb71a0c 🧑‍💻 配置文件控制公众号显示 2022-06-17 10:20:36 +08:00
liufei
b8a6c9b91d 🚑 更新信息 2022-06-17 10:05:34 +08:00
liufei
001d807bb3 🐛 修复了某些路径无法建立相对路径导致程序启动崩溃的bug 2022-06-17 10:03:35 +08:00
Booker
93e70e4525 Merge pull request #50 from BookerLiu/2.5.10
:bug:修改提示
2022-06-15 17:41:14 +08:00
liufei
240008ce2c :bug:修改提示 2022-06-15 17:40:43 +08:00
Booker
6cfa9b1361 Merge pull request #49 from BookerLiu/2.5.10
2.5.10
2022-06-15 09:40:18 +08:00
liufei
8f043ffd05 ♻️ 优化贴边隐藏的动画时间 2022-06-14 11:49:46 +08:00
liufei
6e58afcdea ♻️ 优化动画及部分样式 2022-06-14 10:37:24 +08:00
liufei
896dc26f11 🐛 修复路径可能为空导致创建相对路径报错的问题 2022-06-14 09:48:13 +08:00
liufei
d44cc90100 💥 2.5.10 2022-06-13 20:59:31 +08:00
liufei
da7588273e 🩹 修复关闭后仍有后台窗口, 优化主窗口动画 2022-06-13 20:35:48 +08:00
liufei
c7ef24a5b1 🚩 增加面板按钮点击运行时状态,此时不执行gotfocus 2022-06-11 17:25:09 +08:00
liufei
6b6372847c 🚩 增加列表加密功能 2022-06-11 17:15:56 +08:00
liufei
3995084776 🚩 增加相对路径功能 2022-06-08 15:52:48 +08:00
liufei
7d061abadc 🎉 增加了相对路径 2022-06-07 16:34:07 +08:00
liufei
9d174ed2fc 💩 优化一部分代码 2022-06-07 11:16:14 +08:00
liufei
444697b457 🚀 优化部分图标为小图标问题 2022-06-06 16:37:12 +08:00
liufei
2ecad2fea2 :bug:修复F1--F12快捷键不显示的问题 2022-06-03 23:53:03 +08:00
liufei
e46d64193b 🐛 修改了log文件夹 2022-06-03 23:42:45 +08:00
liufei
e42f2c3c73 🚑 增加了备份和自动备份功能 端午节快乐 🎉 2022-06-03 22:04:10 +08:00
liufei
0aa7969e4a 📱 🔍 优化搜索功能/优化动画 2022-06-02 17:37:22 +08:00
liufei
1a88194d26 🔖 2022-06-01 15:56:32 +08:00
liufei
b47dd0fbf7 增加可拖动到其它菜单功能 切换了icon动画 2022-06-01 15:55:33 +08:00
Booker
50cebd48ce Merge pull request #48 from BookerLiu/2.4.16
🐛 修复无法点击切换菜单的bug
2022-05-27 16:24:43 +08:00
liufei
4c5c88769f 🐛 修复无法点击切换菜单的bug 2022-05-27 16:17:02 +08:00
Booker
2fc38fdb5f Merge pull request #47 from BookerLiu/2.4.16
📝 更新信息
2022-05-27 15:33:00 +08:00
liufei
c310fd441f 📝 更新信息 2022-05-27 15:23:27 +08:00
Booker
302e8bff8b Merge pull request #46 from BookerLiu/2.4.16
📝 更新信息
2022-05-27 15:09:24 +08:00
liufei
12ac544e42 📝 更新信息 2022-05-27 15:08:34 +08:00
Booker
d72ea7a43a Merge pull request #45 from BookerLiu/2.4.16
2.4.16
2022-05-27 15:00:11 +08:00
liufei
f868eb77b6 2.4.16 补丁版本 2022-05-27 14:55:53 +08:00
Booker
efb8c537d3 Update README.md 2022-05-27 11:25:58 +08:00
liufei
f56991410b 🐛 修复无法修改菜单名称的问题 2022-05-27 11:19:54 +08:00
liufei
9cbbd6cf45 🐛 修复通过任务栏图标打开拾色器, 菜单消失问题 2022-05-27 10:48:34 +08:00
Booker
524b134d16 Update README.md 2022-05-26 17:54:52 +08:00
Booker
5c17348312 Merge pull request #43 from Demo-Liu/2.4.15
2.4.15
2022-05-26 17:21:25 +08:00
144 changed files with 13460 additions and 1624 deletions

View File

@@ -2,9 +2,16 @@
<configuration>
<configSections>
<section name="SystemIcons" type="System.Configuration.DictionarySectionHandler" />
<section name="ShowSecondsSettings" type="System.Configuration.DictionarySectionHandler" />
<section name="SystemBGs" type="System.Collections.ObjectModel.ObservableCollection" />
<section name="GradientBGParam" type="GeekDesk.ViewModel.GradientBGParam" />
</configSections>
<ShowSecondsSettings>
<add key="Version" value="1.0.01" />
<add key="LProportion" value="0.82" />
<add key="TProportion" value="0.03" />
<add key="DelayTime" value="1500" />
</ShowSecondsSettings>
<SystemIcons>
<add key="Calculator" value="计算器" />
<add key="Computer" value="此电脑" />
@@ -19,13 +26,14 @@
<add key="Services" value="服务" />
</SystemIcons>
<SystemBGs>
<GradientBGParam Color1="#FCCF31" Color2="#F55555" Name="诸神黄昏"/>
<GradientBGParam Color1="#FCCF31" Color2="#F55555" Name="诸神黄昏" />
</SystemBGs>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib;Plugins\EveryThing\lib" />
<dependentAssembly>
<assemblyIdentity name="CommonServiceLocator" publicKeyToken="489b6accfaf20ef0" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.6.0" newVersion="2.0.6.0" />
@@ -46,17 +54,23 @@
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.1.1.0" newVersion="2.1.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<appSettings>
<add key="Version" value="2.4.15" />
<add key="Version" value="2.5.15" />
<add key="GitHubUrl" value="https://github.com/BookerLiu/GeekDesk" />
<add key="GiteeUrl" value="https://gitee.com/BookerLiu/GeekDesk/tree/master" />
<add key="GitHubUpdateUrl" value="https://raw.githubusercontent.com/BookerLiu/GeekDesk/master/Update.json" />
<add key="GiteeUpdateUrl" value="https://gitee.com/BookerLiu/GeekDesk/raw/master/Update.json" />
<!--<add key="GiteeUpdateUrl" value="file:///C:/Users/Fei/Desktop/GeekDesk/Update.json" />-->
<!--<add key="GiteeUpdateUrl" value="file:///D:/WorkSpace/VS/GeekDesk/Update.json" />-->
<add key="ClientSettingsProvider.ServiceUri" value="" />
<add key="CustomIconTeachUrl" value="https://mp.weixin.qq.com/s/LxoHAekho9HBVl4FRw_Law" />
<add key="ShowPublicWeChat" value="Y" />
<add key="BakDays" value="7" />
</appSettings>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">

View File

@@ -13,6 +13,8 @@
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
<ResourceDictionary Source="/GeekDesk;component/Resource/Dictionary/CommonStyle.xaml"/>
<ResourceDictionary Source="pack://application:,,,/XamlFlair.WPF;component/DefaultAnimations.xaml"/>
<ResourceDictionary Source="/GeekDesk;component/Resource/Dictionary/XamlFlairSettings.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>

View File

@@ -1,8 +1,14 @@
using GeekDesk.Constant;
using GeekDesk.MyThread;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using Microsoft.Win32;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Threading;
namespace GeekDesk
@@ -20,11 +26,13 @@ namespace GeekDesk
this.Startup += new StartupEventHandler(App_Startup);
Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
SystemEvents.PowerModeChanged += OnPowerModeChanged;
}
private void App_Startup(object sender, StartupEventArgs e)
{
//RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly; //禁用硬件加速
mutex = new System.Threading.Mutex(true, Constants.MY_NAME, out bool ret);
if (!ret)
{
@@ -32,11 +40,34 @@ namespace GeekDesk
mutex = new System.Threading.Mutex(true, Constants.MY_NAME, out ret);
if (!ret)
{
MessageUtil.SendMsgByWName(
"GeekDesk_Main_" + Constants.MY_UUID,
"ShowApp"
);
Environment.Exit(0);
}
}
}
//电源监听
private void OnPowerModeChanged(object sender, PowerModeChangedEventArgs e)
{
switch (e.Mode)
{
case PowerModes.Resume:
// 系统从休眠状态唤醒
LogUtil.WriteLog("System resumed from sleep.");
ProcessUtil.ReStartApp();
break;
case PowerModes.Suspend:
// 系统进入休眠状态
LogUtil.WriteLog("System is going to sleep.");
break;
}
}
void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
e.Handled = true;//使用这一行代码告诉运行时该异常被处理了不再作为UnhandledException抛出了。
@@ -51,7 +82,7 @@ namespace GeekDesk
void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
LogUtil.WriteErrorLog(e, "严重异常!");
MessageBox.Show("GeekDesk遇到未知问题崩溃!");
//MessageBox.Show("GeekDesk遇到未知问题崩溃!");
}
public static void DoEvents()
{

View File

@@ -13,14 +13,34 @@ namespace GeekDesk.Constant
public static string MY_NAME = DEV ? "GeekDesk-D" : "GeekDesk";
public static string MY_UUID = "8400A17AEEF7C029";
/// <summary>
/// app数据文件路径
/// </summary>
public static string DATA_FILE_PATH = APP_DIR + "Data"; //app数据文件路径
public static string LOG_FILE_PATH = APP_DIR + "Log.log";
/// <summary>
/// 备份文件路径
/// </summary>
public static string DATA_FILE_BAK_DIR_PATH = APP_DIR + "bak"; //app备份数据文件路径
public static string DATA_FILE_TEMP_DIR_PATH = APP_DIR + "temp"; //app临时缓存文件路径
//public static string DATA_FILE_BAK_PATH = DATA_FILE_BAK_DIR_PATH + "\\Data.bak"; //app备份数据文件路径
public static string PW_FILE_BAK_PATH = APP_DIR + "bak\\pw.txt"; //密码文件路径
public static string UUID_FILE_BAK_PATH = APP_DIR + "bak\\uuid.txt"; //uuid文件路径
public static string LOG_FILE_PATH = APP_DIR + "logs\\log.log"; //日志文件
public static string ERROR_FILE_PATH = APP_DIR + "logs\\error.log"; // 错误日志
/// <summary>
/// 插件文件夹
/// </summary>
public static string PLUGINS_PATH = APP_DIR + "plugins\\";
public static string ERROR_FILE_PATH = APP_DIR + "Error.log";
public static int SHADOW_WIDTH = 20;

17
Constant/DictConst.cs Normal file
View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GeekDesk.Constant
{
public class DictConst
{
public static readonly Dictionary<bool, string> batchMenuHeaderDict = new Dictionary<bool, string>();
static DictConst() {
batchMenuHeaderDict.Add(true, "取消批量操作");
batchMenuHeaderDict.Add(false, "批量操作");
}
}
}

14
Constant/MenuType.cs Normal file
View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GeekDesk.Constant
{
public enum MenuType
{
NORMAL, //普通菜单
LINK, //关联菜单
}
}

16
Constant/PasswordType.cs Normal file
View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GeekDesk.Constant
{
public enum PasswordType
{
INPUT = 0, //键入密码
CREATE = 1, //新建密码
ALTER = 2, //修改密码
CANCEL = 3, //取消密码
}
}

View File

@@ -1,4 +1,6 @@
namespace GeekDesk.Constant
using System;
namespace GeekDesk.Constant
{
internal class RunTimeStatus
{
@@ -6,21 +8,83 @@
/// <summary>
/// 查询框是否在工作
/// </summary>
public static bool SEARCH_BOX_SHOW = false;
public static volatile bool SEARCH_BOX_SHOW = false;
/// <summary>
/// 查询框是否已经关闭了300毫秒 防止点击右侧区域关闭查询框时误打开列表
/// </summary>
public static volatile bool SEARCH_BOX_HIDED_300 = true;
/// <summary>
/// 贴边隐藏后 以非鼠标经过方式触发显示
/// </summary>
public static bool MARGIN_HIDE_AND_OTHER_SHOW = false;
public static volatile bool MARGIN_HIDE_AND_OTHER_SHOW = false;
/// <summary>
/// 是否锁定主面板 锁定后 不执行隐藏动作
/// </summary>
public static bool LOCK_APP_PANEL = false;
public static volatile bool LOCK_APP_PANEL = false;
/// <summary>
/// 是否弹出了菜单密码框
/// </summary>
public static volatile bool SHOW_MENU_PASSWORDBOX = false;
/// <summary>
/// 是否弹出了右键菜单
/// </summary>
public static volatile bool SHOW_RIGHT_BTN_MENU = false;
/// <summary>
/// 是否点击了面板功能按钮
/// </summary>
public static volatile bool APP_BTN_IS_DOWN = false;
/// <summary>
/// 是否正在编辑菜单
/// </summary>
public static volatile bool IS_MENU_EDIT = false;
/// <summary>
/// 图标card 鼠标滚轮是否正在工作
/// 用来控制popup的显示 否则低性能机器会造成卡顿
/// </summary>
public static volatile bool ICONLIST_MOUSE_WHEEL = false;
/// <summary>
/// 控制多少毫秒后 关闭(ICONLIST_MOUSE_WHEEL)鼠标滚轮运行状态
/// </summary>
public static volatile int MOUSE_WHEEL_WAIT_MS = 100;
/// <summary>
/// 与关闭popup 配合使用, 避免线程结束后不显示popup
/// </summary>
public static volatile bool MOUSE_ENTER_ICON = false;
/// <summary>
/// 控制每次刷新搜索结果 鼠标移动后显示popup
/// </summary>
public static volatile int MOUSE_MOVE_COUNT = 0;
/// <summary>
/// everything 新的键入搜索
/// </summary>
public static volatile bool EVERYTHING_NEW_SEARCH = false;
/// <summary>
/// 键入多少毫秒后 没有新的键入开启搜索
/// </summary>
public static volatile int EVERYTHING_SEARCH_DELAY_TIME = 300;
/// <summary>
/// 控制主界面热键按下规定时间内只执行一次show hide
/// </summary>
public static volatile bool MAIN_HOT_KEY_DOWN = false;
/// <summary>
/// 控制主界面热键按下规定时间内只执行一次show hide
/// </summary>
public static volatile int MAIN_HOT_KEY_TIME = 300;
}
}

19
Constant/WidthTypeEnum.cs Normal file
View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GeekDesk.Constant
{
public enum WidthTypeEnum
{
LEFT_CARD = 0, //左侧托盘宽度
RIGHT_CARD = 1, //右侧托盘宽度
RIGHT_CARD_HALF = 2, //右侧托盘宽度的一半
RIGHT_CARD_HALF_TEXT = 3, //右侧托盘宽度的一半 再减去左侧图像宽度
RIGHT_CARD_20 = 4, //右侧托盘宽度 - 20
RIGHT_CARD_40 = 5, //右侧托盘宽度 - 40
RIGHT_CARD_70 = 6, //右侧托盘宽度 - 70
}
}

View File

@@ -0,0 +1,34 @@
<Border x:Class="GeekDesk.Control.Other.BGNmaeDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:cvt="clr-namespace:GeekDesk.Converts"
CornerRadius="4"
Width="350"
Height="160"
Style="{StaticResource BorderBG}"
>
<Border.Resources>
<Style x:Key="LeftTB" TargetType="TextBlock" BasedOn="{StaticResource TextBlockBaseStyle}">
<Setter Property="Width" Value="75"/>
<Setter Property="TextAlignment" Value="Left"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5,8,0,0"/>
<Setter Property="FontSize" Value="14"/>
</Style>
<cvt:StringAppendConvert x:Key="StringAppendConvert"/>
</Border.Resources>
<hc:SimplePanel Margin="10" VerticalAlignment="Center">
<StackPanel>
<Button Width="22" Height="22" Command="hc:ControlCommands.Close" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top"/>
<hc:UniformSpacingPanel Spacing="10" Margin="0,15,0,0">
<TextBlock Text="起个名字吧:" Style="{StaticResource LeftTB}"/>
<TextBox x:Name="BGName" Style="{StaticResource MyTextBoxStyle}" Text="{Binding Name, Mode=OneWay}" Width="230" FontSize="14"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Margin="0,25,0,0" Spacing="10" Grid.ColumnSpan="4">
<Button Content="保存" Style="{StaticResource MyBtnStyle}" Click="Save" Margin="265,10,0,0"/>
</hc:UniformSpacingPanel>
</StackPanel>
</hc:SimplePanel>
</Border>

View File

@@ -0,0 +1,42 @@
using GeekDesk.Constant;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using Microsoft.Win32;
using System;
using System.Windows;
using System.Windows.Media.Imaging;
namespace GeekDesk.Control.Other
{
/// <summary>
/// TextDialog.xaml 的交互逻辑
/// </summary>
public partial class BGNmaeDialog
{
public HandyControl.Controls.Dialog dialog;
public BGNmaeDialog()
{
InitializeComponent();
}
/// <summary>
/// 保存
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Save(object sender, RoutedEventArgs e)
{
GradientBGParam bg = new GradientBGParam();
bg.Id = Guid.NewGuid().ToString();
bg.Name = BGName.Text;
bg.Color1 = MainWindow.appData.AppConfig.GradientBGParam.Color1;
bg.Color2 = MainWindow.appData.AppConfig.GradientBGParam.Color2;
MainWindow.appData.AppConfig.CustomBGParams.Add(bg);
MainWindow.appData.AppConfig.CustomBGParams = DeepCopyUtil.DeepCopy(MainWindow.appData.AppConfig.CustomBGParams);
dialog.Close();
}
}
}

View File

@@ -37,17 +37,17 @@
</hc:Card>
<hc:UniformSpacingPanel Spacing="20" HorizontalAlignment="Center" Margin="45.5,310,42.5,36">
<hc:TextBox x:Name="DelayTime" Height="20" Width="60" Text="10" PreviewTextInput="DelayTime_PreviewTextInput" PreviewLostKeyboardFocus="DelayTime_PreviewLostKeyboardFocus" />
<hc:TextBox x:Name="DelayTime" Style="{StaticResource MyTextBoxStyle}" Height="20" Width="60" Text="10" PreviewTextInput="DelayTime_PreviewTextInput" PreviewLostKeyboardFocus="DelayTime_PreviewLostKeyboardFocus" />
<ComboBox x:Name="DelayType" hc:DropDownElement.ConsistentWidth="False" SelectedIndex="0" Height="20" Width="60">
<ComboBox.Items>
<ComboBoxItem Content="分"/>
<ComboBoxItem Content="时"/>
</ComboBox.Items>
</ComboBox>
<Button Content="推迟提醒" Click="DelayButton_Click"/>
<Button Style="{StaticResource MyBtnStyle}" Content="推迟提醒" Click="DelayButton_Click"/>
</hc:UniformSpacingPanel>
<Button Click="BacklogDone_Click" Content="朕已阅" Margin="10,0,10,20" Width="298" VerticalAlignment="Bottom"/>
<Button Style="{StaticResource MyBtnStyle}" Click="BacklogDone_Click" Content="朕已阅" Margin="10,0,10,20" Width="298" VerticalAlignment="Bottom"/>
</Grid>
</Border>

View File

@@ -62,7 +62,7 @@ namespace GeekDesk.Control.Other
}
ToDoTask.activityBacklog[info].Close(); //关闭桌面通知
ToDoTask.activityBacklog.Remove(info);//激活任务删除
CommonCode.SaveAppData(appData);
CommonCode.SaveAppData(appData, Constants.DATA_FILE_PATH);
}

View File

@@ -23,7 +23,7 @@
<TextBlock Text="SVG 图标地址:" Style="{StaticResource LeftTB}"/>
<TextBlock Text="*" Foreground="Red"/>
</WrapPanel>
<TextBox x:Name="IconUrl" Text="{Binding CustomIconUrl, Mode=OneWay}" Width="240" FontSize="14"/>
<TextBox x:Name="IconUrl" Style="{StaticResource MyTextBoxStyle}" Text="{Binding CustomIconUrl, Mode=OneWay}" Width="240" FontSize="14"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="0,58.276,0,-58.276">
@@ -31,18 +31,18 @@
<TextBlock Text="JSON 配置地址:" Style="{StaticResource LeftTB}"/>
<TextBlock Text="*" Foreground="Red"/>
</WrapPanel>
<TextBox x:Name="JsonUrl" Text="{Binding CustomIconJsonUrl, Mode=OneWay}" Width="240" FontSize="14"/>
<TextBox x:Name="JsonUrl" Style="{StaticResource MyTextBoxStyle}" Text="{Binding CustomIconJsonUrl, Mode=OneWay}" Width="240" FontSize="14"/>
</hc:UniformSpacingPanel>
<TextBlock Text="注: 需配置正确的url方可加载远程图标!" Foreground="Red" Margin="10,95,-10,-92" />
<hc:UniformSpacingPanel Spacing="10" Margin="203,125,-203,-125">
<Button Content="取消" Command="hc:ControlCommands.Close" HorizontalAlignment="Stretch" Margin="-1,1,1,1" VerticalAlignment="Stretch"
<Button Style="{StaticResource MyBtnStyle}" Content="取消" Command="hc:ControlCommands.Close" HorizontalAlignment="Stretch" Margin="-1,1,1,1" VerticalAlignment="Stretch"
/>
<Button Content="教程" Click="Teach_Click"
Style="{StaticResource Btn1}"/>
Style="{StaticResource MyBtnStyle}"/>
<Button Content="保存" Click="Confirm_Click"
Command="hc:ControlCommands.Close"
Style="{StaticResource Btn1}"/>
Style="{StaticResource MyBtnStyle}"/>
</hc:UniformSpacingPanel>
</Grid>
<!--<Button Width="22" Height="22" Command="hc:ControlCommands.Close" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,4,4,0"/>-->

View File

@@ -0,0 +1,54 @@
<Border x:Class="GeekDesk.Control.Other.GlobalMsgNotification"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
BorderThickness="0"
Style="{StaticResource BorderBG}"
Margin="15"
BorderBrush="{DynamicResource BorderBrush}"
Width="320"
Height="400">
<Border.Background>
<SolidColorBrush Color="AliceBlue" Opacity="0.96"/>
</Border.Background>
<Grid>
<StackPanel>
<Image Source="/Resource/Image/BacklogImg.png" Width="260" Margin="0,20,0,0"/>
<hc:Card Width="260" Height="220" BorderThickness="0" Effect="{DynamicResource EffectShadow2}" Margin="0,20,0,0">
<Border CornerRadius="4,4,0,0" Height="160" Padding="10,0,10,0">
<ScrollViewer>
<TextBlock TextOptions.TextFormattingMode="Display"
TextOptions.TextHintingMode="Animated"
UseLayoutRounding="True"
TextWrapping="Wrap"
FontStyle="Normal"
FontSize="15"
LineHeight="22"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Text="{Binding Msg}"/>
</ScrollViewer>
</Border>
<!--<hc:Card.Footer>
<StackPanel Margin="10" Width="160">
<TextBlock TextWrapping="NoWrap" FontSize="20" Style="{DynamicResource TextBlockLargeBold}" TextTrimming="CharacterEllipsis"
Text="{Binding Title}"
HorizontalAlignment="Left"/>
<TextBlock TextWrapping="NoWrap" Style="{DynamicResource TextBlockDefault}" TextTrimming="CharacterEllipsis"
Margin="0,6,0,0"
HorizontalAlignment="Left"/>
</StackPanel>
</hc:Card.Footer>-->
</hc:Card>
</StackPanel>
<Button Style="{StaticResource MyBtnStyle}" Click="Close_Click" Content="朕已阅" Margin="10,0,10,20" Width="298" VerticalAlignment="Bottom"/>
</Grid>
</Border>

View File

@@ -0,0 +1,61 @@
using GeekDesk.Constant;
using GeekDesk.Task;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using HandyControl.Controls;
using Quartz;
using System;
using System.Windows;
using System.Windows.Input;
namespace GeekDesk.Control.Other
{
/// <summary>
/// BacklogNotificatin.xaml 的交互逻辑
/// </summary>
public partial class GlobalMsgNotification
{
public Notification ntf;
public GlobalMsgNotification(DialogMsg msg)
{
InitializeComponent();
this.DataContext = msg;
}
public class DialogMsg
{
public string msg;
public string title;
public string Msg
{
get
{
return msg;
}
set
{
msg = value;
}
}
public string Title
{
get
{
return title;
}
set
{
title = value;
}
}
}
private void Close_Click(object sender, RoutedEventArgs e)
{
ntf.Close();
}
}
}

View File

@@ -20,19 +20,27 @@
Width="600"
Height="400"
Margin="0,-620,0,0">
<Border Style="{StaticResource BorderBG}">
<Grid>
<TextBlock Text="提示: 右键点击可以删除自定义的背景颜色哦" Foreground="Gray" HorizontalAlignment="Center" Margin="0,5,0,0"/>
<ListBox x:Name="GradientBGs"
ItemsSource="{Binding}"
Background="Transparent"
Margin="20,20,20,50"
BorderThickness="0"
>
<ListBox.Resources>
<ContextMenu x:Key="CMDialog" Width="200">
<MenuItem Header="删除" Click="Delete" Tag="{Binding}"/>
</ContextMenu>
</ListBox.Resources>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="ContextMenu" Value="{StaticResource CMDialog}"/>
<Setter Property="Margin" Value="10"/>
<Setter Property="Effect" Value="{StaticResource EffectShadow2}"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemsPanel>
@@ -40,6 +48,7 @@
<WrapPanel Background="Transparent"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Border CornerRadius="4" Width="100" Height="100"
@@ -63,7 +72,7 @@
</ListBox>
<hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4">
<Button Content="关闭" Style="{StaticResource Btn1}" Click="Close_Click" HorizontalAlignment="Stretch" Margin="524,360,-524,10" VerticalAlignment="Stretch"/>
<Button Content="关闭" Style="{StaticResource MyBtnStyle}" Click="Close_Click" HorizontalAlignment="Stretch" Margin="524,360,-524,10" VerticalAlignment="Stretch"/>
</hc:UniformSpacingPanel>
</Grid>
</Border>

View File

@@ -1,6 +1,8 @@
using GeekDesk.Util;
using GeekDesk.ViewModel;
using GeekDesk.ViewModel.Temp;
using System;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
@@ -16,7 +18,13 @@ namespace GeekDesk.Control.Other
public GradientBGDialog()
{
this.DataContext = GradientBGParamList.GradientBGParams;
ObservableCollection<GradientBGParam> bgArr = DeepCopyUtil.DeepCopy(GradientBGParamList.GradientBGParams);
foreach(var bg in MainWindow.appData.AppConfig.CustomBGParams)
{
bgArr.Add(bg);
}
this.DataContext = DeepCopyUtil.DeepCopy(bgArr);
InitializeComponent();
}
@@ -45,8 +53,38 @@ namespace GeekDesk.Control.Other
}
}
private void Delete(object sender, RoutedEventArgs e)
{
HandyControl.Controls.Growl.Ask("确认删除吗?", isConfirmed =>
{
if (isConfirmed)
{
GradientBGParam bg = (GradientBGParam)(((MenuItem)sender).Tag);
ObservableCollection<GradientBGParam> bgArr = (ObservableCollection<GradientBGParam>)this.DataContext;
bgArr.Remove(bg);
MainWindow.appData.AppConfig.CustomBGParams.Remove(bg);
for (int i = MainWindow.appData.AppConfig.CustomBGParams.Count - 1; i >= 0; i--)
{
var cbg = MainWindow.appData.AppConfig.CustomBGParams[i];
if (cbg.Id == null)
{
if (cbg.Color1.Equals(bg.Color1) && cbg.Color2.Equals(bg.Color2))
{
MainWindow.appData.AppConfig.CustomBGParams.RemoveAt(i);
}
} else
{
if (cbg.Id.Equals(bg.Id))
{
MainWindow.appData.AppConfig.CustomBGParams.RemoveAt(i);
}
}
}
MainWindow.appData.AppConfig.CustomBGParams = DeepCopyUtil.DeepCopy(MainWindow.appData.AppConfig.CustomBGParams);
}
return true;
}, "ConfigWindowAskGrowl");
}
}
}

View File

@@ -2,6 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:cvt="clr-namespace:GeekDesk.Converts"
CornerRadius="4"
Width="350"
Height="450"
@@ -10,44 +11,48 @@
<Border.Resources>
<Style x:Key="LeftTB" TargetType="TextBlock" BasedOn="{StaticResource TextBlockBaseStyle}">
<Setter Property="Width" Value="75"/>
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="TextAlignment" Value="Left"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="0,8,0,0"/>
<Setter Property="Margin" Value="5,8,0,0"/>
<Setter Property="FontSize" Value="14"/>
</Style>
<cvt:StringAppendConvert x:Key="StringAppendConvert"/>
</Border.Resources>
<hc:SimplePanel Margin="10" VerticalAlignment="Center">
<StackPanel>
<Button Width="22" Height="22" Command="hc:ControlCommands.Close" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top"/>
<hc:UniformSpacingPanel Spacing="10">
<hc:UniformSpacingPanel Spacing="10" Margin="0,15,0,0">
<TextBlock Text="名称:" Style="{StaticResource LeftTB}"/>
<TextBox x:Name="IconName" Text="{Binding Name, Mode=OneWay}" Width="230" FontSize="14"/>
<TextBox x:Name="IconName" Style="{StaticResource MyTextBoxStyle}" Text="{Binding Name, Mode=OneWay}" Width="230" FontSize="14"/>
</hc:UniformSpacingPanel>
<hc:Divider LineStrokeDashArray="3,3" LineStroke="Black"/>
<hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4">
<hc:UniformSpacingPanel Spacing="10" Margin="0,15,0,0">
<TextBlock Text="相对路径:" Style="{StaticResource LeftTB}"/>
<TextBlock Text="{Binding RelativePath, Mode=OneWay}"
VerticalAlignment="Center"
Margin="0,8,0,0"
Width="230"
FontSize="14"
TextTrimming="WordEllipsis"
hc:Poptip.Placement="Bottom"
hc:Poptip.Content="{Binding RelativePath, Mode=OneWay, Converter={StaticResource StringAppendConvert}, ConverterParameter='\{\}\\\n(同盘符下才会建立相对路径)'}"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4" Margin="0,15,0,0">
<TextBlock Text="图标:" Style="{StaticResource LeftTB}"/>
<Image x:Name="IconImg" Source="{Binding BitmapImage, Mode=OneWay}" RenderOptions.BitmapScalingMode="HighQuality" Width="60" Height="60"/>
<Button Content="修改" Click="EditImage"/>
<Button Content="重置" Click="ReStoreImage"/>
<Button Style="{StaticResource MyBtnStyle}" Content="修改" Click="EditImage"/>
<Button Style="{StaticResource MyBtnStyle}" Content="重置" Click="ReStoreImage"/>
</hc:UniformSpacingPanel>
<hc:Divider LineStrokeDashArray="3,3" LineStroke="Black" Grid.ColumnSpan="4"/>
<hc:UniformSpacingPanel Spacing="10">
<CheckBox x:Name="IconIsAdmin" Content="始终以管理员方式启动" IsChecked="{Binding AdminStartUp, Mode=OneWay}">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
<hc:UniformSpacingPanel Spacing="10" Margin="4,15,0,0">
<CheckBox x:Name="IconIsAdmin" Style="{StaticResource MyCheckBoxStyle}"
Content="始终以管理员方式启动" IsChecked="{Binding AdminStartUp, Mode=OneWay}"/>
</hc:UniformSpacingPanel>
<hc:Divider LineStrokeDashArray="3,3" LineStroke="Black" Grid.ColumnSpan="4"/>
<hc:UniformSpacingPanel Spacing="10">
<hc:UniformSpacingPanel Spacing="10" Margin="0,15,0,0">
<TextBlock Text="启动参数:" Style="{StaticResource LeftTB}"/>
<TextBox x:Name="StartArg" Text="{Binding StartArg, Mode=OneWay}" Width="230" Height="100" TextWrapping="Wrap" FontSize="14"/>
<TextBox x:Name="StartArg" Style="{StaticResource MyTextBoxStyle}" Text="{Binding StartArg, Mode=OneWay}" Width="230" Height="100" TextWrapping="Wrap" FontSize="14"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4">
<Button Content="保存" Style="{StaticResource Btn1}" Click="SaveProperty" Margin="265,10,0,0"/>
<hc:UniformSpacingPanel Margin="0,25,0,0" Spacing="10" Grid.ColumnSpan="4">
<Button Content="保存" Style="{StaticResource MyBtnStyle}" Click="SaveProperty" Margin="265,10,0,0"/>
</hc:UniformSpacingPanel>
</StackPanel>
</hc:SimplePanel>

View File

@@ -1,4 +1,5 @@
using GeekDesk.Util;
using GeekDesk.Constant;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using Microsoft.Win32;
using System;
@@ -38,7 +39,7 @@ namespace GeekDesk.Control.Other
info.Name = IconName.Text;
info.AdminStartUp = IconIsAdmin.IsChecked.Value;
info.StartArg = StartArg.Text;
CommonCode.SaveAppData(MainWindow.appData);
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
dialog.Close();
}
@@ -51,7 +52,7 @@ namespace GeekDesk.Control.Other
{
IconInfo info = this.DataContext as IconInfo;
info.BitmapImage = ImageUtil.ByteArrToImage(info.DefaultImage);
CommonCode.SaveAppData(MainWindow.appData);
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
}
/// <summary>
@@ -72,7 +73,7 @@ namespace GeekDesk.Control.Other
{
IconInfo info = this.DataContext as IconInfo;
info.BitmapImage = ImageUtil.GetBitmapIconByPath(ofd.FileName);
CommonCode.SaveAppData(MainWindow.appData);
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
}
}
catch (Exception e1)

View File

@@ -23,23 +23,23 @@
<hc:UniformSpacingPanel Spacing="10" VerticalAlignment="Center">
<TextBlock Text="名称:" Style="{StaticResource LeftTB}"/>
<TextBox x:Name="IconName" Text="{Binding Name, Mode=OneWay}" Width="180" FontSize="14"/>
<TextBox x:Name="IconName" Style="{StaticResource MyTextBoxStyle}" Text="{Binding Name, Mode=OneWay}" Width="180" FontSize="14"/>
</hc:UniformSpacingPanel>
<hc:Divider LineStrokeDashArray="3,3" LineStroke="Black"/>
<hc:UniformSpacingPanel Spacing="10" VerticalAlignment="Center">
<TextBlock Text="Url:" Style="{StaticResource LeftTB}"/>
<TextBox x:Name="IconUrl" Text="{Binding Path, Mode=OneWay}" Width="180" FontSize="14"/>
<TextBox x:Name="IconUrl" Style="{StaticResource MyTextBoxStyle}" Text="{Binding Path, Mode=OneWay}" Width="180" FontSize="14"/>
</hc:UniformSpacingPanel>
<hc:Divider LineStrokeDashArray="3,3" LineStroke="Black"/>
<hc:UniformSpacingPanel Spacing="10" VerticalAlignment="Center">
<TextBlock Text="图标:" Style="{StaticResource LeftTB}"/>
<Image x:Name="IconImg" Source="{Binding BitmapImage, Mode=OneWay}" RenderOptions.BitmapScalingMode="HighQuality" Width="60" Height="60"/>
<Button Content="修改" Click="EditImage"/>
<Button Content="重置" Click="ReStoreImage"/>
<Button Style="{StaticResource MyBtnStyle}" Content="修改" Click="EditImage"/>
<Button Style="{StaticResource MyBtnStyle}" Content="重置" Click="ReStoreImage"/>
</hc:UniformSpacingPanel>
<hc:Divider LineStrokeDashArray="3,3" LineStroke="Black"/>
<hc:UniformSpacingPanel Spacing="10">
<Button Content="保存" Click="SaveProperty" Style="{StaticResource Btn1}" Margin="224,-10,-224,0" />
<Button Content="保存" Click="SaveProperty" Style="{StaticResource MyBtnStyle}" Margin="224,-10,-224,0" />
</hc:UniformSpacingPanel>
</StackPanel>
</hc:SimplePanel>

View File

@@ -52,7 +52,7 @@ namespace GeekDesk.Control.Other
{
MainWindow.appData.MenuList[MainWindow.appData.AppConfig.SelectedMenuIndex].IconList.Add(info);
}
CommonCode.SaveAppData(MainWindow.appData);
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
dialog.Close();
}
@@ -65,7 +65,7 @@ namespace GeekDesk.Control.Other
{
IconInfo info = this.DataContext as IconInfo;
info.BitmapImage = ImageUtil.ByteArrToImage(info.DefaultImage);
CommonCode.SaveAppData(MainWindow.appData);
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
}
/// <summary>
@@ -86,7 +86,7 @@ namespace GeekDesk.Control.Other
{
IconInfo info = this.DataContext as IconInfo;
info.BitmapImage = ImageUtil.GetBitmapIconByPath(ofd.FileName);
CommonCode.SaveAppData(MainWindow.appData);
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
}
}
catch (Exception ex)

View File

@@ -1,4 +1,5 @@
using GeekDesk.Control.Windows;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using System;
using System.Reflection;
@@ -64,14 +65,15 @@ namespace GeekDesk.Control.Other
private void MyColorPicker_SelectedColorChanged(object sender, HandyControl.Data.FunctionEventArgs<Color> e)
{
SolidColorBrush scb = MyColorPicker.SelectedBrush;
Color c = scb.Color;
switch (colorType)
{
case ColorType.COLOR_1:
appConfig.GradientBGParam.Color1 = scb.ToString(); break;
appConfig.GradientBGParam.Color1 = string.Format("#{0:X2}{1:X2}{2:X2}", c.R, c.G, c.B); break;
case ColorType.COLOR_2:
appConfig.GradientBGParam.Color2 = scb.ToString(); break;
appConfig.GradientBGParam.Color2 = string.Format("#{0:X2}{1:X2}{2:X2}", c.R, c.G, c.B); break;
default:
appConfig.TextColor = scb.ToString(); break;
appConfig.TextColor = string.Format("#{0:X2}{1:X2}{2:X2}", c.R, c.G, c.B); break;
}
}

View File

@@ -0,0 +1,75 @@
<Border x:Class="GeekDesk.Control.Other.PasswordDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
CornerRadius="6"
Width="300"
Height="150"
BorderThickness="0"
>
<Border.Resources>
<Style x:Key="PassBox" TargetType="PasswordBox" BasedOn="{StaticResource PasswordBoxBaseStyle}">
<Setter Property="Height" Value="40"/>
<Setter Property="Width" Value="40"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="Focusable" Value="True"/>
<Setter Property="MaxLength" Value="1"/>
<EventSetter Event="PasswordChanged" Handler="PasswordBox_PasswordChanged"/>
<EventSetter Event="PreviewKeyDown" Handler="PasswordBox_KeyDown"/>
</Style>
<Style x:Key="NextTB" TargetType="TextBlock">
<Setter Property="Foreground" Value="#408CCB"/>
<Setter Property="TextDecorations" Value="Underline"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</Border.Resources>
<Border.Background>
<SolidColorBrush Color="White" Opacity="0.7"/>
</Border.Background>
<StackPanel VerticalAlignment="Center">
<hc:UniformSpacingPanel Spacing="10" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock x:Name="Title" Text="请输入密码"
FontSize="15"/>
</hc:UniformSpacingPanel>
<Grid Height="65" x:Name="PasswordGrid" Visibility="Visible" xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndGrowHorizontally}, Event=Visibility}">
<TextBlock x:Name="HintMsg"
Visibility="Hidden"
VerticalAlignment="Top"
HorizontalAlignment="Center"
Width="250"
TextAlignment="Center"
Margin="0,3,0,0"
Text="提示:"
hc:Poptip.Content="{Binding ElementName=HintMsg, Path=Text}"
Foreground="Gray"/>
<hc:UniformSpacingPanel Margin="0,20,0,0" Spacing="10" VerticalAlignment="Center" HorizontalAlignment="Center">
<PasswordBox x:Name="P1" Tag="P1" Style="{StaticResource PassBox}"/>
<PasswordBox x:Name="P2" Tag="P2" Style="{StaticResource PassBox}"/>
<PasswordBox x:Name="P3" Tag="P3" Style="{StaticResource PassBox}"/>
<PasswordBox x:Name="P4" Tag="P4" Style="{StaticResource PassBox}"/>
</hc:UniformSpacingPanel>
<TextBlock HorizontalAlignment="Right"
x:Name="ErrorMsg"
Margin="0,65,37,-65"
Foreground="Red"
Text="密码输入错误"
Visibility="Visible"/>
</Grid>
<Grid Height="65" x:Name="HintGrid" Visibility="Collapsed" Margin="0,20,0,0" xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeIn}, Event=Visibility}">
<hc:UniformSpacingPanel Spacing="10" VerticalAlignment="Top" HorizontalAlignment="Center">
<hc:TextBox Style="{StaticResource MyTextBoxStyle}" x:Name="HintBox" TextAlignment="Left" Width="220"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="202,35,0,0" VerticalAlignment="Top" HorizontalAlignment="Left">
<TextBlock Text="跳过" MouseLeftButtonDown="NextTB_MouseLeftButtonDown" Style="{StaticResource NextTB}"/>
<TextBlock Text="完成" MouseLeftButtonDown="DoneTB_MouseLeftButtonDown" Style="{StaticResource NextTB}"/>
</hc:UniformSpacingPanel>
</Grid>
</StackPanel>
</Border>

View File

@@ -0,0 +1,289 @@
using GeekDesk.Constant;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using Microsoft.Win32;
using System;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media.Imaging;
using System.Windows.Threading;
namespace GeekDesk.Control.Other
{
/// <summary>
/// TextDialog.xaml 的交互逻辑
/// </summary>
public partial class PasswordDialog
{
private AppData appData = MainWindow.appData;
public PasswordType type;
public MenuInfo menuInfo;
public int count = 0;
private string tempPassword = null;
private PasswordType tempType;
public PasswordDialog()
{
InitializeComponent();
}
private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e)
{
PasswordBox pb = sender as PasswordBox;
if (!string.IsNullOrEmpty(pb.Password))
{
char c = pb.Password.ToCharArray()[0];
if (c > '9' || c < '0')
{
pb.Password = "";
return;
}
}
string tag = pb.Tag.ToString();
switch (tag)
{
case "P1":
if (!string.IsNullOrEmpty(pb.Password))
{
P2.Focus();
}
break;
case "P2":
if (!string.IsNullOrEmpty(pb.Password))
{
P3.Focus();
}
break;
case "P3":
if (!string.IsNullOrEmpty(pb.Password))
{
P4.Focus();
}
break;
case "P4":
if (string.IsNullOrEmpty(pb.Password))
{
P3.Focus();
}
break;
}
if (!string.IsNullOrEmpty(P1.Password)
&& !string.IsNullOrEmpty(P2.Password)
&& !string.IsNullOrEmpty(P3.Password)
&& !string.IsNullOrEmpty(P4.Password))
{
string pw = P1.Password
+ P2.Password
+ P3.Password
+ P4.Password;
pw = MD5Util.CreateMD5(pw);
if (type == PasswordType.INPUT || type == PasswordType.CANCEL)
{
if (pw.Equals(appData.AppConfig.MenuPassword))
{
//隐藏弹框
MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Collapsed;
//赋值
MainWindow.appData.AppConfig.SelectedMenuIcons
= appData.MenuList[
MainWindow.mainWindow.LeftCard.MenuListBox.SelectedIndex
].IconList;
//显示数据托盘
MainWindow.mainWindow.RightCard.WrapUFG.Visibility = Visibility.Visible;
//取消加密操作
if (type == PasswordType.CANCEL)
{
menuInfo.IsEncrypt = false;
}
} else
{
//密码比对不一致
ErrorMsg.Text = "密码输入错误";
ErrorMsg.Visibility = Visibility.Visible;
if (!string.IsNullOrEmpty(appData.AppConfig.PasswordHint))
{
//显示提示信息
HintMsg.Text = "提示: " + appData.AppConfig.PasswordHint;
HintMsg.Visibility = Visibility.Visible;
}
}
} else if (type == PasswordType.CREATE)
{
//创建密码
if (count == 0)
{
count++;
tempPassword = pw;
Title.Text = "再次输入密码";
ClearVal();
SetFocus(0);
} else
{
if (tempPassword.Equals(pw))
{
//两次密码设置一致 显示提示输入框
Title.Text = "填写密码提示";
PasswordGrid.Visibility = Visibility.Collapsed;
HintGrid.Visibility = Visibility.Visible;
HintBox.Focus();
} else
{
ErrorMsg.Text = "两次密码输入不一致";
ErrorMsg.Visibility = Visibility.Visible;
}
}
} else if (type == PasswordType.ALTER)
{
//修改密码
if (appData.AppConfig.MenuPassword.Equals(pw))
{
tempType = type;
type = PasswordType.CREATE;
Title.Text = "设置新密码";
ClearVal();
SetFocus(0);
} else
{
//密码比对不一致
ErrorMsg.Text = "密码输入错误";
ErrorMsg.Visibility = Visibility.Visible;
HintMsg.Text = MainWindow.appData.AppConfig.PasswordHint;
HintMsg.Visibility = Visibility.Visible;
}
}
} else
{
//密码未输入完全 隐藏错误信息
if (ErrorMsg.IsVisible)
{
ErrorMsg.Visibility = Visibility.Hidden;
HintMsg.Visibility = Visibility.Hidden;
HintMsg.Visibility = Visibility.Hidden;
}
}
}
public void SetFocus(int time = 100)
{
new Thread(() =>
{
Thread.Sleep(time);
try
{
Dispatcher.Invoke(() =>
{
try
{
if (string.IsNullOrEmpty(P1.Password))
{
P1.Focus();
return;
}
if (string.IsNullOrEmpty(P2.Password))
{
P2.Focus();
return;
}
if (string.IsNullOrEmpty(P3.Password))
{
P3.Focus();
return;
}
P4.Focus();
}
catch (Exception ex) { }
});
}
catch (Exception e2) { }
}).Start();
}
public void ClearVal()
{
P1.Clear();
P2.Clear();
P3.Clear();
P4.Clear();
}
/// <summary>
/// 跳过设置密码提示
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void NextTB_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
appData.AppConfig.PasswordHint = "";
DonePassword();
}
private void DoneTB_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
string hint = HintBox.Text.Trim();
appData.AppConfig.PasswordHint = hint;
DonePassword();
}
private void DonePassword()
{
appData.AppConfig.MenuPassword = tempPassword;
CommonCode.SavePassword(tempPassword);
MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Collapsed;
PasswordGrid.Visibility = Visibility.Visible;
HintGrid.Visibility = Visibility.Collapsed;
if (tempType == PasswordType.ALTER)
{
HandyControl.Controls.Growl.Success("密码修改成功!", "MainWindowGrowl");
} else
{
menuInfo.IsEncrypt = true;
HandyControl.Controls.Growl.Success(menuInfo.MenuName + " 已加密!", "MainWindowGrowl");
}
}
private void PasswordBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Back)
{
if (P2.IsKeyboardFocused)
{
if (string.IsNullOrEmpty(P2.Password))
{
P1.Password = "";
} else
{
P2.Password = "";
}
}
if (P3.IsKeyboardFocused)
{
if (string.IsNullOrEmpty(P3.Password))
{
P2.Password = "";
}
else
{
P3.Password = "";
}
}
if (P4.IsKeyboardFocused)
{
if (string.IsNullOrEmpty(P4.Password))
{
P3.Password = "";
}
else
{
P4.Password = "";
}
}
}
SetFocus(0);
}
}
}

View File

@@ -0,0 +1,196 @@
<UserControl x:Class="GeekDesk.Control.Other.SearchResControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:GeekDesk.Control.Other"
xmlns:temp="clr-namespace:GeekDesk.ViewModel.Temp"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:cvt="clr-namespace:GeekDesk.Converts"
xmlns:cst="clr-namespace:GeekDesk.Constant"
xmlns:DraggAnimatedPanel="clr-namespace:DraggAnimatedPanel"
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
xmlns:viewmodel="clr-namespace:GeekDesk.ViewModel"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
>
<UserControl.Resources>
<Style x:Key="SearchListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border>
<Border.Style>
<Style TargetType="Border">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</Border.Style>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ImageStyle" TargetType="Image">
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageWidth, Mode=OneWay}"/>
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageHeight, Mode=OneWay}"/>
<Setter Property="Source" Value="{Binding BitmapImage}"/>
</Style>
<Style x:Key="ImageStyleNoWrite" TargetType="Image">
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageWidth, Mode=OneWay}"/>
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageHeight, Mode=OneWay}"/>
<Setter Property="Source" Value="{Binding BitmapImage_NoWrite}"/>
</Style>
<cvt:OpcityConvert x:Key="OpcityConvert"/>
<cvt:GetWidthByWWConvert x:Key="GetWidthByWWConvert"/>
<cvt:Visibility2BooleanConverter x:Key="Visibility2BooleanConverter"/>
</UserControl.Resources>
<Grid>
<Grid>
<WrapPanel Orientation="Horizontal"
Margin="10"
Panel.ZIndex="1"
>
<UniformGrid x:Name="VerticalUFG"
xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeIn}, Event=Loaded}"
xf:Animations.Secondary="{xf:Animate BasedOn={StaticResource FadeOut}, Event=None}"
xf:Animations.SecondaryBinding="{Binding Visibility,
Converter={StaticResource Visibility2BooleanConverter}, ConverterParameter='reverse',
ElementName=VerticalUFG}"
>
<!--<hc:TransitioningContentControl TransitionMode="Left2RightWithFade">-->
<ListBox VirtualizingPanel.VirtualizationMode="Recycling"
VirtualizingPanel.IsVirtualizing="True"
VirtualizingPanel.IsContainerVirtualizable="True"
VirtualizingPanel.ScrollUnit="Pixel"
ItemsSource="{Binding}"
BorderThickness="0"
Padding="0,10,0,0"
x:Name="SearchListBox"
SelectionChanged="SearchListBox_SelectionChanged"
>
<ListBox.Template>
<ControlTemplate TargetType="ListBox">
<hc:ScrollViewer
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Auto"
IsInertiaEnabled="True"
CanContentScroll="True"
PreviewMouseWheel="VerticalIconList_PreviewMouseWheel"
ScrollChanged="VerticalCard_ScrollChanged"
>
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderBrush}">
<ItemsPresenter/>
</Border>
</hc:ScrollViewer>
</ControlTemplate>
</ListBox.Template>
<ListBox.Background>
<SolidColorBrush Opacity="0"/>
</ListBox.Background>
<ListBox.Resources>
<ContextMenu x:Key="IconDialog" Width="200">
<MenuItem Header="管理员方式运行" Click="IconAdminStart" Tag="{Binding}"/>
<MenuItem Header="打开文件所在位置" Click="ShowInExplore" Tag="{Binding}"/>
<MenuItem Header="资源管理器菜单" Click="SystemContextMenu" Tag="{Binding}"/>
</ContextMenu>
</ListBox.Resources>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem" BasedOn="{StaticResource SearchListBoxItemStyle}">
<Setter Property="ContextMenu" Value="{StaticResource IconDialog}"/>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel
Orientation="Vertical"
Background="#00FFFFFF"
VirtualizationMode="Recycling"
IsVirtualizing="True"
IsContainerVirtualizable="True"
VirtualizingPanel.ScrollUnit="Pixel"
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.WindowWidth, Mode=OneWay,
Converter={StaticResource GetWidthByWWConvert},
ConverterParameter={x:Static cst:WidthTypeEnum.RIGHT_CARD}}"
/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Border CornerRadius="8">
<Border.Style>
<Style TargetType="Border">
<Setter Property="VerticalAlignment" Value="Center"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem }}}"
Value="True">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="White" Opacity="0.68"/>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<WrapPanel Tag="{Binding}"
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.WindowWidth, Mode=OneWay,
Converter={StaticResource GetWidthByWWConvert},
ConverterParameter={x:Static cst:WidthTypeEnum.RIGHT_CARD_HALF}}"
HorizontalAlignment="Left"
VerticalAlignment="Center"
hc:Poptip.HitMode="None"
hc:Poptip.Placement="BottomLeft"
Background="#00FFFFFF"
MouseEnter="SearchIcon_MouseEnter"
MouseLeave="SearchIcon_MouseLeave"
MouseLeftButtonDown="Icon_MouseLeftButtonDown"
MouseLeftButtonUp="Icon_MouseLeftButtonUp"
MouseMove="SearchIcon_MouseMove"
Margin="25,10,0,10"
>
<Image Style="{StaticResource ImageStyleNoWrite}" RenderOptions.BitmapScalingMode="HighQuality"/>
<StackPanel Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.WindowWidth, Mode=OneWay,
Converter={StaticResource GetWidthByWWConvert},
ConverterParameter={x:Static cst:WidthTypeEnum.RIGHT_CARD_HALF_TEXT}}" >
<TextBlock
Margin="10,5,0,0"
MaxHeight="40"
FontSize="13"
TextTrimming="CharacterEllipsis"
TextAlignment="Left"
VerticalAlignment="Center"
Foreground="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.TextColor}"
Text="{Binding Name}"/>
<TextBlock
Margin="10,10,0,0"
MaxHeight="40"
FontSize="11"
TextTrimming="CharacterEllipsis"
TextAlignment="Left"
VerticalAlignment="Center"
Foreground="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.TextColor}"
Text="{Binding Path}"/>
</StackPanel>
</WrapPanel>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<!--</hc:TransitioningContentControl>-->
</UniformGrid>
</WrapPanel>
</Grid>
</Grid>
</UserControl>

View File

@@ -0,0 +1,331 @@
using GeekDesk.Constant;
using GeekDesk.Control.Windows;
using GeekDesk.Plugins.EveryThing;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using GeekDesk.ViewModel.Temp;
using HandyControl.Controls;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
namespace GeekDesk.Control.Other
{
/// <summary>
/// SearchResControl.xaml 的交互逻辑
/// </summary>
public partial class SearchResControl : UserControl
{
public SearchResControl(ObservableCollection<IconInfo> iconList)
{
this.DataContext = iconList;
InitializeComponent();
}
public void SearchListBoxIndexAdd()
{
//控制移动后 鼠标即使在图标上也不显示popup
RunTimeStatus.MOUSE_MOVE_COUNT = 0;
MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = false;
if (SearchListBox.Items.Count > 0)
{
if (SearchListBox.SelectedIndex < SearchListBox.Items.Count - 1)
{
SearchListBox.SelectedIndex += 1;
}
}
}
public void SearchListBoxIndexSub()
{
//控制移动后 鼠标即使在图标上也不显示popup
RunTimeStatus.MOUSE_MOVE_COUNT = 0;
MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = false;
if (SearchListBox.Items.Count > 0)
{
if (SearchListBox.SelectedIndex > 0)
{
SearchListBox.SelectedIndex -= 1;
}
}
}
public void StartupSelectionItem()
{
if (SearchListBox.SelectedItem != null)
{
IconInfo icon = SearchListBox.SelectedItem as IconInfo;
if (icon.AdminStartUp)
{
ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP);
}
else
{
ProcessUtil.StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
}
}
}
private void SearchListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
SearchListBox.ScrollIntoView(SearchListBox.SelectedItem);
}
/// <summary>
/// 查询结果ICON鼠标移动事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SearchIcon_MouseMove(object sender, MouseEventArgs e)
{
//控制首次刷新搜索结果后, 鼠标首次移动后显示popup
RunTimeStatus.MOUSE_MOVE_COUNT++;
//防止移动后不刷新popup content
IconInfo info = (sender as Panel).Tag as IconInfo;
MainWindow.mainWindow.RightCard.MyPoptipContent.Text = info.Content;
MainWindow.mainWindow.RightCard.MyPoptip.VerticalOffset = 30;
if (RunTimeStatus.MOUSE_MOVE_COUNT > 1 && !RunTimeStatus.ICONLIST_MOUSE_WHEEL)
{
MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = true;
}
}
/// <summary>
/// 查询结果 ICON 鼠标进入事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SearchIcon_MouseEnter(object sender, MouseEventArgs e)
{
//显示popup
RunTimeStatus.MOUSE_ENTER_ICON = true;
if (!RunTimeStatus.ICONLIST_MOUSE_WHEEL)
{
new Thread(() =>
{
this.Dispatcher.BeginInvoke(new Action(() =>
{
IconInfo info = (sender as Panel).Tag as IconInfo;
MainWindow.mainWindow.RightCard.MyPoptipContent.Text = info.Content;
MainWindow.mainWindow.RightCard.MyPoptip.VerticalOffset = 30;
Thread.Sleep(100);
if (!RunTimeStatus.ICONLIST_MOUSE_WHEEL && RunTimeStatus.MOUSE_MOVE_COUNT > 1)
{
MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = true;
}
}));
}).Start();
}
}
/// <summary>
/// 查询结果ICON鼠标离开事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SearchIcon_MouseLeave(object sender, MouseEventArgs e)
{
RunTimeStatus.MOUSE_ENTER_ICON = false;
MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = false;
}
/// <summary>
/// 搜索结果icon 列表鼠标滚轮预处理时间
/// 主要使用自定义popup解决卡顿问题解决卡顿问题
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void VerticalIconList_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
{
//控制在滚动时不显示popup 否则会在低GPU性能机器上造成卡顿
MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = false;
if (RunTimeStatus.ICONLIST_MOUSE_WHEEL)
{
RunTimeStatus.MOUSE_WHEEL_WAIT_MS = 500;
}
else
{
RunTimeStatus.ICONLIST_MOUSE_WHEEL = true;
new Thread(() =>
{
while (RunTimeStatus.MOUSE_WHEEL_WAIT_MS > 0)
{
Thread.Sleep(1);
RunTimeStatus.MOUSE_WHEEL_WAIT_MS -= 1;
}
if (RunTimeStatus.MOUSE_ENTER_ICON)
{
this.Dispatcher.BeginInvoke(new Action(() =>
{
MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = true;
}));
}
RunTimeStatus.MOUSE_WHEEL_WAIT_MS = 100;
RunTimeStatus.ICONLIST_MOUSE_WHEEL = false;
}).Start();
}
}
private void Icon_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (MainWindow.appData.AppConfig.DoubleOpen)
{
IconClick(sender, e);
}
}
private void Icon_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
if (!MainWindow.appData.AppConfig.DoubleOpen)
{
IconClick(sender, e);
}
}
/// <summary>
/// 图标点击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void IconClick(object sender, MouseButtonEventArgs e)
{
if (MainWindow.appData.AppConfig.DoubleOpen && e.ClickCount >= 2)
{
IconInfo icon = (IconInfo)((Panel)sender).Tag;
if (icon.AdminStartUp)
{
ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP);
}
else
{
ProcessUtil.StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
}
}
else if (!MainWindow.appData.AppConfig.DoubleOpen && e.ClickCount == 1)
{
IconInfo icon = (IconInfo)((Panel)sender).Tag;
if (icon.AdminStartUp)
{
ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP);
}
else
{
ProcessUtil.StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
}
}
}
private static volatile bool EveryThingRuning = false;
private void VerticalCard_ScrollChanged(object sender, ScrollChangedEventArgs e)
{
if (MainWindow.appData.AppConfig.EnableEveryThing == true && EveryThingUtil.HasNext())
{
HandyControl.Controls.ScrollViewer sv = sender as HandyControl.Controls.ScrollViewer;
if (sv.ExtentHeight - (sv.ActualHeight + sv.VerticalOffset) < 100
&& EveryThingUtil.HasNext()
&& !EveryThingRuning)
{
EveryThingRuning = true;
MainWindow.mainWindow.RightCard.Loading_RightCard.Visibility = Visibility.Visible;
int everyThingCount = Convert.ToInt32(MainWindow.mainWindow.EverythingSearchCount.Text);
ObservableCollection<IconInfo> resList = this.DataContext as ObservableCollection<IconInfo>;
ThreadPool.QueueUserWorkItem(state =>
{
ObservableCollection<IconInfo> searchRes = EveryThingUtil.NextPage();
this.Dispatcher.Invoke(() =>
{
everyThingCount += searchRes.Count;
MainWindow.mainWindow.EverythingSearchCount.Text = Convert.ToString(everyThingCount);
foreach (IconInfo info in searchRes)
{
resList.Add(info);
}
MainWindow.mainWindow.RightCard.Loading_RightCard.Visibility = Visibility.Collapsed;
EveryThingRuning = false;
});
});
}
}
}
/// <summary>
/// 管理员方式启动
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void IconAdminStart(object sender, RoutedEventArgs e)
{
IconInfo icon = (IconInfo)((MenuItem)sender).Tag;
ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP);
}
/// <summary>
/// 打开文件所在位置
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ShowInExplore(object sender, RoutedEventArgs e)
{
IconInfo icon = (IconInfo)((MenuItem)sender).Tag;
ProcessUtil.StartIconApp(icon, IconStartType.SHOW_IN_EXPLORE);
}
private void SystemContextMenu(object sender, RoutedEventArgs e)
{
IconInfo icon = (IconInfo)((MenuItem)sender).Tag;
DirectoryInfo[] folders = new DirectoryInfo[1];
folders[0] = new DirectoryInfo(icon.Path);
ShellContextMenu scm = new ShellContextMenu();
System.Drawing.Point p = System.Windows.Forms.Cursor.Position;
p.X -= 80;
p.Y -= 80;
scm.ShowContextMenu(folders, p);
}
}
}

View File

@@ -4,6 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:cvt="clr-namespace:GeekDesk.Converts"
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
xmlns:local="clr-namespace:GeekDesk.Control.UserControls.PannelCard"
xmlns:hc="https://handyorg.github.io/handycontrol"
mc:Ignorable="d"
@@ -16,7 +17,11 @@
<Grid MouseDown="DragMove">
<hc:SimplePanel Margin="20,50,20,20" >
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Top">
<Image Source="/Resource/Image/About.png" Width="400" Height="100"/>
<Image Source="/Resource/Image/About.png"
Width="400"
Height="100"
xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndContract}, Delay=250}"
/>
<TextBlock x:Name="AppInfo" TextAlignment="Center" Text="Copyright © 2021 GeekDesk V"/>
<hc:UniformSpacingPanel Spacing="5" HorizontalAlignment="Center" Margin="10,10,0,0" VerticalAlignment="Center">
<hc:Shield Subject=".net" Status=">=4.72" Margin="0,0,10,0" Color="#1182c3"/>
@@ -27,23 +32,27 @@
MouseLeave="SC_MouseLeave"
Command="hc:ControlCommands.OpenLink"
CommandParameter="https://github.com/BookerLiu/GeekDesk"
Margin="0,0,10,0" Color="#24292F"/>
Margin="0,0,10,0" Color="#24292F"
/>
<hc:Shield Subject="Gitee" Visibility="Visible" Status="Star"
MouseEnter="SC_MouseEnter"
MouseLeave="SC_MouseLeave"
Command="hc:ControlCommands.OpenLink"
CommandParameter="https://gitee.com/BookerLiu/GeekDesk"
Margin="0,0,10,0" Color="#C71D23"/>
Margin="0,0,10,0" Color="#C71D23"
/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" HorizontalAlignment="Center" Margin="0,5,0,0">
<hc:Shield Subject="公众号" Visibility="Visible" Status="抓几个娃" Margin="0,0,5,0" Color="#04913B">
<hc:Shield x:Name="PublicWeChatPanel" Subject="公众号" Visibility="Visible" Status="抓几个娃" Margin="0,0,5,0" Color="#04913B">
<hc:Poptip.Instance>
<hc:Poptip PlacementType="Top">
<hc:Poptip PlacementType="Top" >
<hc:Poptip.Content>
<Image x:Name="PublicWeChat" Width="150" Height="150" />
</hc:Poptip.Content>
</hc:Poptip>
</hc:Poptip.Instance>
</hc:Shield>
@@ -71,10 +80,10 @@
<!--<hc:UniformSpacingPanel Spacing="10" Visibility="Visible" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,10,0,0">
<TextBlock Text="更新源:" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
Style="{StaticResource RadioButtonIcon}" Content="Gitee"
Style="{StaticResource MyRadioBtnStyle}" Content="Gitee"
IsChecked="{Binding UpdateType, Mode=TwoWay, Converter={StaticResource UpdateTypeConvert}, ConverterParameter=1}"/>
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
Style="{StaticResource RadioButtonIcon}" Content="GitHub"
Style="{StaticResource MyRadioBtnStyle}" Content="GitHub"
IsChecked="{Binding UpdateType, Mode=TwoWay, Converter={StaticResource UpdateTypeConvert}, ConverterParameter=2}"/>
</hc:UniformSpacingPanel>-->
</StackPanel>

View File

@@ -16,6 +16,15 @@ namespace GeekDesk.Control.UserControls.Config
{
InitializeComponent();
AppInfo.Text += ConfigurationManager.AppSettings["Version"];
string showPublicWeChat = ConfigurationManager.AppSettings["ShowPublicWeChat"];
if ("Y".Equals(showPublicWeChat))
{
PublicWeChatPanel.Visibility = Visibility.Visible;
} else
{
PublicWeChatPanel.Visibility = Visibility.Collapsed;
}
PublicWeChat.Source = ImageUtil.Base64ToBitmapImage(Constants.PUBLIC_WE_CHAT_IMG_BASE64);
WeChatCode.Source = ImageUtil.Base64ToBitmapImage(Constants.WE_CHAT_CODE_IMG_BASE64);
ZFBCode.Source = ImageUtil.Base64ToBitmapImage(Constants.ZFB_CODE_IMG_BASE64);

View File

@@ -25,99 +25,72 @@
<TextBlock Text="面板动作设置" VerticalAlignment="Center"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
<CheckBox x:Name="IconIsAdmin" Content="启动时显示主面板" IsChecked="{Binding StartedShowPanel}">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
<CheckBox Style="{StaticResource MyCheckBoxStyle}"
x:Name="IconIsAdmin"
Content="启动时显示主面板" IsChecked="{Binding StartedShowPanel}"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
<CheckBox Content="显示时追随鼠标位置" IsChecked="{Binding FollowMouse}">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
<CheckBox Style="{StaticResource MyCheckBoxStyle}"
Content="显示时追随鼠标位置" IsChecked="{Binding FollowMouse}"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
<CheckBox Content="鼠标中键呼出" Click="MouseMiddle_Changed" IsChecked="{Binding MouseMiddleShow}">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
<CheckBox Style="{StaticResource MyCheckBoxStyle}"
Content="鼠标中键呼出"
Click="MouseMiddle_Changed" IsChecked="{Binding MouseMiddleShow}"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
<CheckBox Content="双击启动" IsChecked="{Binding DoubleOpen}">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
<CheckBox Style="{StaticResource MyCheckBoxStyle}"
Content="双击启动" IsChecked="{Binding DoubleOpen}"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
<CheckBox Content="悬停切换菜单" IsChecked="{Binding HoverMenu}">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
<CheckBox Style="{StaticResource MyCheckBoxStyle}"
Content="悬停切换菜单" IsChecked="{Binding HoverMenu}"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
<CheckBox Content="贴边隐藏" IsChecked="{Binding MarginHide}" Click="MarginHide_Changed">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
<CheckBox Style="{StaticResource MyCheckBoxStyle}"
Content="贴边隐藏" IsChecked="{Binding MarginHide}"
Click="MarginHide_Changed"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
<CheckBox Content="主窗口动画效果" IsChecked="{Binding AppAnimation}" Click="Animation_Checked">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,0" Grid.ColumnSpan="4">
<TextBlock Text="面板关闭方式" VerticalAlignment="Center"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
Style="{StaticResource RadioButtonIcon}" Content="失去焦点后"
<RadioButton Margin="10,0,0,0"
Style="{StaticResource MyRadioBtnStyle}"
Content="失去焦点后"
IsChecked="{Binding AppHideType, Mode=TwoWay, Converter={StaticResource HideTypeConvert}, ConverterParameter=1}"/>
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
Style="{StaticResource RadioButtonIcon}" Content="运行项目后"
<RadioButton Margin="10,0,0,0"
Style="{StaticResource MyRadioBtnStyle}" Content="运行项目后"
IsChecked="{Binding AppHideType, Mode=TwoWay, Converter={StaticResource HideTypeConvert}, ConverterParameter=2}"/>
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
Style="{StaticResource RadioButtonIcon}" Content="手动关闭"
<RadioButton Margin="10,0,0,0"
Style="{StaticResource MyRadioBtnStyle}" Content="手动关闭"
IsChecked="{Binding AppHideType, Mode=TwoWay, Converter={StaticResource HideTypeConvert}, ConverterParameter=3}"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,0" Grid.ColumnSpan="4">
<TextBlock Text="搜索方式" VerticalAlignment="Center"/>
<TextBlock Text="搜索方式"
VerticalAlignment="Center"
/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
Style="{StaticResource RadioButtonIcon}" Content="快捷键"
<RadioButton Margin="10,0,0,0"
hc:Poptip.Content="主面板显示时按下Ctrl+F开始搜索"
hc:Poptip.Placement="Top"
Style="{StaticResource MyRadioBtnStyle}" Content="快捷键"
IsChecked="{Binding SearchType, Mode=TwoWay, Converter={StaticResource SearchTypeConvert}, ConverterParameter=0}"/>
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
Style="{StaticResource RadioButtonIcon}" Content="按键即搜"
<RadioButton Margin="10,0,0,0"
hc:Poptip.Content="主面板显示时按下按键直接搜索"
hc:Poptip.Placement="Top"
Style="{StaticResource MyRadioBtnStyle}" Content="按键即搜"
IsChecked="{Binding SearchType, Mode=TwoWay, Converter={StaticResource SearchTypeConvert}, ConverterParameter=1}"/>
</hc:UniformSpacingPanel>
@@ -127,6 +100,7 @@
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
<TextBlock Text="主面板:" VerticalAlignment="Center" Margin="0,5,0,0" Width="55"/>
<hc:TextBox HorizontalAlignment="Left"
Style="{StaticResource MyTextBoxStyle}"
Tag="{x:Static cst:HotKeyType.Main}"
VerticalAlignment="Top"
IsReadOnly="True"
@@ -137,20 +111,17 @@
KeyUp="HotKeyUp"
InputMethod.IsInputMethodEnabled="False"
/>
<CheckBox Content="启用"
Style="{StaticResource MyCheckBoxStyle}"
Click="EnableHotKey_Click"
Tag="{x:Static cst:HotKeyType.Main}"
IsChecked="{Binding EnableAppHotKey}">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
IsChecked="{Binding EnableAppHotKey}"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
<TextBlock Text="待办任务:" Margin="0,5,0,0" Width="55"/>
<hc:TextBox HorizontalAlignment="Left"
Style="{StaticResource MyTextBoxStyle}"
Tag="{x:Static cst:HotKeyType.ToDo}"
VerticalAlignment="Top"
IsReadOnly="True"
@@ -161,21 +132,18 @@
KeyUp="HotKeyUp"
InputMethod.IsInputMethodEnabled="False"
/>
<CheckBox Content="启用"
Style="{StaticResource MyCheckBoxStyle}"
Click="EnableHotKey_Click"
Tag="{x:Static cst:HotKeyType.ToDo}"
IsChecked="{Binding EnableTodoHotKey}">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
IsChecked="{Binding EnableTodoHotKey}"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
<TextBlock Text="拾色器:" Margin="0,5,0,0" Width="55"/>
<hc:TextBox HorizontalAlignment="Left"
Style="{StaticResource MyTextBoxStyle}"
Tag="{x:Static cst:HotKeyType.ColorPicker}"
VerticalAlignment="Top"
IsReadOnly="True"
@@ -187,15 +155,10 @@
InputMethod.IsInputMethodEnabled="False"
/>
<CheckBox Content="启用"
Style="{StaticResource MyCheckBoxStyle}"
Tag="{x:Static cst:HotKeyType.ColorPicker}"
Click="EnableHotKey_Click"
IsChecked="{Binding EnableColorPickerHotKey}">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
IsChecked="{Binding EnableColorPickerHotKey}"/>
</hc:UniformSpacingPanel>
</StackPanel>
</Grid>

View File

@@ -35,8 +35,6 @@ namespace GeekDesk.Control.UserControls.Config
/// <param name="e"></param>
private void HotKeyDown(object sender, KeyEventArgs e)
{
Console.WriteLine("downKey:" + e.Key.ToString());
lock (this)
{
HotKeyType hkType = (HotKeyType)(sender as TextBox).Tag;
@@ -50,8 +48,6 @@ namespace GeekDesk.Control.UserControls.Config
if (!CheckIsEnable(hkType)) return;
Console.WriteLine("prevKeyTemp:" + prevKeyTemp.ToString());
if (prevKeyTemp == Key.None || prevKeyTemp != downKey)
{
if (hotkeyFinished)
@@ -101,7 +97,6 @@ namespace GeekDesk.Control.UserControls.Config
appConfig.ColorPickerHotkeyModifiers = GetModifierKeys(downKey);
break;
}
Console.WriteLine("进入设置" + downKey.ToString());
prevKeyTemp = downKey;
keysTemp.Add(e);
}
@@ -119,7 +114,10 @@ namespace GeekDesk.Control.UserControls.Config
KeyUtil.KeyProp keyProp = new KeyUtil.KeyProp();
KeyUtil.KeyToChar(downKey, ref keyProp, true);
string downKeyStr = keyProp.character.ToString();
//string downKeyStr = "";
if (keyProp.character == '\x00')
{
downKeyStr = downKey.ToString();
}
switch (hkType)
{
case HotKeyType.Main:
@@ -308,15 +306,6 @@ namespace GeekDesk.Control.UserControls.Config
}
}
private void Animation_Checked(object sender, RoutedEventArgs e)
{
if (MainWindow.mainWindow.Visibility == Visibility.Collapsed)
{
MainWindow.mainWindow.Visibility = Visibility.Visible;
// 执行一下动画 防止太过突兀
MainWindow.FadeStoryBoard(0, (int)CommonEnum.WINDOW_ANIMATION_TIME, Visibility.Collapsed);
}
}
/// <summary>
@@ -326,14 +315,17 @@ namespace GeekDesk.Control.UserControls.Config
/// <param name="e"></param>
private void MouseMiddle_Changed(object sender, RoutedEventArgs e)
{
if (appConfig.MouseMiddleShow)
{
MouseHookThread.MiddleHook();
}
else
{
//if (appConfig.MouseMiddleShow)
//{
// MouseHookThread.MiddleHook();
//}
//else
//{
// MouseHookThread.DisposeMiddle();
//}
MouseHookThread.Dispose();
}
MouseHookThread.Hook();
}
/// <summary>
@@ -350,7 +342,8 @@ namespace GeekDesk.Control.UserControls.Config
if (true == appConfig.EnableAppHotKey)
{
MainWindow.RegisterHotKey(false);
} else
}
else
{
if (MainWindow.hotKeyId != -1)
{

View File

@@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:cvt="clr-namespace:GeekDesk.Converts"
xmlns:local="clr-namespace:GeekDesk.Control.UserControls.PannelCard"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:viewmodel="clr-namespace:GeekDesk.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:AppConfig}"
mc:Ignorable="d"
Background="Transparent"
d:DesignHeight="400" d:DesignWidth="500"
@@ -20,61 +20,71 @@
<StackPanel >
<TextBlock Text="程序设置" />
<hc:UniformSpacingPanel Spacing="10" Margin="20,8,0,0">
<CheckBox x:Name="SelfStartUpBox" Content="开机自启动" IsChecked="{Binding SelfStartUp}" Click="SelfStartUpBox_Click">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
<CheckBox Style="{StaticResource MyCheckBoxStyle}" x:Name="SelfStartUpBox" Content="开机自启动" IsChecked="{Binding SelfStartUp}" Click="SelfStartUpBox_Click"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="20,6,0,0">
<CheckBox Content="性能模式" IsChecked="{Binding PMModel}"
<CheckBox Content="性能模式"
Style="{StaticResource MyCheckBoxStyle}"
IsChecked="{Binding PMModel}"
hc:Poptip.HitMode="None"
hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}"
hc:Poptip.Content="开启性能模式将取消图标动画效果"
hc:Poptip.Placement="TopLeft">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
hc:Poptip.Placement="Top"
/>
</hc:UniformSpacingPanel>
<TextBlock Text="插件" Margin="0,20,0,0"/>
<hc:UniformSpacingPanel Spacing="10" Margin="20,6,0,0">
<CheckBox Content="时钟显秒"
Style="{StaticResource MyCheckBoxStyle}"
Click="ShowSeconds_Click" IsChecked="{Binding SecondsWindow}"
hc:Poptip.HitMode="None"
hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}"
hc:Poptip.Content="仅Win11有效"
hc:Poptip.Placement="Top"
/>
<CheckBox Content="EveryThing搜索"
Style="{StaticResource MyCheckBoxStyle}"
Click="EveryThing_Changed" IsChecked="{Binding EnableEveryThing}"
hc:Poptip.HitMode="None"
hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}"
hc:Poptip.Content="勾选后若弹出用户帐户控制请选择是"
hc:Poptip.Placement="Top"
/>
</hc:UniformSpacingPanel>
<TextBlock Text="排序方式" Margin="0,25,0,0"/>
<hc:UniformSpacingPanel Spacing="10" Margin="20,8,0,0">
<RadioButton x:Name="CustomSort" Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
Style="{StaticResource RadioButtonIcon}" Content="自定义"
<RadioButton x:Name="CustomSort" Margin="10,0,0,0"
Style="{StaticResource MyRadioBtnStyle}" Content="自定义"
Tag="1"
hc:IconElement.Geometry="{StaticResource CustomSort}"
PreviewMouseLeftButtonDown="SortType_PreviewMouseLeftButtonDown"
IsChecked="{Binding IconSortType, Mode=OneWay, Converter={StaticResource SortTypeConvert}, ConverterParameter=1}"/>
<RadioButton x:Name="CountUpSort" Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
<RadioButton x:Name="CountUpSort" Margin="10,0,0,0"
hc:IconElement.Geometry="{StaticResource UpSort}"
Style="{StaticResource RadioButtonIcon}" Content="使用次数"
Style="{StaticResource MyRadioBtnStyle}" Content="使用次数"
Tag="2"
PreviewMouseLeftButtonDown="SortType_PreviewMouseLeftButtonDown"
IsChecked="{Binding IconSortType, Mode=OneWay, Converter={StaticResource SortTypeConvert}, ConverterParameter=2}"/>
<RadioButton x:Name="CountLowSort" Margin="10,0,0,0" Visibility="Collapsed" Background="{DynamicResource SecondaryRegionBrush}"
<RadioButton x:Name="CountLowSort" Margin="10,0,0,0" Visibility="Collapsed"
hc:IconElement.Geometry="{StaticResource LowSort}"
Style="{StaticResource RadioButtonIcon}" Content="使用次数"
Style="{StaticResource MyRadioBtnStyle}" Content="使用次数"
Tag="3"
PreviewMouseLeftButtonDown="SortType_PreviewMouseLeftButtonDown"
IsChecked="{Binding IconSortType, Mode=OneWay, Converter={StaticResource SortTypeConvert}, ConverterParameter=3}"/>
<RadioButton x:Name="NameUpSort" Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
<RadioButton x:Name="NameUpSort" Margin="10,0,0,0"
hc:IconElement.Geometry="{StaticResource UpSort}"
Style="{StaticResource RadioButtonIcon}" Content="名称"
Style="{StaticResource MyRadioBtnStyle}" Content="名称"
Tag="4"
PreviewMouseLeftButtonDown="SortType_PreviewMouseLeftButtonDown"
IsChecked="{Binding IconSortType, Mode=OneWay, Converter={StaticResource SortTypeConvert}, ConverterParameter=4}"/>
<RadioButton x:Name="NameLowSort" Margin="10,0,0,0" Visibility="Collapsed" Background="{DynamicResource SecondaryRegionBrush}"
<RadioButton x:Name="NameLowSort" Margin="10,0,0,0" Visibility="Collapsed"
hc:IconElement.Geometry="{StaticResource LowSort}"
Style="{StaticResource RadioButtonIcon}" Content="名称"
Style="{StaticResource MyRadioBtnStyle}" Content="名称"
Tag="5"
PreviewMouseLeftButtonDown="SortType_PreviewMouseLeftButtonDown"
IsChecked="{Binding IconSortType, Mode=OneWay, Converter={StaticResource SortTypeConvert}, ConverterParameter=5}"/>
@@ -82,17 +92,27 @@
</hc:UniformSpacingPanel>
<TextBlock Text="更新源" Margin="0,25,0,0"/>
<hc:UniformSpacingPanel Spacing="10" Margin="20,8,0,0">
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
Style="{StaticResource RadioButtonIcon}" Content="Gitee"
<RadioButton Margin="10,0,0,0"
Style="{StaticResource MyRadioBtnStyle}" Content="Gitee"
hc:IconElement.Geometry="{StaticResource Gitee}"
Foreground="#B32225"
IsChecked="{Binding UpdateType, Mode=TwoWay, Converter={StaticResource UpdateTypeConvert}, ConverterParameter=1}"/>
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
<RadioButton Margin="10,0,0,0"
hc:IconElement.Geometry="{StaticResource GitHub}"
Style="{StaticResource RadioButtonIcon}" Content="GitHub"
Style="{StaticResource MyRadioBtnStyle}" Content="GitHub"
Foreground="Black"
IsChecked="{Binding UpdateType, Mode=TwoWay, Converter={StaticResource UpdateTypeConvert}, ConverterParameter=2}"/>
</hc:UniformSpacingPanel>
<TextBlock Text="其它" Margin="0,25,0,0"/>
<hc:UniformSpacingPanel Spacing="10" Margin="20,8,0,0">
<Button Content="备份数据"
hc:Poptip.Content="当数据文件损坏时, 以便能够恢复部分数据 (损坏时将有操作提示)"
hc:Poptip.Placement="Top"
hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}"
Style="{StaticResource MyBtnStyle}"
Click="BakDataFile"/>
</hc:UniformSpacingPanel>
</StackPanel>
</hc:SimplePanel>
</Grid>

View File

@@ -1,6 +1,13 @@
using GeekDesk.Constant;
using GeekDesk.MyThread;
using GeekDesk.Plugins.EveryThing;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using ShowSeconds;
using System;
using System.Diagnostics;
using System.IO;
using System.Management;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
@@ -107,5 +114,93 @@ namespace GeekDesk.Control.UserControls.Config
CountLowSort.Visibility = Visibility.Visible;
}
}
private void BakDataFile(object sender, RoutedEventArgs e)
{
CommonCode.BakAppData();
}
private void ShowSeconds_Click(object sender, RoutedEventArgs e)
{
if (MainWindow.appData.AppConfig.SecondsWindow == true)
{
//StartSecondsWindow();
SecondsWindow.ShowWindow();
}
else
{
SecondsWindow.CloseWindow();
//StopSecondsWindow();
}
}
public static void StopSecondsWindow()
{
if (MessageUtil.CheckWindowIsRuning("ShowSeconds_Main_" + Constants.MY_UUID))
{
MessageUtil.SendMsgByWName(
"ShowSeconds_Main_" + Constants.MY_UUID,
"Shutdown"
);
}
}
public static void StartSecondsWindow()
{
try
{
using (var objOS = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem"))
{
foreach (ManagementObject objMgmt in objOS.Get())
{
if (objMgmt.Properties["Caption"].Value != null)
{
string caption = objMgmt.Properties["Caption"].Value.ToString(); ;
LogUtil.WriteLog("获取的系统版本号为:" + caption);
if (caption.Contains("Windows 11"))
{
//找到ShowSeconds插件
FileInfo fi = FileUtil.GetFileByNameWithDir("ShowSeconds.exe", Constants.PLUGINS_PATH);
if (fi == null)
{
HandyControl.Controls.MessageBox.Show("未安装程序插件:ShowSeconds");
}
else
{
//检查是否在运行
if (!MessageUtil.CheckWindowIsRuning("ShowSeconds_Main_" + Constants.MY_UUID))
{
using (Process p = new Process())
{
p.StartInfo.FileName = fi.FullName;
p.StartInfo.WorkingDirectory = fi.FullName.Substring(0, fi.FullName.LastIndexOf("\\"));
p.Start();
}
}
}
}
}
}
}
}
catch (Exception ex) { }
}
/// <summary>
/// EveryThing插件开关
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void EveryThing_Changed(object sender, RoutedEventArgs e)
{
if (MainWindow.appData.AppConfig.EnableEveryThing == true)
{
EveryThingUtil.EnableEveryThing(0);
} else
{
EveryThingUtil.DisableEveryThing(true);
}
}
}
}

View File

@@ -16,6 +16,7 @@
<cvt:BGStyleConvert x:Key="BGStyleConvert"/>
<cvt:StringAppendConvert x:Key="StringAppendConvert"/>
<cvt:Visibility2BooleanConverter x:Key="Visibility2BooleanConverter"/>
<cvt:TextToColorConverter x:Key="TextToColorConverter"/>
</UserControl.Resources>
<Grid>
<Grid Background="Transparent">
@@ -24,11 +25,11 @@
<TextBlock Text="背景风格" VerticalAlignment="Center"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
Style="{StaticResource RadioButtonIcon}" Click="BGStyle_Changed" Content="图 片"
<RadioButton Margin="10,0,0,0"
Style="{StaticResource MyRadioBtnStyle}" Click="BGStyle_Changed" Content="图 片"
IsChecked="{Binding BGStyle, Mode=TwoWay, Converter={StaticResource BGStyleConvert}, ConverterParameter=1}"/>
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
Style="{StaticResource RadioButtonIcon}" Click="BGStyle_Changed" Content="纯 色"
<RadioButton Margin="10,0,0,0"
Style="{StaticResource MyRadioBtnStyle}" Click="BGStyle_Changed" Content="纯 色"
IsChecked="{Binding BGStyle, Mode=TwoWay, Converter={StaticResource BGStyleConvert}, ConverterParameter=2}"/>
</hc:UniformSpacingPanel>
@@ -49,18 +50,12 @@
hc:Poptip.Content="{Binding BacImgName}"
hc:Poptip.Placement="TopLeft"
/>
<Button Content="修改" Click="BGButton_Click"/>
<Button Content="默认" Click="DefaultButton_Click"/>
<Button Content="修改" Style="{StaticResource MyBtnStyle}" Click="BGButton_Click"/>
<Button Content="默认" Style="{StaticResource MyBtnStyle}" Click="DefaultButton_Click"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="20,10,0,0" Grid.ColumnSpan="4">
<CheckBox x:Name="IconIsAdmin" Content="毛玻璃效果" Click="BGStyle_Changed" IsChecked="{Binding BlurEffect}">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
<CheckBox Style="{StaticResource MyCheckBoxStyle}" x:Name="IconIsAdmin" Content="毛玻璃效果" Click="BGStyle_Changed" IsChecked="{Binding BlurEffect}"/>
</hc:UniformSpacingPanel>
</StackPanel>
</hc:TransitioningContentControl>
@@ -76,26 +71,36 @@
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="20,0,0,0" Grid.ColumnSpan="4">
<TextBlock Text="色彩1:" VerticalAlignment="Center" Margin="0,5,0,0"/>
<TextBlock Text="{Binding GradientBGParam.Color1, NotifyOnTargetUpdated=True}"
<Rectangle Width="10" Height="10" Stroke="White" Margin="0,0,0,5" Fill="{Binding Path=GradientBGParam.Color1, Converter={StaticResource TextToColorConverter}}"/>
<TextBlock Text="{Binding GradientBGParam.Color1, NotifyOnTargetUpdated=True, Mode=OneWay}"
TargetUpdated="Color_TargetUpdated"
Width="65"
Margin="0,5,0,0"
VerticalAlignment="Center"
/>
<Button Content="设置" Tag="Color1" Click="ColorButton_Click"/>
<Button Style="{StaticResource MyBtnStyle}"
Content="设置"
Tag="Color1"
Click="ColorButton_Click"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="20,5,0,0" Grid.ColumnSpan="4">
<TextBlock Text="色彩2:" VerticalAlignment="Center" Margin="0,5,0,0"/>
<TextBlock Text="{Binding GradientBGParam.Color2, NotifyOnTargetUpdated=True}"
<Rectangle Width="10" Height="10" Stroke="White" Margin="0,0,0,5" Fill="{Binding Path=GradientBGParam.Color2, Converter={StaticResource TextToColorConverter}}"/>
<TextBlock Text="{Binding GradientBGParam.Color2, NotifyOnTargetUpdated=True, Mode=OneWay}"
TargetUpdated="Color_TargetUpdated"
Width="65"
Margin="0,5,0,0"
VerticalAlignment="Center"
/>
<Button Content="设置" Tag="Color2" Click="ColorButton_Click"/>
</hc:UniformSpacingPanel>
<Button Style="{StaticResource MyBtnStyle}"
Content="设置" Tag="Color2"
Click="ColorButton_Click"
/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel HorizontalAlignment="Center" Spacing="10" Grid.ColumnSpan="4">
<Button Content="系统预设"
Style="{StaticResource MyBtnStyle}"
Margin="0,5,0,0"
hc:Poptip.HitMode="None"
hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}"
@@ -103,6 +108,12 @@
hc:Poptip.Placement="Top"
Click="SysBG_Click"
/>
<Button Content="保存当前颜色到系统预设"
Style="{StaticResource MyBtnStyle}"
Margin="0,5,0,0"
Click="NewBGBtn_Click"
/>
</hc:UniformSpacingPanel>
</StackPanel>
</hc:TransitioningContentControl>
</UniformGrid>
@@ -111,23 +122,28 @@
<hc:Divider LineStrokeDashArray="3,3" Margin="0,0,0,0" Height="20" LineStroke="Black" Grid.ColumnSpan="1"/>
<hc:UniformSpacingPanel Spacing="10" Margin="5,-10,0,0" Grid.ColumnSpan="4">
<CheckBox x:Name="BarIcon" Content="显示托盘图标" IsChecked="{Binding ShowBarIcon}">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
<CheckBox Style="{StaticResource MyCheckBoxStyle}" Content="置于顶层" IsChecked="{Binding AlwaysTopmost}"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="5,5,0,0" Grid.ColumnSpan="4">
<CheckBox Content="显示主面板Logo" IsChecked="{Binding TitleLogoVisible, Mode=TwoWay, Converter={StaticResource Visibility2BooleanConverter}}">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
<hc:UniformSpacingPanel Spacing="10" Margin="5,10,0,0" Grid.ColumnSpan="4">
<CheckBox Style="{StaticResource MyCheckBoxStyle}" Content="主窗口动画" IsChecked="{Binding AppAnimation}" Click="Animation_Checked"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="5,10,0,0" Grid.ColumnSpan="4">
<CheckBox Style="{StaticResource MyCheckBoxStyle}" Content="列表展开动画" IsChecked="{Binding ItemSpradeAnimation}"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="5,10,0,0" Grid.ColumnSpan="4">
<CheckBox Style="{StaticResource MyCheckBoxStyle}" x:Name="BarIcon" Content="显示托盘图标" IsChecked="{Binding ShowBarIcon}"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="5,10,0,0" Grid.ColumnSpan="4">
<CheckBox Style="{StaticResource MyCheckBoxStyle}" Content="显示主面板Logo" IsChecked="{Binding TitleLogoVisible, Mode=TwoWay, Converter={StaticResource Visibility2BooleanConverter}}"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="5,10,0,0" Grid.ColumnSpan="4">
<CheckBox Style="{StaticResource MyCheckBoxStyle}" Content="显示图标标题" IsChecked="{Binding ShowIconTitle, Mode=TwoWay}"/>
</hc:UniformSpacingPanel>
@@ -149,7 +165,7 @@
<hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,0" Grid.ColumnSpan="4">
<TextBlock Text="背景图片不透明度" VerticalAlignment="Center"/>
<TextBlock Text="背景不透明度" VerticalAlignment="Center"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
<hc:PreviewSlider Value="{Binding BgOpacity}"
@@ -164,7 +180,7 @@
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,0" Grid.ColumnSpan="4">
<!--<hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,0" Grid.ColumnSpan="4">
<TextBlock Text="主面板不透明度" VerticalAlignment="Center"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
@@ -177,7 +193,7 @@
<Label Style="{StaticResource LabelPrimary}" Content="{Binding Path=(hc:PreviewSlider.PreviewPosition),RelativeSource={RelativeSource Self}}" ContentStringFormat="#0"/>
</hc:PreviewSlider.PreviewContent>
</hc:PreviewSlider>
</hc:UniformSpacingPanel>
</hc:UniformSpacingPanel>-->
<hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,0" Grid.ColumnSpan="4">
<TextBlock Text="主面板圆角大小" VerticalAlignment="Center"/>
@@ -213,8 +229,9 @@
<hc:Divider LineStrokeDashArray="3,3" LineStroke="Black" Grid.ColumnSpan="4"/>
<hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4">
<TextBlock VerticalAlignment="Center" Text="图标字体颜色:" />
<Rectangle Width="10" Height="10" Stroke="White" Margin="0,0,0,5" Fill="{Binding Path=TextColor, Converter={StaticResource TextToColorConverter}}"/>
<TextBlock VerticalAlignment="Center" Text="{Binding TextColor}" Foreground="{Binding TextColor}" Width="100"/>
<Button Content="选择" Margin="0,-10,0,0" Tag="Text" Click="ColorButton_Click"/>
<Button Style="{StaticResource MyBtnStyle}" Content="选择" Margin="0,-10,0,0" Tag="Text" Click="ColorButton_Click"/>
</hc:UniformSpacingPanel>
</StackPanel>
</Grid>

View File

@@ -49,7 +49,7 @@ namespace GeekDesk.Control.UserControls.Config
OpenFileDialog ofd = new OpenFileDialog
{
Multiselect = false, //只允许选中单个文件
Filter = "图像文件(*.png, *.jpg)|*.png;*.jpg;*.gif"
Filter = "图像文件(*.png, *.jpg, *.gif)|*.png;*.jpg;*.gif"
};
if (ofd.ShowDialog() == true)
{
@@ -157,5 +157,26 @@ namespace GeekDesk.Control.UserControls.Config
GradientBGDialog gbg = new GradientBGDialog();
gbg.dialog = HandyControl.Controls.Dialog.Show(gbg, "ConfigWindowDialog");
}
private void Animation_Checked(object sender, RoutedEventArgs e)
{
if (MainWindow.mainWindow.Visibility == Visibility.Collapsed)
{
appConfig.IsShow = true;
}
appConfig.IsShow = null;
}
/// <summary>
/// 保存当前颜色到系统预设
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void NewBGBtn_Click(object sender, RoutedEventArgs e)
{
BGNmaeDialog dialog = new BGNmaeDialog();
dialog.dialog = HandyControl.Controls.Dialog.Show(dialog, "ConfigWindowDialog");
}
}
}

View File

@@ -6,6 +6,7 @@
xmlns:local="clr-namespace:GeekDesk.Control.UserControls.PannelCard"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:cvt="clr-namespace:GeekDesk.Converts"
xmlns:cst="clr-namespace:GeekDesk.Constant"
xmlns:DraggAnimatedPanel="clr-namespace:DraggAnimatedPanel"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
@@ -18,11 +19,18 @@
<Setter Property="Margin" Value="0,0,0,1"/>
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Opacity="0"/>
<SolidColorBrush Color="Black" Opacity="0.01"/>
</Setter.Value>
</Setter>
<Setter Property="AllowDrop" Value="True"/>
<EventSetter Event="Drop" Handler="Menu_Drop"/>
<EventSetter Event="PreviewDragEnter" Handler="Menu_PreviewDragEnter"/>
<EventSetter Event="PreviewDragLeave" Handler="Menu_PreviewDragLeave"/>
<EventSetter Event="MouseLeave" Handler="Menu_MouseLeave"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<EventSetter Event="MouseEnter" Handler="Menu_MouseEnter"/>
<EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_MouseDown"/>
<EventSetter Event="PreviewMouseRightButtonDown" Handler="ListBoxItem_PreviewMouseRightButtonDown"/>
<!--<EventSetter Event="Unselected" Handler="Lbi_Unselected"/>-->
<Style.Triggers>
<MultiTrigger>
@@ -45,7 +53,11 @@
</BeginStoryboard>
</MultiTrigger.ExitActions>
<MultiTrigger.Setters>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="Black" Opacity="0.01"/>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="Black"/>
</MultiTrigger.Setters>
</MultiTrigger>
@@ -66,22 +78,55 @@
<Setter Property="Foreground" Value="Black"/>
</Trigger>-->
<Trigger Property="IsMouseOver" Value="False">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Background" Value="#00FFFFFF"/>
<Setter Property="Foreground" Value="Black"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="MyPoptipStyle" TargetType="Border">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Background" Value="White"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
<Setter Property="CornerRadius" Value="{StaticResource DefaultCornerRadius}"/>
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
<!--<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="hc:Poptip">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
<ContentPresenter Margin="{TemplateBinding Padding}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>-->
</Style>
<cvt:MenuWidthConvert x:Key="MenuWidthConvert"/>
<cvt:OpcityConvert x:Key="OpcityConvert"/>
<cvt:StringAppendConvert x:Key="StringAppendConvert"/>
</UserControl.Resources>
<Grid Background="Transparent">
<Popup Name="MyPoptip" FlowDirection="LeftToRight"
PopupAnimation="None" Placement="Mouse" IsOpen="False"
AllowsTransparency="True"
>
<Grid Background="Transparent">
<Border Style="{StaticResource MyPoptipStyle}">
<TextBlock Name="MyPoptipContent" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Text="Test" FontSize="14"/>
</Border>
</Grid>
</Popup>
<!--左侧栏-->
<hc:Card x:Name="MyCard"
BorderThickness="1"
Effect="{DynamicResource EffectShadow2}"
Margin="5,0,0,5"
MouseDown="MyCard_MouseDown"
PreviewMouseRightButtonDown="MyCard_PreviewMouseRightButtonDown"
>
<hc:Card.Background>
<SolidColorBrush Color="#FFFFFFFF" hc:GeometryEffect.GeometryEffect="20" Opacity="{Binding AppConfig.CardOpacity, Mode=TwoWay, Converter={StaticResource OpcityConvert}}">
@@ -94,8 +139,11 @@
<hc:Card.ContextMenu>
<ContextMenu Width="200">
<MenuItem Header="新建菜单" Click="CreateMenu"/>
<MenuItem Header="新建关联菜单" Click="CreateLinkMenu"/>
<MenuItem x:Name="AlterPW1" Header="修改密码" Click="AlterPassword"/>
</ContextMenu>
</hc:Card.ContextMenu>
<WrapPanel Orientation="Horizontal">
<ListBox x:Name="MenuListBox"
Padding="2,3,0,2"
@@ -106,11 +154,15 @@
VirtualizingPanel.VirtualizationMode="Recycling"
SelectionChanged="Menu_SelectionChanged"
PreviewMouseWheel="Menu_MouseWheel"
PreviewMouseRightButtonDown="MyCard_PreviewMouseRightButtonDown"
>
<ListBox.Resources>
<ContextMenu x:Key="MenuDialog" Width="200">
<MenuItem Header="新建菜单" Click="CreateMenu"/>
<MenuItem Header="新建关联菜单" Click="CreateLinkMenu"/>
<MenuItem Header="重命名" Click="RenameMenu" Tag="{Binding}"/>
<MenuItem Header="加密此列表" Click="EncryptMenu" Tag="{Binding}"/>
<MenuItem x:Name="AlterPW2" Header="修改密码" Click="AlterPassword"/>
<MenuItem Header="修改图标" Click="EditMenuGeometry" Tag="{Binding}"/>
<MenuItem Header="删除" Click="DeleteMenu" Tag="{Binding}"/>
</ContextMenu>
@@ -133,8 +185,8 @@
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Tag="{Binding}" MouseDown="ListBoxItem_MouseDown">
<TextBox Text="{Binding Path=MenuName, Mode=TwoWay}"
<StackPanel Tag="{Binding}">
<TextBox Style="{StaticResource MyTextBoxStyle}" Text="{Binding Path=MenuName, Mode=TwoWay}"
HorizontalAlignment="Left"
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1},Path=Tag, Mode=TwoWay, Converter={StaticResource MenuWidthConvert}, ConverterParameter=35}"
FontSize="16"
@@ -147,7 +199,11 @@
Padding="2"
BorderThickness="0"
IsVisibleChanged="MenuEditWhenVisibilityChanged"
Visibility="{Binding MenuEdit}"/>
Visibility="{Binding MenuEdit}">
<TextBox.Background>
<SolidColorBrush Color="White" Opacity="0.6" />
</TextBox.Background>
</TextBox>
<StackPanel Orientation="Horizontal"
IsVisibleChanged="MenuWhenVisibilityChanged"
Visibility="{Binding NotMenuEdit}">
@@ -172,4 +228,5 @@
</ListBox>
</WrapPanel>
</hc:Card>
</Grid>
</UserControl>

View File

@@ -1,16 +1,22 @@
using DraggAnimatedPanelExample;
using GeekDesk.Constant;
using GeekDesk.Control.Other;
using GeekDesk.Control.Windows;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using Microsoft.Win32;
using System;
using System.Collections.ObjectModel;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Threading;
using WindowsAPICodePack.Dialogs;
namespace GeekDesk.Control.UserControls.PannelCard
{
@@ -21,16 +27,14 @@ namespace GeekDesk.Control.UserControls.PannelCard
{
private int menuSelectIndexTemp = -1;
private AppData appData = MainWindow.appData;
private SolidColorBrush bac = new SolidColorBrush(Color.FromRgb(236, 236, 236));
private SolidColorBrush bac = new SolidColorBrush(Color.FromRgb(255, 255, 255));
//是否正在修改菜单
private static bool IS_EDIT = false;
public LeftCardControl()
{
InitializeComponent();
bac.Opacity = 0.6;
this.Loaded += (s, e) =>
{
@@ -162,6 +166,8 @@ namespace GeekDesk.Control.UserControls.PannelCard
}
private void Lbi_Selected(object sender, RoutedEventArgs e)
{
try
{
ListBoxItem lbi = sender as ListBoxItem;
@@ -171,6 +177,9 @@ namespace GeekDesk.Control.UserControls.PannelCard
lbi.Background = bac;
lbi.Foreground = fontColor;
}
catch { }
}
private void Lbi_MouseLeave(object sender, MouseEventArgs e)
{
@@ -197,6 +206,77 @@ namespace GeekDesk.Control.UserControls.PannelCard
Lbi_Selected(obj, null);
}
/// <summary>
/// 创建实时文件菜单
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void CreateLinkMenu(object sender, RoutedEventArgs e)
{
try
{
CommonOpenFileDialog dialog = new CommonOpenFileDialog
{
IsFolderPicker = true,
Title = "选择关联文件夹"
};
if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
{
string menuId = System.Guid.NewGuid().ToString();
string path = dialog.FileName;
MenuInfo menuInfo = new MenuInfo
{
MenuName = Path.GetFileNameWithoutExtension(path),
MenuId = menuId,
MenuType = MenuType.LINK,
LinkPath = path,
IsEncrypt = false,
};
appData.MenuList.Add(menuInfo);
MenuListBox.SelectedIndex = appData.MenuList.Count - 1;
appData.AppConfig.SelectedMenuIndex = MenuListBox.SelectedIndex;
appData.AppConfig.SelectedMenuIcons = menuInfo.IconList;
//首次触发不了Selected事件
object obj = MenuListBox.ItemContainerGenerator.ContainerFromIndex(MenuListBox.SelectedIndex);
SetListBoxItemEvent((ListBoxItem)obj);
Lbi_Selected(obj, null);
HandyControl.Controls.Growl.Success("菜单关联成功, 加载列表中, 稍后重新进入此菜单可查看列表!", "MainWindowGrowl");
FileWatcher.LinkMenuWatcher(menuInfo);
new Thread(() =>
{
DirectoryInfo dirInfo = new DirectoryInfo(menuInfo.LinkPath);
FileSystemInfo[] fileInfos = dirInfo.GetFileSystemInfos();
ObservableCollection<IconInfo> iconList = new ObservableCollection<IconInfo>();
foreach (FileSystemInfo fileInfo in fileInfos)
{
IconInfo iconInfo = CommonCode.GetIconInfoByPath_NoWrite(fileInfo.FullName);
iconList.Add(iconInfo);
}
this.Dispatcher.Invoke(() =>
{
menuInfo.IconList = iconList;
//foreach (IconInfo iconInfo in iconList)
//{
// menuInfo.IconList = iconList;
//}
});
}).Start();
}
}
catch (Exception ex)
{
LogUtil.WriteErrorLog(ex, "新建关联菜单失败!");
HandyControl.Controls.Growl.WarningGlobal("新建关联菜单失败!");
}
}
/// <summary>
/// 重命名菜单 将textbox 设置为可见
@@ -205,9 +285,9 @@ namespace GeekDesk.Control.UserControls.PannelCard
/// <param name="e"></param>
private void RenameMenu(object sender, RoutedEventArgs e)
{
RunTimeStatus.IS_MENU_EDIT = true;
MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
menuInfo.MenuEdit = (int)Visibility.Visible;
IS_EDIT = true;
}
/// <summary>
@@ -217,7 +297,26 @@ namespace GeekDesk.Control.UserControls.PannelCard
/// <param name="e"></param>
private void DeleteMenu(object sender, RoutedEventArgs e)
{
MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
if (menuInfo.IconList != null && menuInfo.IconList.Count > 0)
{
HandyControl.Controls.Growl.Ask("确认删除此菜单吗?", isConfirmed =>
{
if (isConfirmed)
{
DeleteMenu(menuInfo);
}
return true;
}, "MainWindowAskGrowl");
} else
{
DeleteMenu(menuInfo);
}
}
private void DeleteMenu(MenuInfo menuInfo)
{
if (appData.MenuList.Count == 1)
{
//如果删除以后没有菜单的话 先创建一个
@@ -275,7 +374,9 @@ namespace GeekDesk.Control.UserControls.PannelCard
menuInfo.MenuName = text;
menuInfo.MenuEdit = Visibility.Collapsed;
}
IS_EDIT = false;
RunTimeStatus.IS_MENU_EDIT = false;
//为了解决无法修改菜单的问题
MainWindow.mainWindow.SearchBox.Focus();
MenuListBox.SelectedIndex = menuSelectIndexTemp;
}
}
@@ -309,6 +410,14 @@ namespace GeekDesk.Control.UserControls.PannelCard
private void Menu_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (RunTimeStatus.IS_MENU_EDIT) return;
if (appData.AppConfig.ItemSpradeAnimation)
{
//是否启用列表展开动画
MainWindow.mainWindow.RightCard.WrapUFG.Visibility = Visibility.Collapsed;
}
//设置对应菜单的图标列表
if (MenuListBox.SelectedIndex == -1)
{
@@ -316,9 +425,23 @@ namespace GeekDesk.Control.UserControls.PannelCard
}
else
{
if (appData.MenuList[MenuListBox.SelectedIndex].IsEncrypt)
{
appData.AppConfig.SelectedMenuIcons = null;
RunTimeStatus.SHOW_MENU_PASSWORDBOX = true;
MainWindow.mainWindow.RightCard.PDDialog.Title.Text = "输入密码";
MainWindow.mainWindow.RightCard.PDDialog.type = PasswordType.INPUT;
MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Visible;
}
else
{
MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Collapsed;
appData.AppConfig.SelectedMenuIcons = appData.MenuList[MenuListBox.SelectedIndex].IconList;
}
}
MainWindow.mainWindow.RightCard.WrapUFG.Visibility = Visibility.Visible;
//App.DoEvents();
}
/// <summary>
@@ -328,7 +451,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
/// <param name="e"></param>
private void Menu_MouseEnter(object sender, MouseEventArgs e)
{
if (appData.AppConfig.HoverMenu && !IS_EDIT)
if (appData.AppConfig.HoverMenu && !RunTimeStatus.IS_MENU_EDIT)
{
Thread t = new Thread(() =>
{
@@ -340,6 +463,10 @@ namespace GeekDesk.Control.UserControls.PannelCard
{
int index = MenuListBox.ItemContainerGenerator.IndexFromContainer(lbi);
MenuListBox.SelectedIndex = index;
if (appData.AppConfig.IconBatch_NoWrite)
{
appData.AppConfig.IconBatch_NoWrite = false;
}
}
});
});
@@ -359,7 +486,36 @@ namespace GeekDesk.Control.UserControls.PannelCard
{
MainWindow.mainWindow.HidedSearchBox();
}
ListBoxItem lbi = sender as ListBoxItem;
MenuInfo mi = lbi.DataContext as MenuInfo;
int index = MenuListBox.Items.IndexOf(mi);
MenuListBox.SelectedIndex = index;
if (appData.AppConfig.IconBatch_NoWrite)
{
appData.AppConfig.IconBatch_NoWrite = false;
MainWindow.mainWindow.RightCard.IconListBox.SelectionMode = SelectionMode.Extended;
}
}
///// <summary>
///// 点击菜单后 隐藏搜索框
///// </summary>
///// <param name="sender"></param>
///// <param name="e"></param>
//private void ListBoxItemPanel_MouseDown(object sender, MouseButtonEventArgs e)
//{
// if (RunTimeStatus.SEARCH_BOX_SHOW)
// {
// MainWindow.mainWindow.HidedSearchBox();
// }
// MenuInfo mi = (sender as StackPanel).Tag as MenuInfo;
// int index = MenuListBox.Items.IndexOf(mi);
// MenuListBox.SelectedIndex = index;
//}
/// <summary>
/// 隐藏搜索框
@@ -376,23 +532,34 @@ namespace GeekDesk.Control.UserControls.PannelCard
private void Menu_MouseWheel(object sender, MouseWheelEventArgs e)
{
if (RunTimeStatus.IS_MENU_EDIT) return;
ScrollViewer scrollViewer = ScrollUtil.FindSimpleVisualChild<ScrollViewer>(MenuListBox);
if (e.Delta < 0)
{
//判断是否到了最底部
if (ScrollUtil.IsBootomScrollView(scrollViewer))
{
int index = MenuListBox.SelectedIndex;
if (index < MenuListBox.Items.Count - 1)
{
index ++;
} else
index++;
}
else
{
index = 0;
}
MenuListBox.SelectedIndex = index;
} else if (e.Delta > 0)
}
}
else if (e.Delta > 0)
{
if (ScrollUtil.IsTopScrollView(scrollViewer))
{
int index = MenuListBox.SelectedIndex;
if (index > 0)
{
index --;
index--;
}
else
{
@@ -401,5 +568,173 @@ namespace GeekDesk.Control.UserControls.PannelCard
MenuListBox.SelectedIndex = index;
}
}
//滚动到选中项
MenuListBox.ScrollIntoView(MenuListBox.SelectedItem);
}
private void Menu_PreviewDragLeave(object sender, DragEventArgs e)
{
MyPoptip.IsOpen = false;
}
private void Menu_PreviewDragEnter(object sender, DragEventArgs e)
{
MenuInfo mi = (sender as ListBoxItem).DataContext as MenuInfo;
MyPoptipContent.Text = "移动至:" + mi.MenuName;
MyPoptip.VerticalOffset = 30;
MyPoptip.IsOpen = true;
}
private void Menu_MouseLeave(object sender, MouseEventArgs e)
{
MyPoptip.IsOpen = false;
}
/// <summary>
/// 拖动移动图标到指定菜单
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Menu_Drop(object sender, DragEventArgs e)
{
MyPoptip.IsOpen = false;
MenuInfo mi = (sender as ListBoxItem).DataContext as MenuInfo;
IconInfo iconInfo = (IconInfo)e.Data.GetData(typeof(IconInfo));
if (iconInfo != null)
{
// 将已有图标移动到该菜单
appData.MenuList[MenuListBox.SelectedIndex].IconList.Remove(iconInfo);
appData.MenuList[MenuListBox.Items.IndexOf(mi)].IconList.Add(iconInfo);
}
else
{
// 直接将新图标移动到该菜单
Array dropObject = (System.Array)e.Data.GetData(DataFormats.FileDrop);
if (dropObject == null) return;
foreach (object obj in dropObject)
{
string path = (string)obj;
iconInfo = CommonCode.GetIconInfoByPath(path);
if (iconInfo == null)
{
LogUtil.WriteErrorLog("添加项目失败,未能获取到项目图标:" + path);
break;
}
appData.MenuList[MenuListBox.Items.IndexOf(mi)].IconList.Add(iconInfo);
}
CommonCode.SortIconList();
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
}
}
private void EncryptMenu(object sender, RoutedEventArgs e)
{
MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
if (menuInfo.IsEncrypt)
{
MainWindow.mainWindow.RightCard.PDDialog.menuInfo = menuInfo;
MainWindow.mainWindow.RightCard.PDDialog.Title.Text = "输入密码";
MainWindow.mainWindow.RightCard.PDDialog.type = PasswordType.CANCEL;
RunTimeStatus.SHOW_MENU_PASSWORDBOX = true;
MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Visible;
//单独设置焦点
MainWindow.mainWindow.RightCard.PDDialog.SetFocus();
}
else
{
if (string.IsNullOrEmpty(appData.AppConfig.MenuPassword))
{
MainWindow.mainWindow.RightCard.PDDialog.menuInfo = menuInfo;
MainWindow.mainWindow.RightCard.PDDialog.Title.Text = "设置新密码";
MainWindow.mainWindow.RightCard.PDDialog.type = PasswordType.CREATE;
RunTimeStatus.SHOW_MENU_PASSWORDBOX = true;
MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Visible;
}
else
{
menuInfo.IsEncrypt = true;
HandyControl.Controls.Growl.Success(menuInfo.MenuName + " 已加密!", "MainWindowGrowl");
}
}
}
private void AlterPassword(object sender, RoutedEventArgs e)
{
MainWindow.mainWindow.RightCard.PDDialog.Title.Text = "输入旧密码";
MainWindow.mainWindow.RightCard.PDDialog.type = PasswordType.ALTER;
MainWindow.mainWindow.RightCard.PDDialog.Visibility = Visibility.Visible;
//单独设置焦点
MainWindow.mainWindow.RightCard.PDDialog.SetFocus();
}
/// <summary>
/// 右键点击进行处理
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MyCard_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
RunTimeStatus.SHOW_RIGHT_BTN_MENU = true;
new Thread(() =>
{
Thread.Sleep(50);
RunTimeStatus.SHOW_RIGHT_BTN_MENU = false;
}).Start();
//在没有设置密码的情况下不弹出修改密码菜单
if (string.IsNullOrEmpty(appData.AppConfig.MenuPassword))
{
AlterPW1.Visibility = Visibility.Collapsed;
}
else
{
AlterPW1.Visibility = Visibility.Visible;
}
}
private void ListBoxItem_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
ListBoxItem lbi = sender as ListBoxItem;
MenuInfo info = lbi.DataContext as MenuInfo;
ItemCollection ics = lbi.ContextMenu.Items;
foreach (object obj in ics)
{
MenuItem mi = (MenuItem)obj;
if (mi.Header.Equals("修改密码"))
{
if (string.IsNullOrEmpty(appData.AppConfig.MenuPassword))
{
mi.Visibility = Visibility.Collapsed;
}
else
{
mi.Visibility = Visibility.Visible;
}
break;
}
if (mi.Header.Equals("加密此列表") || mi.Header.Equals("取消加密此列表"))
{
if (info.IsEncrypt)
{
mi.Header = "取消加密此列表";
}
else
{
mi.Header = "加密此列表";
}
}
}
}
}
}

View File

@@ -6,9 +6,14 @@
xmlns:temp="clr-namespace:GeekDesk.ViewModel.Temp"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:cvt="clr-namespace:GeekDesk.Converts"
xmlns:cst="clr-namespace:GeekDesk.Constant"
xmlns:DraggAnimatedPanel="clr-namespace:DraggAnimatedPanel"
xmlns:component="clr-namespace:GeekDesk.CustomComponent.VirtualizingWrapPanel"
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
xmlns:ot="clr-namespace:GeekDesk.Control.Other"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
AllowDrop="True"
>
<UserControl.Resources>
<!--右侧栏样式动画-->
@@ -19,20 +24,16 @@
</Trigger>
</Style.Triggers>
</Style>-->
<Storyboard x:Key="Custom1Transition" x:Shared="False">
<DoubleAnimation From="50" To="0" Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
<DoubleAnimation.EasingFunction>
<ElasticEase Oscillations="1"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
<Style x:Key="ImageStyle" TargetType="Image">
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageWidth, Mode=OneWay}"/>
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageHeight, Mode=OneWay}"/>
<Setter Property="Source" Value="{Binding BitmapImage}"/>
</Style>
<Style x:Key="ImageStyleNoWrite" TargetType="Image">
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageWidth, Mode=OneWay}"/>
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageHeight, Mode=OneWay}"/>
<Setter Property="Source" Value="{Binding BitmapImage_NoWrite}"/>
</Style>
<Style x:Key="MyListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
@@ -46,12 +47,89 @@
</Setter>
</Style>
<Style x:Key="SearchListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border>
<Border.Style>
<Style TargetType="Border">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</Border.Style>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="MyPoptipStyle" TargetType="Border">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Background" Value="White"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
<Setter Property="CornerRadius" Value="{StaticResource DefaultCornerRadius}"/>
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
<!--<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="hc:Poptip">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
<ContentPresenter Margin="{TemplateBinding Padding}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>-->
</Style>
<Storyboard x:Key="Custom1Transition1" x:Shared="False">
<DoubleAnimation From="50" To="0" Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
<DoubleAnimation.EasingFunction>
<ElasticEase Oscillations="1"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
<Storyboard x:Key="Custom2Transition2" x:Shared="False">
<DoubleAnimation From="10" To="0" Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
<DoubleAnimation.EasingFunction>
<ElasticEase Oscillations="1"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
<Storyboard x:Key="Custom3Transition3" x:Shared="False">
<DoubleAnimation From=".8" To="1" Duration="0:0:0.4">
<DoubleAnimation.EasingFunction>
<ElasticEase Oscillations="1"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
<cvt:OpcityConvert x:Key="OpcityConvert"/>
<cvt:SearchResWidth x:Key="SearchResWidth"/>
<cvt:GetWidthByWWConvert x:Key="GetWidthByWWConvert"/>
<temp:SearchIconList x:Key="SearchIconList"/>
<cvt:Boolean2VisibilityConverter x:Key="MyBoolean2VisibilityConverter"/>
<cvt:ValueConvert x:Key="ValueConvert"/>
<cst:RunTimeStatus x:Key="RunTimeStatus"/>
<cst:DictConst x:Key="DictConst"/>
</UserControl.Resources>
<!--右侧栏-->
<Grid>
<Popup Name="MyPoptip" FlowDirection="LeftToRight"
PopupAnimation="None" Placement="Mouse"
IsOpen="False"
AllowsTransparency="True"
>
<Grid Background="Transparent">
<Border Style="{StaticResource MyPoptipStyle}">
<TextBlock Name="MyPoptipContent" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Left" Text="Test" FontSize="13"/>
</Border>
</Grid>
</Popup>
<hc:Card AllowDrop="True"
x:Name="WrapCard"
Visibility="Visible"
@@ -59,7 +137,10 @@
BorderThickness="1"
Effect="{DynamicResource EffectShadow2}"
Margin="5,0,5,5" Grid.ColumnSpan="2"
PreviewMouseRightButtonDown="WrapCard_PreviewMouseRightButtonDown">
PreviewMouseRightButtonDown="WrapCard_PreviewMouseRightButtonDown"
hc:Dialog.Token="RightWrapCardDialog"
MouseWheel="IconListBox_MouseWheel"
>
<hc:Card.Background>
<SolidColorBrush Color="AliceBlue" hc:GeometryEffect.GeometryEffect="20" Opacity="{Binding AppConfig.CardOpacity, Mode=TwoWay, Converter={StaticResource OpcityConvert}}"/>
</hc:Card.Background>
@@ -71,28 +152,73 @@
<MenuItem Header="添加URL项目" Click="AddUrlIcon"/>
<MenuItem Header="添加系统项目" Click="AddSystemIcon"/>
<MenuItem x:Name="CardLockCM" Header="锁定主面板" Click="LockAppPanel"/>
<MenuItem x:Name="showTitle" Header="隐藏/显示标题" Click="ShowTitle_Click"/>
<MenuItem Header="{Binding AppConfig.IconBatch_NoWrite, Mode=OneWay, Converter={StaticResource ValueConvert}, ConverterParameter={x:Static cst:DictConst.batchMenuHeaderDict}}" Click="BatchHandle" Tag="{Binding}"/>
</ContextMenu>
</hc:Card.ContextMenu>
<hc:DialogContainer>
<Grid>
<StackPanel Panel.ZIndex="1" Margin="0,-10,-300,0" hc:Growl.GrowlParent="True" hc:Growl.Token="MainWindowGrowl"/>
<WrapPanel Orientation="Horizontal" VirtualizingPanel.VirtualizationMode="Recycling"
VirtualizingPanel.IsVirtualizing="True"
VirtualizingPanel.IsContainerVirtualizable="True"
<ot:PasswordDialog xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndGrowHorizontally}, Event=Visibility, Duration=50, Delay=0}"
x:Name="PDDialog"
Visibility="Collapsed"
Panel.ZIndex="99"
IsVisibleChanged="PDDialog_IsVisibleChanged"
Margin="0,-100,0,0"/>
<StackPanel Panel.ZIndex="1" Margin="0,-10,-0,0"/>
<WrapPanel Orientation="Horizontal"
Margin="10"
>
<ListBox x:Name="IconListBox" ItemsSource="{Binding AppConfig.SelectedMenuIcons, Mode=OneWay}"
<UniformGrid x:Name="WrapUFG" xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndGrowHorizontally}, Event=Visibility}">
<!--<hc:TransitioningContentControl TransitionStoryboard="{StaticResource Custom3Transition3}">-->
<ListBox x:Name="IconListBox"
ItemsSource="{Binding AppConfig.SelectedMenuIcons, Mode=OneWay}"
BorderThickness="0"
Padding="0,10,0,0"
SelectionChanged="IconListBox_SelectionChanged"
ScrollViewer.CanContentScroll ="True"
VirtualizingPanel.VirtualizationMode="Recycling"
VirtualizingPanel.IsVirtualizing="True"
VirtualizingPanel.IsContainerVirtualizable="True"
VirtualizingPanel.ScrollUnit="Pixel"
>
<ListBox.Template>
<ControlTemplate TargetType="ListBox">
<hc:ScrollViewer x:Name="WrapScroll"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Auto"
IsInertiaEnabled="True"
CanContentScroll="True"
PreviewMouseWheel="IconListBox_MouseWheel"
>
<Border BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderBrush}"
>
<ItemsPresenter/>
</Border>
</hc:ScrollViewer>
</ControlTemplate>
</ListBox.Template>
<ListBox.Background>
<SolidColorBrush Opacity="0"/>
<SolidColorBrush Color="#00FFFFFF" />
</ListBox.Background>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<DraggAnimatedPanel:DraggAnimatedPanel Background="#00FFFFFF"
<!--<DraggAnimatedPanel:DraggAnimatedPanel Background="#00FFFFFF"
ItemsWidth="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelWidth, Mode=OneWay}"
ItemsHeight="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelHeight, Mode=OneWay}"
HorizontalAlignment="Center"
SwapCommand="{Binding SwapCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>
SwapCommand="{Binding SwapCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>-->
<component:VirtualizingWrapPanel VirtualizationMode="Recycling"
IsVirtualizing="True"
IsContainerVirtualizable="True"
VirtualizingPanel.ScrollUnit="Pixel"
Width="{Binding AppConfig.WindowWidth, Mode=OneWay,
Converter={StaticResource GetWidthByWWConvert},
ConverterParameter={x:Static cst:WidthTypeEnum.RIGHT_CARD_70}}"
/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
@@ -104,7 +230,12 @@
<MenuItem Header="添加系统项目" Click="AddSystemIcon"/>
<MenuItem Header="资源管理器菜单" Click="SystemContextMenu" Tag="{Binding}"/>
<MenuItem Header="属性" Click="PropertyConfig" Tag="{Binding}"/>
<MenuItem Header="从列表移除" Click="RemoveIcon" Tag="{Binding}"/>
<MenuItem Header="从列表移除"
Click="RemoveIcon"
Tag="{Binding}"/>
<!--MenuItem Header="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.IconBatch_NoWrite, Mode=OneWay, Converter={StaticResource ValueConvert}, ConverterParameter={x:Static cst:DictConst.batchMenuHeaderDict}}"
Click="BatchHandle"
Tag="{Binding}"/>-->
</ContextMenu>
</ListBox.Resources>
@@ -116,24 +247,28 @@
<ListBox.ItemTemplate>
<DataTemplate>
<hc:SimpleStackPanel Tag="{Binding}"
Height="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelHeight, Mode=OneWay}"
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImgPanelWidth, Mode=OneWay}"
HorizontalAlignment="Center"
hc:Poptip.Content="{Binding Content}"
hc:Poptip.Placement="BottomLeft"
Background="#00FFFFFF"
MouseEnter="StackPanel_MouseEnter"
MouseLeave="StackPanel_MouseLeave"
MouseEnter="MenuIcon_MouseEnter"
MouseLeave="MenuIcon_MouseLeave"
MouseMove="MenuIcon_MouseMove"
MouseLeftButtonDown="Icon_MouseLeftButtonDown"
MouseLeftButtonUp="Icon_MouseLeftButtonUp"
>
<!--<CheckBox IsChecked="{Binding IsChecked_NoWrite}" Visibility="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.IconBatch_NoWrite, Mode=OneWay, Converter={StaticResource Boolean2VisibilityConverter}}" Margin="0,0,0,-20" HorizontalAlignment="Right"/>-->
<!--<StackPanel Background="#00FFFFFF"
MouseEnter="CursorPanel_MouseEnter"
MouseLeave="CursorPanel_MouseLeave"
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageWidth, Mode=OneWay}">-->
<Image Style="{StaticResource ImageStyle}"
RenderOptions.BitmapScalingMode="HighQuality"/>
<!--Width="{Binding AppConfig.WindowWidth, Mode=OneWay,
Converter={StaticResource GetWidthByWWConvert},
ConverterParameter={x:Static cst:WidthTypeEnum.RIGHT_CARD_70}}"-->
<TextBlock MaxWidth="80"
Margin="0,5,0,0"
MaxHeight="40"
@@ -143,6 +278,7 @@
TextAlignment="Center"
VerticalAlignment="Center"
Foreground="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.TextColor}"
Visibility="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ShowIconTitle, Converter={StaticResource MyBoolean2VisibilityConverter}, ConverterParameter={x:Static Visibility.Collapsed}, Mode=TwoWay}"
Text="{Binding Name}"/>
<!--</StackPanel>-->
@@ -150,14 +286,17 @@
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<!--</hc:TransitioningContentControl>-->
</UniformGrid>
</WrapPanel>
</Grid>
</hc:DialogContainer>
</hc:Card>
<hc:Card x:Name="VerticalCard"
Visibility="Hidden"
Visibility="Collapsed"
BorderThickness="1"
Effect="{DynamicResource EffectShadow2}"
Margin="5,0,5,5" Grid.ColumnSpan="2"
@@ -171,83 +310,16 @@
<hc:Card.BorderBrush>
<SolidColorBrush Color="#FFFFFFFF" Opacity="0"/>
</hc:Card.BorderBrush>
<Grid>
<StackPanel Panel.ZIndex="1" Margin="0,-10,-300,0" hc:Growl.GrowlParent="True" hc:Growl.Token="MainWindowGrowl"/>
<WrapPanel Orientation="Horizontal" VirtualizingPanel.VirtualizationMode="Recycling"
VirtualizingPanel.IsVirtualizing="True"
VirtualizingPanel.IsContainerVirtualizable="True"
>
<UniformGrid x:Name="VerticalUFG">
<hc:TransitioningContentControl TransitionMode="Left2RightWithFade">
<ListBox ItemsSource="{Binding Source={StaticResource SearchIconList},Path=IconList}"
BorderThickness="0"
Padding="0,10,0,0"
>
<ListBox.Background>
<SolidColorBrush Opacity="0"/>
</ListBox.Background>
<ListBox.Resources>
<ContextMenu x:Key="IconDialog" Width="200">
<MenuItem Header="管理员方式运行" Click="IconAdminStart" Tag="{Binding}"/>
<MenuItem Header="打开文件所在位置" Click="ShowInExplore" Tag="{Binding}"/>
<MenuItem Header="添加URL项目" Click="AddUrlIcon"/>
<MenuItem Header="添加系统项目" Click="AddSystemIcon"/>
<MenuItem Header="资源管理器菜单" Click="SystemContextMenu" Tag="{Binding}"/>
<MenuItem Header="属性" Click="PropertyConfig" Tag="{Binding}"/>
</ContextMenu>
</ListBox.Resources>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem" BasedOn="{StaticResource MyListBoxItemStyle}">
<Setter Property="ContextMenu" Value="{StaticResource IconDialog}"/>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Background="#00FFFFFF"
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.MenuCardWidth, Mode=OneWay, Converter={StaticResource SearchResWidth}, ConverterParameter=1}"
/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<WrapPanel Tag="{Binding}"
Height="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.ImageHeight, Mode=OneWay}"
Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.MenuCardWidth, Mode=OneWay, Converter={StaticResource SearchResWidth}, ConverterParameter=2}"
HorizontalAlignment="Left"
hc:Poptip.HitMode="None"
hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}"
hc:Poptip.Content="{Binding Content}"
hc:Poptip.Placement="BottomLeft"
Background="#00FFFFFF"
MouseLeftButtonDown="Icon_MouseLeftButtonDown"
MouseLeftButtonUp="Icon_MouseLeftButtonUp"
Margin="25,20,0,0"
>
<Image Style="{StaticResource ImageStyle}" RenderOptions.BitmapScalingMode="HighQuality"/>
<TextBlock
Margin="10,5,0,0"
MaxHeight="40"
FontSize="13"
TextWrapping="Wrap"
TextTrimming="WordEllipsis"
TextAlignment="Left"
VerticalAlignment="Center"
Foreground="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=DataContext.AppConfig.TextColor}"
Text="{Binding Name}"/>
</WrapPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</hc:TransitioningContentControl>
</UniformGrid>
</WrapPanel>
</Grid>
</hc:Card>
<hc:LoadingCircle x:Name="Loading_RightCard"
Width="45" Height="45"
DotBorderBrush="White"
DotBorderThickness="2"
Foreground="DarkGray"
Opacity="0.8"
DotDiameter="10"
Margin="-50,-150,0,0"
Visibility="Collapsed"
/>
</Grid>
</UserControl>

View File

@@ -2,17 +2,23 @@
using GeekDesk.Constant;
using GeekDesk.Control.Other;
using GeekDesk.Control.Windows;
using GeekDesk.Plugins.EveryThing;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using GeekDesk.ViewModel.Temp;
using HandyControl.Controls;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Threading;
@@ -25,74 +31,87 @@ namespace GeekDesk.Control.UserControls.PannelCard
{
private AppData appData = MainWindow.appData;
private volatile static bool DROP_ICON = false;
private Thread dropCheckThread = null;
ListBoxDragDropManager<IconInfo> dragMgr;
//private Thread dropCheckThread = null;
public RightCardControl()
{
InitializeComponent();
this.Loaded += RightCardControl_Loaded;
}
private void RightCardControl_Loaded(object sender, RoutedEventArgs e)
{
this.dragMgr = new ListBoxDragDropManager<IconInfo>(this.IconListBox);
}
#region
DelegateCommand<int[]> _swap;
public DelegateCommand<int[]> SwapCommand
{
get
{
if (_swap == null)
_swap = new DelegateCommand<int[]>(
(indexes) =>
{
DROP_ICON = true;
if (appData.AppConfig.IconSortType != SortType.CUSTOM
&& (dropCheckThread == null || !dropCheckThread.IsAlive))
{
dropCheckThread = new Thread(() =>
{
do
{
DROP_ICON = false;
Thread.Sleep(1000);
} while (DROP_ICON);
//#region 图标拖
//DelegateCommand<int[]> _swap;
//public DelegateCommand<int[]> SwapCommand
//{
// get
// {
// if (_swap == null)
// _swap = new DelegateCommand<int[]>(
// (indexes) =>
// {
// DROP_ICON = true;
// if (appData.AppConfig.IconSortType != SortType.CUSTOM
// && (dropCheckThread == null || !dropCheckThread.IsAlive))
// {
// dropCheckThread = new Thread(() =>
// {
// do
// {
// DROP_ICON = false;
// Thread.Sleep(1000);
// } while (DROP_ICON);
MainWindow.appData.AppConfig.IconSortType = SortType.CUSTOM;
App.Current.Dispatcher.Invoke(() =>
{
if (MainWindow.mainWindow.Visibility == Visibility.Collapsed
|| MainWindow.mainWindow.Opacity != 1)
{
Growl.WarningGlobal("已将图标排序规则重置为自定义!");
}
else
{
Growl.Warning("已将图标排序规则重置为自定义!", "MainWindowGrowl");
}
});
});
dropCheckThread.Start();
}
int fromS = indexes[0];
int to = indexes[1];
ObservableCollection<IconInfo> iconList = appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList;
var elementSource = iconList[to];
var dragged = iconList[fromS];
// MainWindow.appData.AppConfig.IconSortType = SortType.CUSTOM;
// App.Current.Dispatcher.Invoke(() =>
// {
// if (MainWindow.mainWindow.Visibility == Visibility.Collapsed
// || MainWindow.mainWindow.Opacity != 1)
// {
// Growl.WarningGlobal("已将图标排序规则重置为自定义!");
// }
// else
// {
// Growl.Warning("已将图标排序规则重置为自定义!", "MainWindowGrowl");
// }
// });
// });
// dropCheckThread.Start();
// }
// int fromS = indexes[0];
// int to = indexes[1];
// ObservableCollection<IconInfo> iconList = appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList;
// var elementSource = iconList[to];
// var dragged = iconList[fromS];
iconList.Remove(dragged);
iconList.Insert(to, dragged);
}
);
return _swap;
}
}
// iconList.Remove(dragged);
// iconList.Insert(to, dragged);
// }
// );
// return _swap;
// }
//}
#endregion
//#endregion 图标拖
private void Icon_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (appData.AppConfig.IconBatch_NoWrite)
{
return;
}
if (appData.AppConfig.DoubleOpen)
{
IconClick(sender, e);
@@ -101,6 +120,18 @@ namespace GeekDesk.Control.UserControls.PannelCard
private void Icon_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
//Console.WriteLine("选中:" + IconListBox.SelectedItems.Count);
if (appData.AppConfig.IconBatch_NoWrite)
{
//查找checkbox更改选中状态
Panel p = sender as Panel;
var ens = p.Children.OfType<CheckBox>();
foreach (CheckBox cb in ens)
{
cb.IsChecked = !cb.IsChecked;
}
return;
}
if (!appData.AppConfig.DoubleOpen)
{
IconClick(sender, e);
@@ -114,16 +145,18 @@ namespace GeekDesk.Control.UserControls.PannelCard
/// <param name="e"></param>
private void IconClick(object sender, MouseButtonEventArgs e)
{
if (!RunTimeStatus.SEARCH_BOX_HIDED_300) return;
if (appData.AppConfig.DoubleOpen && e.ClickCount >= 2)
{
IconInfo icon = (IconInfo)((Panel)sender).Tag;
if (icon.AdminStartUp)
{
StartIconApp(icon, IconStartType.ADMIN_STARTUP);
ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP);
}
else
{
StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
ProcessUtil.StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
}
}
else if (!appData.AppConfig.DoubleOpen && e.ClickCount == 1)
@@ -131,11 +164,11 @@ namespace GeekDesk.Control.UserControls.PannelCard
IconInfo icon = (IconInfo)((Panel)sender).Tag;
if (icon.AdminStartUp)
{
StartIconApp(icon, IconStartType.ADMIN_STARTUP);
ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP);
}
else
{
StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
ProcessUtil.StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
}
}
@@ -149,7 +182,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
private void IconAdminStart(object sender, RoutedEventArgs e)
{
IconInfo icon = (IconInfo)((MenuItem)sender).Tag;
StartIconApp(icon, IconStartType.ADMIN_STARTUP);
ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP);
}
/// <summary>
@@ -160,196 +193,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
private void ShowInExplore(object sender, RoutedEventArgs e)
{
IconInfo icon = (IconInfo)((MenuItem)sender).Tag;
StartIconApp(icon, IconStartType.SHOW_IN_EXPLORE);
}
private void StartIconApp(IconInfo icon, IconStartType type)
{
try
{
using (Process p = new Process())
{
string startArg = icon.StartArg;
if (startArg != null && Constants.SYSTEM_ICONS.ContainsKey(startArg))
{
StartSystemApp(startArg, type);
}
else
{
p.StartInfo.FileName = icon.Path;
if (!StringUtil.IsEmpty(startArg))
{
p.StartInfo.Arguments = startArg;
}
if (icon.IconType == IconType.OTHER)
{
if (!File.Exists(icon.Path) && !Directory.Exists(icon.Path))
{
HandyControl.Controls.Growl.WarningGlobal("程序启动失败(文件路径不存在或已删除)!");
return;
}
p.StartInfo.WorkingDirectory = icon.Path.Substring(0, icon.Path.LastIndexOf("\\"));
switch (type)
{
case IconStartType.ADMIN_STARTUP:
//p.StartInfo.Arguments = "1";//启动参数
p.StartInfo.Verb = "runas";
//p.StartInfo.CreateNoWindow = false; //设置显示窗口
p.StartInfo.UseShellExecute = true;//不使用操作系统外壳程序启动进程
//p.StartInfo.ErrorDialog = false;
if (appData.AppConfig.AppHideType == AppHideType.START_EXE && !RunTimeStatus.LOCK_APP_PANEL)
{
//如果开启了贴边隐藏 则窗体不贴边才隐藏窗口
if (appData.AppConfig.MarginHide)
{
if (!MarginHide.IsMargin())
{
MainWindow.HideApp();
}
}
else
{
MainWindow.HideApp();
}
}
break;// c#好像不能case穿透
case IconStartType.DEFAULT_STARTUP:
if (appData.AppConfig.AppHideType == AppHideType.START_EXE && !RunTimeStatus.LOCK_APP_PANEL)
{
//如果开启了贴边隐藏 则窗体不贴边才隐藏窗口
if (appData.AppConfig.MarginHide)
{
if (!MarginHide.IsMargin())
{
MainWindow.HideApp();
}
}
else
{
MainWindow.HideApp();
}
}
break;
case IconStartType.SHOW_IN_EXPLORE:
p.StartInfo.FileName = "Explorer.exe";
p.StartInfo.Arguments = "/e,/select," + icon.Path;
break;
}
}
else
{
if (appData.AppConfig.AppHideType == AppHideType.START_EXE && !RunTimeStatus.LOCK_APP_PANEL)
{
//如果开启了贴边隐藏 则窗体不贴边才隐藏窗口
if (appData.AppConfig.MarginHide)
{
if (!MarginHide.IS_HIDE)
{
MainWindow.HideApp();
}
}
else
{
MainWindow.HideApp();
}
}
}
p.Start();
}
}
icon.Count++;
//隐藏搜索框
if (RunTimeStatus.SEARCH_BOX_SHOW)
{
MainWindow.mainWindow.HidedSearchBox();
}
}
catch (Exception e)
{
HandyControl.Controls.Growl.WarningGlobal("程序启动失败(不支持的启动方式)!");
LogUtil.WriteErrorLog(e, "程序启动失败:path=" + icon.Path + ",type=" + type);
}
}
private void StartSystemApp(string startArg, IconStartType type)
{
if (type == IconStartType.SHOW_IN_EXPLORE)
{
Growl.WarningGlobal("系统项目不支持打开文件位置操作!");
return;
}
switch (startArg)
{
case "Calculator":
Process.Start("calc.exe");
break;
case "Computer":
Process.Start("explorer.exe");
break;
case "GroupPolicy":
Process.Start("gpedit.msc");
break;
case "Notepad":
Process.Start("notepad");
break;
case "Network":
Process.Start("ncpa.cpl");
break;
case "RecycleBin":
Process.Start("shell:RecycleBinFolder");
break;
case "Registry":
Process.Start("regedit.exe");
break;
case "Mstsc":
if (type == IconStartType.ADMIN_STARTUP)
{
Process.Start("mstsc", "-admin");
}
else
{
Process.Start("mstsc");
}
break;
case "Control":
Process.Start("Control");
break;
case "CMD":
if (type == IconStartType.ADMIN_STARTUP)
{
using (Process process = new Process())
{
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.Verb = "runas";
process.Start();
}
}
else
{
Process.Start("cmd");
}
break;
case "Services":
Process.Start("services.msc");
break;
}
//如果开启了贴边隐藏 则窗体不贴边才隐藏窗口
if (appData.AppConfig.MarginHide)
{
if (!MarginHide.IS_HIDE)
{
MainWindow.HideApp();
}
}
else
{
MainWindow.HideApp();
}
ProcessUtil.StartIconApp(icon, IconStartType.SHOW_IN_EXPLORE);
}
/// <summary>
@@ -368,7 +212,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
MainWindow.appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList.Add(iconInfo);
}
CommonCode.SortIconList();
CommonCode.SaveAppData(MainWindow.appData);
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
}
/// <summary>
@@ -405,47 +249,64 @@ namespace GeekDesk.Control.UserControls.PannelCard
{
case IconType.URL:
IconInfoUrlDialog urlDialog = new IconInfoUrlDialog(info);
urlDialog.dialog = HandyControl.Controls.Dialog.Show(urlDialog, "IconInfoDialog");
urlDialog.dialog = HandyControl.Controls.Dialog.Show(urlDialog, "MainWindowDialog");
break;
default:
IconInfoDialog dialog = new IconInfoDialog(info);
dialog.dialog = HandyControl.Controls.Dialog.Show(dialog, "IconInfoDialog");
dialog.dialog = HandyControl.Controls.Dialog.Show(dialog, "MainWindowDialog");
break;
}
}
private void StackPanel_MouseEnter(object sender, MouseEventArgs e)
private void MenuIcon_MouseEnter(object sender, MouseEventArgs e)
{
RunTimeStatus.MOUSE_ENTER_ICON = true;
if (!RunTimeStatus.ICONLIST_MOUSE_WHEEL)
{
ThreadPool.QueueUserWorkItem(state =>
{
this.Dispatcher.BeginInvoke(new Action(() =>
{
IconInfo info = (sender as Panel).Tag as IconInfo;
MyPoptipContent.Text = info.Content;
MyPoptip.VerticalOffset = 30;
Thread.Sleep(50);
if (!RunTimeStatus.ICONLIST_MOUSE_WHEEL)
{
MyPoptip.IsOpen = true;
}
}));
});
}
double width = appData.AppConfig.ImageWidth;
double height = appData.AppConfig.ImageHeight;
width += width * 0.15;
height += height * 0.15;
Thread t = new Thread(() =>
ThreadPool.QueueUserWorkItem(state =>
{
this.Dispatcher.BeginInvoke(new Action(() =>
{
ImgStoryBoard(sender, (int)width, (int)height, 1, true);
}));
});
t.IsBackground = true;
t.Start();
}
private void StackPanel_MouseLeave(object sender, MouseEventArgs e)
private void MenuIcon_MouseLeave(object sender, MouseEventArgs e)
{
RunTimeStatus.MOUSE_ENTER_ICON = false;
MyPoptip.IsOpen = false;
Thread t = new Thread(() =>
ThreadPool.QueueUserWorkItem(state =>
{
this.Dispatcher.BeginInvoke(new Action(() =>
{
ImgStoryBoard(sender, appData.AppConfig.ImageWidth, appData.AppConfig.ImageHeight, 260);
}));
});
t.IsBackground = true;
t.Start();
}
@@ -510,9 +371,14 @@ namespace GeekDesk.Control.UserControls.PannelCard
Panel sp = sender as Panel;
DependencyObject dos = sp.Parent;
Image img = null;
Image img = sp.Children[0] as Image;
foreach (var imgBak in sp.Children.OfType<Image>())
{
img = (Image)imgBak;
}
if (img == null) return;
double afterHeight = img.Height;
double afterWidth = img.Width;
@@ -636,7 +502,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
private void AddUrlIcon(object sender, RoutedEventArgs e)
{
IconInfoUrlDialog urlDialog = new IconInfoUrlDialog();
urlDialog.dialog = HandyControl.Controls.Dialog.Show(urlDialog, "IconInfoDialog");
urlDialog.dialog = HandyControl.Controls.Dialog.Show(urlDialog, "MainWindowDialog");
}
/// <summary>
@@ -711,10 +577,169 @@ namespace GeekDesk.Control.UserControls.PannelCard
if (RunTimeStatus.LOCK_APP_PANEL)
{
CardLockCM.Header = "解锁主面板";
} else
}
else
{
CardLockCM.Header = "锁定主面板";
}
}
private void PDDialog_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
{
if (PDDialog.Visibility == Visibility.Visible)
{
RunTimeStatus.SHOW_MENU_PASSWORDBOX = true;
PDDialog.ClearVal();
PDDialog.ErrorMsg.Visibility = Visibility.Collapsed;
PDDialog.PasswordGrid.Visibility = Visibility.Visible;
PDDialog.HintGrid.Visibility = Visibility.Collapsed;
PDDialog.count = 0;
PDDialog.SetFocus();
}
else
{
RunTimeStatus.SHOW_MENU_PASSWORDBOX = false;
PDDialog.ClearVal();
MainWindow.mainWindow.Focus();
}
}
/// <summary>
/// 菜单结果icon 列表鼠标滚轮预处理时间
/// 主要使用自定义popup解决卡顿问题解决卡顿问题
/// 以及滚动条首尾切换菜单
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void IconListBox_MouseWheel(object sender, MouseWheelEventArgs e)
{
//控制在滚动时不显示popup 否则会在低GPU性能机器上造成卡顿
MyPoptip.IsOpen = false;
if (RunTimeStatus.ICONLIST_MOUSE_WHEEL)
{
RunTimeStatus.MOUSE_WHEEL_WAIT_MS = 500;
}
else
{
RunTimeStatus.ICONLIST_MOUSE_WHEEL = true;
new Thread(() =>
{
while (RunTimeStatus.MOUSE_WHEEL_WAIT_MS > 0)
{
Thread.Sleep(1);
RunTimeStatus.MOUSE_WHEEL_WAIT_MS -= 1;
}
if (RunTimeStatus.MOUSE_ENTER_ICON)
{
this.Dispatcher.BeginInvoke(new Action(() =>
{
MyPoptip.IsOpen = true;
}));
}
RunTimeStatus.MOUSE_WHEEL_WAIT_MS = 100;
RunTimeStatus.ICONLIST_MOUSE_WHEEL = false;
}).Start();
}
//修改菜单时不切换菜单
if (RunTimeStatus.IS_MENU_EDIT) return;
//切换菜单
System.Windows.Controls.ScrollViewer scrollViewer = sender as System.Windows.Controls.ScrollViewer;
if (scrollViewer == null)
{
//在card 上获取的事件
scrollViewer = ScrollUtil.FindSimpleVisualChild<System.Windows.Controls.ScrollViewer>(IconListBox);
}
if (e.Delta < 0)
{
int index = MainWindow.mainWindow.LeftCard.MenuListBox.SelectedIndex;
if (ScrollUtil.IsBootomScrollView(scrollViewer))
{
if (index < MainWindow.mainWindow.LeftCard.MenuListBox.Items.Count - 1)
{
index++;
}
else
{
index = 0;
}
MainWindow.mainWindow.LeftCard.MenuListBox.SelectedIndex = index;
scrollViewer.ScrollToVerticalOffset(0);
}
}
else if (e.Delta > 0)
{
if (ScrollUtil.IsTopScrollView(scrollViewer))
{
int index = MainWindow.mainWindow.LeftCard.MenuListBox.SelectedIndex;
if (index > 0)
{
index--;
}
else
{
index = MainWindow.mainWindow.LeftCard.MenuListBox.Items.Count - 1;
}
MainWindow.mainWindow.LeftCard.MenuListBox.SelectedIndex = index;
scrollViewer.ScrollToVerticalOffset(0);
}
}
}
/// <summary>
/// menu结果ICON鼠标移动事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MenuIcon_MouseMove(object sender, MouseEventArgs e)
{
//防止移动后不刷新popup content
IconInfo info = (sender as Panel).Tag as IconInfo;
MyPoptipContent.Text = info.Content;
MyPoptip.VerticalOffset = 30;
}
/// <summary>
/// 控制图标标题显示及隐藏
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ShowTitle_Click(object sender, RoutedEventArgs e)
{
appData.AppConfig.ShowIconTitle = !appData.AppConfig.ShowIconTitle;
}
/// <summary>
/// 批量操作
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void BatchHandle(object sender, RoutedEventArgs e)
{
if (!appData.AppConfig.IconBatch_NoWrite)
{
//开启批量操作时把所有的状态更改为未选中
foreach(var ic in IconListBox.Items)
{
IconInfo info = ic as IconInfo;
info.IsChecked_NoWrite = false;
}
}
appData.AppConfig.IconBatch_NoWrite = !appData.AppConfig.IconBatch_NoWrite;
IconListBox.SelectionMode = SelectionMode.Multiple;
}
private void IconListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
//Console.WriteLine(sender.ToString());
}
}
}

View File

@@ -42,7 +42,7 @@ namespace GeekDesk.Control.UserControls.SystemItem
iconInfo = CommonCode.GetIconInfoByPath(thisInfo.LnkPath_NoWrite);
}
menuInfo.IconList.Add(iconInfo);
CommonCode.SaveAppData(MainWindow.appData);
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
}
}
}

View File

@@ -6,7 +6,6 @@
xmlns:local="clr-namespace:GeekDesk.Control.UserControls.PannelCard"
xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:viewmodel="clr-namespace:GeekDesk.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:ToDoInfo}"
mc:Ignorable="d"
xmlns:cst="clr-namespace:GeekDesk.Converts"
Background="Transparent"
>
@@ -83,10 +82,36 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridRow}">
<Border CornerRadius="8" MouseRightButtonDown="DataGridRow_MouseRightButtonDown" Margin="0,0,0,5" BorderBrush="Black" BorderThickness="0" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<Border CornerRadius="8" MouseRightButtonDown="DataGridRow_MouseRightButtonDown" Margin="0,0,0,5" BorderBrush="Black" BorderThickness="0" SnapsToDevicePixels="True">
<Border.Style>
<Style TargetType="Border">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="White" Opacity="0.6"/>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Opacity)">
<DoubleAnimation To="1" Duration="0:0:0"/>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Opacity)">
<DoubleAnimation To="0.6" Duration="0:0:0.5"/>
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
</Trigger>
</Style.Triggers>
</Style>
</Border.Style>
<SelectiveScrollingGrid>

View File

@@ -1,4 +1,5 @@
using GeekDesk.Control.Windows;
using GeekDesk.Constant;
using GeekDesk.Control.Windows;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using HandyControl.Controls;
@@ -42,7 +43,7 @@ namespace GeekDesk.Control.UserControls.Backlog
{
MainWindow.appData.HiToDoList.Remove(info);
}
CommonCode.SaveAppData(MainWindow.appData);
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
}
return true;
}, "DeleteConfirm");

View File

@@ -4,7 +4,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:local="clr-namespace:GeekDesk"
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
xmlns:local="clr-namespace:GeekDesk" xmlns:viewmodel="clr-namespace:GeekDesk.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:AppConfig}"
Title="Setting"
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
@@ -20,10 +21,13 @@
>
<Grid Margin="30">
<Grid.Effect>
<DropShadowEffect BlurRadius="20" Direction="-90" Color="Gray"
RenderingBias="Quality" ShadowDepth="2"/>
</Grid.Effect>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Panel.ZIndex="9999" hc:Growl.GrowlParent="False" hc:Growl.Token="ConfigWindowAskGrowl" Grid.Column="1" Grid.Row="1"/>
<Grid hc:Dialog.Token="ConfigWindowDialog">
<hc:DialogContainer Margin="10">
<Border Style="{StaticResource BorderBG}">
@@ -36,6 +40,7 @@
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<hc:Card Grid.Row="0" Grid.Column="0" Background="Transparent" BorderThickness="0">
<hc:SideMenu AutoSelect="True" Background="Transparent" Margin="1,7,0,3">
@@ -109,14 +114,14 @@
</hc:SideMenu>
</hc:Card>
<hc:ScrollViewer Grid.Row="0" Grid.Column="1" BorderThickness="0" Margin="0,5,1,5">
<UniformGrid x:Name="UFG">
<hc:TransitioningContentControl TransitionMode="Left2RightWithFade">
<UniformGrid x:Name="UFG" xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeIn}, Event=Visibility, Delay=0}">
<!--<hc:TransitioningContentControl TransitionMode="Left2RightWithFade">-->
<hc:Card x:Name="RightCard" BorderThickness="0" MouseDown="DragMove">
<hc:Card.Background>
<SolidColorBrush Opacity="0"/>
</hc:Card.Background>
</hc:Card>
</hc:TransitioningContentControl>
<!--</hc:TransitioningContentControl>-->
</UniformGrid>
</hc:ScrollViewer>

View File

@@ -1,5 +1,6 @@
using GeekDesk.Control.UserControls.Config;
using GeekDesk.Interface;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using HandyControl.Controls;
using System.Collections.Generic;
@@ -34,8 +35,10 @@ namespace GeekDesk.Control.Windows
//BG.Source = ImageUtil.Base64ToBitmapImage(Constants.DEFAULT_BAC_IMAGE_BASE64);
this.DataContext = appConfig;
RightCard.Content = about;
this.Topmost = true;
WindowUtil.SetOwner(this, mainWindow);
this.mainWindow = mainWindow;
UFG.Visibility = Visibility.Collapsed;
UFG.Visibility = Visibility.Visible;
}

View File

@@ -5,7 +5,9 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:GeekDesk.Control.Windows"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
WindowStyle="None"
ResizeMode="NoResize"
AllowsTransparency="True"
Background="Transparent"
KeyDown="OnKeyDown"
@@ -14,8 +16,42 @@
Background="White"
Height="385"
Width="228">
<Grid>
<TextBlock Panel.ZIndex="1000" Text="❤❤❤"
x:Name="CopySuccess"
Visibility="Collapsed"
xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndSlideFromBottom}, Duration=400, Event=None}"
xf:Animations.PrimaryBinding="{Binding CopyAnimation}"
Margin="138,300,0,0"
/>
<Button Height="32"
BorderThickness="0" Content="复 制"
Panel.ZIndex="999"
Margin="122,329,0,0"
HorizontalAlignment="Left"
Background="#BF8EF6"
Click="MyColorPicker_Confirmed"
VerticalAlignment="Top" Width="80"
>
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource MyBtnStyle}">
</Style>
</Button.Style>
</Button>
<Button Height="32"
BorderThickness="0" Content="关 闭"
Panel.ZIndex="999" Margin="26,329,0,0"
Background="#EEEEEE"
Click="MyColorPicker_Canceled"
HorizontalAlignment="Left"
VerticalAlignment="Top" Width="80"
>
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource MyBtnStyle}">
</Style>
</Button.Style>
</Button>
<StackPanel>
<Border MouseDown="DragMove"
VerticalAlignment="Top"
CornerRadius="8,8,0,0"
@@ -36,14 +72,12 @@
</Button>
</Border>
<hc:ColorPicker HorizontalAlignment="Center"
VerticalAlignment="Bottom"
SelectedColorChanged="MyColorPicker_SelectedColorChanged"
x:Name="MyColorPicker"
Confirmed="MyColorPicker_Confirmed"
Canceled="MyColorPicker_Canceled"
ToggleButton.Checked="MyColorPicker_Checked"/>
</StackPanel>
</Grid>
</Border>
</Window>

View File

@@ -1,5 +1,8 @@
using GeekDesk.Interface;
using GeekDesk.Util;
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
@@ -14,10 +17,33 @@ namespace GeekDesk.Control.Windows
public partial class GlobalColorPickerWindow : IWindowCommon
{
PixelColorPickerWindow colorPickerWindow = null;
class PrivateDataContext : INotifyPropertyChanged
{
private bool copyAnimation = false;
public bool CopyAnimation
{
set
{
copyAnimation = value;
OnPropertyChanged("CopyAnimation");
}
get { return copyAnimation; }
}
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
public GlobalColorPickerWindow()
{
this.Topmost = true;
InitializeComponent();
this.DataContext = new PrivateDataContext();
}
public void OnKeyDown(object sender, KeyEventArgs e)
@@ -35,14 +61,26 @@ namespace GeekDesk.Control.Windows
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MyColorPicker_Canceled(object sender, EventArgs e)
private void MyColorPicker_Canceled(object sender, RoutedEventArgs e)
{
MyColorPickerClose();
}
private void MyColorPicker_Confirmed(object sender, HandyControl.Data.FunctionEventArgs<Color> e)
private void MyColorPicker_Confirmed(object sender, RoutedEventArgs e)
{
CopySuccess.Visibility = Visibility.Visible;
PrivateDataContext pdc = this.DataContext as PrivateDataContext;
pdc.CopyAnimation = true;
new Thread(() =>
{
Thread.Sleep(400);
this.Dispatcher.Invoke(() =>
{
pdc.CopyAnimation = false;
CopySuccess.Visibility = Visibility.Collapsed;
});
}).Start();
Color c = MyColorPicker.SelectedBrush.Color;
Clipboard.SetData(DataFormats.Text, string.Format("#{0:X2}{1:X2}{2:X2}{3:X2}", c.A, c.R, c.G, c.B));
Clipboard.SetData(DataFormats.Text, string.Format("#{0:X2}{1:X2}{2:X2}", c.R, c.G, c.B));
}
/// <summary>
@@ -81,15 +119,25 @@ namespace GeekDesk.Control.Windows
if (window == null || !window.Activate())
{
window = new GlobalColorPickerWindow();
window.Opacity = 0;
App.DoEvents();
window.Show();
}
window.Hide();
new Thread(() =>
{
Thread.Sleep(200);
App.Current.Dispatcher.Invoke(() =>
{
GlobalColorPickerWindow thisWindow = (GlobalColorPickerWindow)window;
if (thisWindow.colorPickerWindow == null || !thisWindow.colorPickerWindow.Activate())
{
thisWindow.colorPickerWindow = new PixelColorPickerWindow(thisWindow.MyColorPicker);
}
thisWindow.colorPickerWindow.Show();
});
}).Start();
}
public static void Show()
@@ -98,6 +146,7 @@ namespace GeekDesk.Control.Windows
{
window = new GlobalColorPickerWindow();
}
window.Opacity = 1;
window.Show();
Keyboard.Focus(window);
}
@@ -137,5 +186,28 @@ namespace GeekDesk.Control.Windows
{
this.Close();
}
private ICommand _hideCommand;
public ICommand HideCommand
{
get
{
if (_hideCommand == null)
{
_hideCommand = new RelayCommand(
p =>
{
return true;
},
p =>
{
//CopySuccess.Visibility = Visibility.Collapsed;
});
}
return _hideCommand;
}
}
}
}

View File

@@ -51,7 +51,7 @@
</Border.Background>-->
<hc:DialogContainer>
<Grid MouseDown="DragMove">
<TextBox x:Name="CheckSettingUrl" Visibility="Collapsed" Text="{Binding IsSettingUrl}" TextChanged="CheckSettingUrl_TextChanged"/>
<TextBox x:Name="CheckSettingUrl" Style="{StaticResource MyTextBoxStyle}" Visibility="Collapsed" Text="{Binding IsSettingUrl}" TextChanged="CheckSettingUrl_TextChanged"/>
<hc:TabControl x:Name="MyTabControl"
IsAnimationEnabled="True"
SelectionChanged="TabControl_SelectionChanged"
@@ -75,9 +75,9 @@
</hc:TabControl>
<Button Content="取消" Click="Close_Click" Margin="391,397.5,163,22.5"/>
<Button Content="自定义设置" Click="CustomButton_Click" IsEnabled="False" Name="CustomButton" Style="{StaticResource Btn1}" Margin="447,397.5,71,22.5"/>
<Button Content="确定" Click="Confirm_Click" Style="{StaticResource Btn1}" Margin="534,397.5,20,22.5" />
<Button Style="{StaticResource MyBtnStyle}" Content="取消" Click="Close_Click" Margin="391,397.5,163,22.5" />
<Button Style="{StaticResource MyBtnStyle}" Content="自定义设置" Click="CustomButton_Click" IsEnabled="False" Name="CustomButton" Margin="447,397.5,71,22.5"/>
<Button Style="{StaticResource MyBtnStyle}" Content="确定" Click="Confirm_Click" Margin="534,397.5,20,22.5" />
</Grid>
</hc:DialogContainer>
</Border>

View File

@@ -138,7 +138,7 @@ namespace GeekDesk.Control.Windows
}
window.Show();
Keyboard.Focus(window);
ShowWindowFollowMouse.Show(window, MousePosition.LEFT_CENTER, 0, 0, false);
ShowWindowFollowMouse.Show(window, MousePosition.LEFT_CENTER, 0, 0);
}
private void CustomButton_Click(object sender, RoutedEventArgs e)

View File

@@ -6,9 +6,12 @@
WindowStyle="None"
AllowsTransparency="True"
Background="Black"
ResizeMode="NoResize"
PreviewMouseMove="Window_PreviewMouseMove"
MouseLeftButtonDown="Window_MouseLeftButtonDown"
MouseRightButtonDown="Window_MouseRightButtonDown"
MouseWheel="Window_MouseWheel"
Loaded="Window_Loaded"
>
<Window.Resources>
<Style x:Key="TextKey" TargetType="TextBlock">

View File

@@ -3,14 +3,18 @@ using GeekDesk.Util;
using HandyControl.Controls;
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using Cursors = System.Windows.Input.Cursors;
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
using MouseEventArgs = System.Windows.Input.MouseEventArgs;
namespace GeekDesk.Control.Windows
{
@@ -19,19 +23,30 @@ namespace GeekDesk.Control.Windows
/// </summary>
public partial class PixelColorPickerWindow : IWindowCommon
{
private static int PIXEL_REC_LENGTH = 20;
private static int PIXEL_REC_LENGTH = 10;
private static readonly int MIN_LENGTH = 10;
private static readonly int MAX_LENGTH = 50;
private static System.Drawing.Bitmap bgBitmap;
//private static System.Drawing.Bitmap bgBitmap;
private static RenderTargetBitmap renderTargetBitmap;
private readonly ColorPicker colorPicker;
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern bool SetProcessDPIAware();
public PixelColorPickerWindow(ColorPicker colorPicker)
{
InitializeComponent();
this.colorPicker = colorPicker;
try
{
SetProcessDPIAware();
}
catch (Exception e) { }
ColorPickerWindow_Init();
}
@@ -40,27 +55,48 @@ namespace GeekDesk.Control.Windows
this.WindowState = WindowState.Normal;//还原窗口(非最小化和最大化)
this.Width = SystemParameters.VirtualScreenWidth;
this.Height = SystemParameters.VirtualScreenHeight;
var screens = Screen.AllScreens;
int allWidth = 0;
int allHeight = 0;
int x = 0;
int y = 0;
this.Left = SystemParameters.VirtualScreenLeft;
this.Top = SystemParameters.VirtualScreenTop;
foreach (var screen in screens)
{
var rect = screen.Bounds;
allWidth += rect.Width;
allHeight += rect.Height;
x = Math.Min(x, rect.X);
y = Math.Min(y, rect.Y);
}
//获取缩放比例
double scale = ScreenUtil.GetScreenScalingFactor();
this.Width = allWidth;
this.Height = allHeight;
this.Left = x;
this.Top = y;
DesktopBG.Width = this.Width;
DesktopBG.Height = this.Height;
this.Topmost = true;
bgBitmap = new System.Drawing.Bitmap(
(int)SystemParameters.VirtualScreenWidth,
(int)SystemParameters.VirtualScreenHeight,
System.Drawing.Bitmap bgBitmap = new System.Drawing.Bitmap(
(int)(Width * scale),
(int)(Height * scale),
System.Drawing.Imaging.PixelFormat.Format32bppArgb
);
using (System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bgBitmap))
{
g.CopyFromScreen(
0,
0,
(int)this.Left,
(int)this.Top,
0,
0,
bgBitmap.Size
@@ -76,10 +112,23 @@ namespace GeekDesk.Control.Windows
VisualBrush b = (VisualBrush)PixelBG.Fill;
b.Visual = DesktopBG;
Mouse.OverrideCursor = Cursors.Cross;
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
// 创建一个RenderTargetBitmap捕获窗口的内容
renderTargetBitmap = new RenderTargetBitmap((int)this.Width, (int)this.Height, 96, 96, PixelFormats.Pbgra32);
renderTargetBitmap.Render(this);
SetPixelAbout(null);
}
public void OnKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Escape)
@@ -93,9 +142,7 @@ namespace GeekDesk.Control.Windows
{
Mouse.OverrideCursor = null;
Point pos = e.MouseDevice.GetPosition(DesktopBG);
System.Drawing.Color colorD = bgBitmap.GetPixel((int)pos.X, (int)pos.Y);
colorPicker.SelectedBrush = new SolidColorBrush(Color.FromArgb(colorD.A, colorD.R, colorD.G, colorD.B));
DeleteObject(bgBitmap.GetHbitmap());
colorPicker.SelectedBrush = new SolidColorBrush(GetColorAtPosition(Mouse.GetPosition(this)));
this.Close();
ClickColorPickerToggleButton(colorPicker);
}
@@ -123,19 +170,27 @@ namespace GeekDesk.Control.Windows
[System.Runtime.InteropServices.DllImport("gdi32.dll")]
public static extern bool DeleteObject(IntPtr onj);
// Constants for DPI
private const int HORZRES = 8;
private const int VERTRES = 10;
private const int LOGPIXELSX = 88;
private const int LOGPIXELSY = 90;
private static float GetDpi(bool isX)
{
IntPtr hdc = WindowUtil.GetDC(IntPtr.Zero);
int dpi = isX ? WindowUtil.GetDeviceCaps(hdc, LOGPIXELSX) : WindowUtil.GetDeviceCaps(hdc, LOGPIXELSY);
WindowUtil.ReleaseDC(IntPtr.Zero, hdc);
return dpi / 96f;
}
private void SetPixelAbout(MouseEventArgs e)
{
VisualBrush b = (VisualBrush)PixelBG.Fill;
Point pos;
if (e == null)
{
pos = MouseUtil.GetMousePosition();
}
else
{
pos = e.MouseDevice.GetPosition(DesktopBG);
}
Point pos = Mouse.GetPosition(this);
Rect viewBox = b.Viewbox;
viewBox.Width = PIXEL_REC_LENGTH;
@@ -147,29 +202,59 @@ namespace GeekDesk.Control.Windows
double x = pos.X + 10;
double y = pos.Y + 10;
if (x + ColorCanvas.Width > SystemParameters.VirtualScreenWidth)
//获取缩放比例
double scale = ScreenUtil.GetScreenScalingFactor();
if (x + ColorCanvas.Width > this.Width / scale)
{
x = pos.X - ColorCanvas.Width - 10;
}
if (y + ColorCanvas.Height > SystemParameters.VirtualScreenHeight)
if (y + ColorCanvas.Height > this.Height / scale)
{
y = pos.Y - ColorCanvas.Height - 10;
}
Canvas.SetLeft(ColorCanvas, x);
Canvas.SetTop(ColorCanvas, y);
System.Drawing.Color dColor = bgBitmap.GetPixel((int)pos.X, (int)pos.Y);
PixelColor_HTML.Text = "#" + dColor.Name.ToUpper();
Color wColor = GetColorAtPosition(pos);
System.Drawing.Color dColor = System.Drawing.Color.FromArgb(wColor.A, wColor.R, wColor.G, wColor.B);
PixelColor_HTML.Text = "#" + dColor.Name.ToUpper().Substring(2);
PixelColor_RGB.Text = dColor.R + "," + dColor.G + "," + dColor.B;
Pixel_XY.Text = pos.X + "*" + pos.Y;
Pixel_XY.Text = (int)pos.X + "*" + (int)pos.Y;
SolidColorBrush scb = (SolidColorBrush)PixelColor.Fill;
scb.Color = Color.FromArgb(dColor.A, dColor.R, dColor.G, dColor.B);
scb.Color = wColor;
//scb.Color = Color.FromArgb(dColor.A, dColor.R, dColor.G, dColor.B);
}
private Color GetColorAtPosition(Point position)
{
// 使用CroppedBitmap裁剪出鼠标位置的一个像素
CroppedBitmap croppedBitmap = new CroppedBitmap(renderTargetBitmap, new Int32Rect((int)position.X, (int)position.Y, 1, 1));
// 将像素数据复制到数组中
byte[] pixels = new byte[4];
croppedBitmap.CopyPixels(pixels, 4, 0);
// 如果像素数据有效,则返回颜色
//if (pixels.Length == 4)
//{
//}
return Color.FromArgb(pixels[3], pixels[2], pixels[1], pixels[0]);
//return Color.FromArgb(0, 0, 0, 0);
}
/// <summary>
/// 滚轮控制缩放区域
/// </summary>
@@ -191,5 +276,18 @@ namespace GeekDesk.Control.Windows
SetPixelAbout(e);
}
/// <summary>
/// 右键按下
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Window_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
Mouse.OverrideCursor = null;
GlobalColorPickerWindow.ShowOrHide();
//关闭
this.Close();
}
}
}

View File

@@ -280,7 +280,7 @@ namespace GeekDesk.Control.Windows
}
window.Show();
Keyboard.Focus(window);
ShowWindowFollowMouse.Show(window, MousePosition.LEFT_CENTER, 0, 0, false);
ShowWindowFollowMouse.Show(window, MousePosition.LEFT_CENTER, 0, 0);
}

View File

@@ -12,6 +12,7 @@
Width="510"
WindowStyle="None"
Title=""
ResizeMode="NoResize"
AllowsTransparency="True"
Background="Transparent" ShowInTaskbar="False"
Focusable="True"
@@ -44,12 +45,13 @@
<TextBlock Text="待办任务:" Style="{StaticResource LeftTB}"/>
<TextBlock Text="*" Foreground="Red" />
</WrapPanel>
<TextBox x:Name="Title" Width="290" Text="{Binding Title, Mode=OneWay}" FontSize="14" />
<TextBox x:Name="Title" Style="{StaticResource MyTextBoxStyle}" Width="290" Text="{Binding Title, Mode=OneWay}" FontSize="14" />
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4" Margin="0,10,0,0">
<TextBlock Text="待办详情:" Style="{StaticResource LeftTB}"/>
<TextBox x:Name="Msg" TextWrapping="Wrap"
Style="{StaticResource MyTextBoxStyle}"
Margin="5,0,0,0"
Text="{Binding Msg, Mode=OneWay}"
AcceptsReturn="True"
@@ -60,11 +62,11 @@
<hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4" Margin="0,10,0,0">
<TextBlock Text="运行方式:" Style="{StaticResource LeftTB}"/>
<RadioButton Margin="10,0,0,0" Checked="ExecType_Checked" Tag="1" Background="{DynamicResource SecondaryRegionBrush}"
Style="{StaticResource RadioButtonIcon}" Content="指定时间"
<RadioButton Margin="10,0,0,0" Checked="ExecType_Checked" Tag="1"
Style="{StaticResource MyRadioBtnStyle}" Content="指定时间"
IsChecked="{Binding ExecType, Mode=OneWay, Converter={StaticResource TodoTaskExecConvert}, ConverterParameter=1}"/>
<RadioButton Margin="10,0,0,0" Checked="ExecType_Checked" Background="{DynamicResource SecondaryRegionBrush}" Tag="2"
Style="{StaticResource RadioButtonIcon}" Content="CRON表达式"
<RadioButton Margin="10,0,0,0" Checked="ExecType_Checked" Tag="2"
Style="{StaticResource MyRadioBtnStyle}" Content="CRON表达式"
IsChecked="{Binding ExecType, Mode=OneWay, Converter={StaticResource TodoTaskExecConvert}, ConverterParameter=2}"/>
</hc:UniformSpacingPanel>
@@ -73,7 +75,11 @@
<TextBlock Text="指定时间:" Style="{StaticResource LeftTB}"/>
<TextBlock Text="*" Foreground="Red"/>
</WrapPanel>
<hc:DateTimePicker x:Name="ExeTime" Text="{Binding ExeTime, Mode=OneWay}" ErrorStr="Error!" Width="200" Margin="1.6,0,0,0"/>
<hc:DateTimePicker x:Name="ExeTime" Text="{Binding ExeTime, Mode=OneWay}" Width="200" Margin="1.6,0,0,0">
<hc:DateTimePicker.Background>
<SolidColorBrush Color="White" Opacity="0.7"/>
</hc:DateTimePicker.Background>
</hc:DateTimePicker>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel x:Name="CronPanel" Height="30" Visibility="Collapsed" Spacing="10" Grid.ColumnSpan="4" Margin="0,10,0,0">
@@ -81,7 +87,7 @@
<TextBlock Text="CRON:" Style="{StaticResource LeftTB}"/>
<TextBlock Text="*" Foreground="Red" />
</WrapPanel>
<TextBox x:Name="Cron" Width="290" Text="{Binding Cron, Mode=OneWay}" FontSize="14" />
<TextBox x:Name="Cron" Style="{StaticResource MyTextBoxStyle}" Width="290" Text="{Binding Cron, Mode=OneWay}" FontSize="14" />
</hc:UniformSpacingPanel>
@@ -95,7 +101,7 @@
<hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,0" Grid.ColumnSpan="4">
<Button Content="保存" Style="{StaticResource Btn1}" Margin="320,6,-208,-10"
<Button Content="保存" Style="{StaticResource MyBtnStyle}" Margin="320,6,-208,-10"
Click="Save_Button_Click"/>
</hc:UniformSpacingPanel>
</StackPanel>

View File

@@ -178,7 +178,7 @@ namespace GeekDesk.Control.Windows
Growl.SuccessGlobal("设置待办任务成功, 系统将在 " + minutes + " 分钟后提醒您!");
}
CommonCode.SaveAppData(MainWindow.appData);
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
this.Close();
}

View File

@@ -10,6 +10,7 @@
Height="550"
Width="1000"
Title="Task"
ResizeMode="NoResize"
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent" ShowInTaskbar="False"
@@ -89,7 +90,7 @@
<Button Width="22" Height="22" Click="Close_Button_Click" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,10,0" Grid.Column="1"/>
<Button Content="新建待办"
Panel.ZIndex="1"
Style="{StaticResource Btn1}"
Style="{StaticResource MyBtnStyle}"
Grid.Column="1"
Margin="669,400,0,0"
Click="CreateBacklog_BtnClick" HorizontalAlignment="Left" VerticalAlignment="Top"/>

View File

@@ -2,6 +2,11 @@
using GeekDesk.Interface;
using GeekDesk.ViewModel;
using HandyControl.Controls;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reactive.Linq;
using System.Windows;
using System.Windows.Input;
@@ -19,6 +24,7 @@ namespace GeekDesk.Control.Windows
InitializeComponent();
RightCard.Content = backlog;
backlog.BacklogList.ItemsSource = appData.ToDoList;
backlog.type = ToDoType.NEW;
this.Topmost = true;
if (backlog.BacklogList.Items.Count > 0)
{
@@ -63,12 +69,21 @@ namespace GeekDesk.Control.Windows
{
case "History":
UFG.Visibility = Visibility.Collapsed;
//排序历史待办 倒序
List<ToDoInfo> list = appData.HiToDoList.OrderByDescending(v=>v.DoneTime).ToList();
appData.HiToDoList.Clear();
foreach (var item in list)
{
appData.HiToDoList.Add(item);
}
backlog.BacklogList.ItemsSource = appData.HiToDoList;
if (backlog.BacklogList.Items.Count > 0)
{
backlog.NoData.Visibility = Visibility.Collapsed;
backlog.BacklogList.Visibility = Visibility.Visible;
} else
}
else
{
backlog.NoData.Visibility = Visibility.Visible;
backlog.BacklogList.Visibility = Visibility.Collapsed;
@@ -109,9 +124,7 @@ namespace GeekDesk.Control.Windows
private static System.Windows.Window window = null;
#pragma warning disable CS0108 // “ToDoWindow.Show()”隐藏继承的成员“Window.Show()”。如果是有意隐藏,请使用关键字 new。
public static void Show()
#pragma warning restore CS0108 // “ToDoWindow.Show()”隐藏继承的成员“Window.Show()”。如果是有意隐藏,请使用关键字 new。
{
if (window == null || !window.Activate())
{

View File

@@ -10,6 +10,7 @@
WindowStyle="None"
AllowsTransparency="True"
Title=""
ResizeMode="NoResize"
Background="Transparent" ShowInTaskbar="False"
Focusable="True"
KeyDown="OnKeyDown">
@@ -28,7 +29,7 @@
<TextBlock Margin="10" x:Name="MsgTitle" TextWrapping="Wrap" FontSize="16" HorizontalAlignment="Left" Style="{DynamicResource TextBlockLargeBold}" Text="测试"/>
<Button HorizontalAlignment="Right" Margin="0,0,10,0"
Content="去点个Star" Click="StarBtnClick"
Style="{StaticResource Btn1}"
Style="{StaticResource MyBtnStyle}"
hc:IconElement.Geometry="M718.565517 863.126069c-7.344552 0-15.077517-2.189241-22.987034-6.285241L512 760.337655l-183.613793 96.503173c-18.785103 9.851586-37.499586 7.521103-48.16331-5.12-5.12-6.10869-10.557793-17.125517-7.485794-35.345656l35.063173-204.411586L159.249655 467.155862c-12.747034-12.393931-17.584552-27.153655-13.241379-40.430345 4.343172-13.312 16.913655-22.386759 34.568827-24.929103l205.223725-29.837242 91.806896-185.979586c7.874207-15.995586 20.409379-25.140966 34.392276-25.140965 13.947586 0 26.482759 9.145379 34.392276 25.140965l91.771586 185.979586 205.259035 29.837242c17.619862 2.577655 30.190345 11.652414 34.498206 24.964414 4.378483 13.27669-0.529655 28.001103-13.241379 40.430344l-148.51531 144.807725 35.063172 204.411586c3.10731 18.149517-2.365793 29.272276-7.485793 35.345655a32.273655 32.273655 0 0 1-25.176276 11.369931z"
/>
</hc:SimplePanel>
@@ -55,8 +56,8 @@
</hc:Card.Footer>
</hc:Card>
<hc:UniformSpacingPanel Spacing="100" HorizontalAlignment="Center" Margin="0,10,0,0">
<Button Content="暂不更新" Click="Close_Click" Style="{StaticResource Btn1}"/>
<Button Content="前往更新" Click="Confirm_Click" Style="{StaticResource Btn1}"/>
<Button Style="{StaticResource MyBtnStyle}" Content="暂不更新" Click="Close_Click"/>
<Button Style="{StaticResource MyBtnStyle}" Content="前往更新" Click="Confirm_Click"/>
</hc:UniformSpacingPanel>
</StackPanel>

View File

@@ -0,0 +1,39 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace GeekDesk.Converts
{
internal class Boolean2VisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
bool param = false;
if (value != null)
{
param = (bool)value;
}
if (param)
{
return Visibility.Visible;
} else
{
return (Visibility)parameter;
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if ((bool)value)
{
return Visibility.Visible;
}
else
{
return Visibility.Hidden;
}
}
}
}

View File

@@ -0,0 +1,54 @@
using GeekDesk.Constant;
using GeekDesk.ViewModel;
using System;
using System.Globalization;
using System.Windows.Data;
namespace GeekDesk.Converts
{
/// <summary>
/// 根据主窗口width 和传入类型 获取其它宽度
/// </summary>
class GetWidthByWWConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
WidthTypeEnum type = (WidthTypeEnum)parameter;
AppConfig config = MainWindow.appData.AppConfig;
if (WidthTypeEnum.LEFT_CARD == type)
{
return config.MenuCardWidth;
}
else if (WidthTypeEnum.RIGHT_CARD == type)
{
return config.WindowWidth - config.MenuCardWidth;
} else if (WidthTypeEnum.RIGHT_CARD_HALF == type)
{
return (config.WindowWidth - config.MenuCardWidth) * 0.618;
} else if (WidthTypeEnum.RIGHT_CARD_HALF_TEXT == type)
{
return (config.WindowWidth - config.MenuCardWidth) * 0.618 - config.ImageWidth - 20;
} else if (WidthTypeEnum.RIGHT_CARD_20 == type)
{
return (config.WindowWidth - config.MenuCardWidth) - 20;
}
else if (WidthTypeEnum.RIGHT_CARD_40 == type)
{
return (config.WindowWidth - config.MenuCardWidth) - 40;
}
else if (WidthTypeEnum.RIGHT_CARD_70 == type)
{
return (config.WindowWidth - config.MenuCardWidth) - 70;
}
return config.WindowWidth;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}

View File

@@ -10,12 +10,21 @@ namespace GeekDesk.Converts
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
int val = int.Parse(value.ToString());
var param = 0;
if (parameter != null)
{
param = int.Parse(parameter.ToString());
}
if (val + param > 0)
{
val += param;
}
return new CornerRadius(val);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
return null;
}
}
}

View File

@@ -0,0 +1,22 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace GeekDesk.Converts
{
internal class ReverseBoolConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null) return null;
bool val = (bool)value;
return !val;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -8,7 +8,10 @@ namespace GeekDesk.Converts
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null) return null;
if (value == null)
{
value = "";
}
if (parameter == null)
{
return value.ToString();
@@ -16,7 +19,14 @@ namespace GeekDesk.Converts
else
{
string val = value.ToString();
if (string.IsNullOrEmpty(val))
{
return parameter.ToString()
.Replace("\\n", "")
.Replace("{}", "");
}
string param = parameter.ToString();
param = param.Replace("\\n", "\n");
return param.Replace("{}", val);
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;
namespace GeekDesk.Converts
{
internal class TextToColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
{
return null;
}
string str = value as string;
return new SolidColorBrush((Color)ColorConverter.ConvertFromString(str));
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
{
return null;
}
string str = value as string;
return new SolidColorBrush((Color)ColorConverter.ConvertFromString(str));
}
}
}

32
Converts/ValueConvert.cs Normal file
View File

@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace GeekDesk.Converts
{
internal class ValueConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool) {
Dictionary<bool, string> dict = (Dictionary<bool, string>)parameter;
bool val = (bool)value;
return dict[val];
}
return null;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool)
{
Dictionary<bool, string> dict = (Dictionary<bool, string>)parameter;
bool val = (bool)value;
return dict[val];
}
return null;
}
}
}

View File

@@ -9,14 +9,14 @@ namespace GeekDesk.Converts
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if ((Visibility)value == Visibility.Visible)
if (parameter == null)
{
return true;
}
else
return (Visibility)value == Visibility.Visible;
} else
{
return false;
return !((Visibility)value == Visibility.Visible);
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)

View File

@@ -21,6 +21,7 @@ namespace DraggAnimatedPanel
#endregion
static DraggAnimatedPanel()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(DraggAnimatedPanel), new FrameworkPropertyMetadata(typeof(DraggAnimatedPanel)));
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GeekDesk.CustomComponent.VirtualizingWrapPanel
{
public struct ItemRange
{
public int StartIndex { get; }
public int EndIndex { get; }
public ItemRange(int startIndex, int endIndex) : this()
{
StartIndex = startIndex;
EndIndex = endIndex;
}
public bool Contains(int itemIndex)
{
return itemIndex >= StartIndex && itemIndex <= EndIndex;
}
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GeekDesk.CustomComponent.VirtualizingWrapPanel
{
public enum ScrollDirection
{
Vertical,
Horizontal
}
}

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GeekDesk.CustomComponent.VirtualizingWrapPanel
{
public enum SpacingMode
{
/// <summary>
/// Spacing is disabled and all items will be arranged as closely as possible.
/// </summary>
None,
/// <summary>
/// The remaining space is evenly distributed between the items on a layout row, as well as the start and end of each row.
/// </summary>
Uniform,
/// <summary>
/// The remaining space is evenly distributed between the items on a layout row, excluding the start and end of each row.
/// </summary>
BetweenItemsOnly,
/// <summary>
/// The remaining space is evenly distributed between start and end of each row.
/// </summary>
StartAndEndOnly
}
}

View File

@@ -0,0 +1,492 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls.Primitives;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows;
namespace GeekDesk.CustomComponent.VirtualizingWrapPanel
{
public abstract class VirtualizingPanelBase : VirtualizingPanel, IScrollInfo
{
public static readonly DependencyProperty ScrollLineDeltaProperty = DependencyProperty.Register(nameof(ScrollLineDelta), typeof(double), typeof(VirtualizingPanelBase), new FrameworkPropertyMetadata(16.0));
public static readonly DependencyProperty MouseWheelDeltaProperty = DependencyProperty.Register(nameof(MouseWheelDelta), typeof(double), typeof(VirtualizingPanelBase), new FrameworkPropertyMetadata(48.0));
public static readonly DependencyProperty ScrollLineDeltaItemProperty = DependencyProperty.Register(nameof(ScrollLineDeltaItem), typeof(int), typeof(VirtualizingPanelBase), new FrameworkPropertyMetadata(1));
public static readonly DependencyProperty MouseWheelDeltaItemProperty = DependencyProperty.Register(nameof(MouseWheelDeltaItem), typeof(int), typeof(VirtualizingPanelBase), new FrameworkPropertyMetadata(3));
private ScrollViewer scrollOwner;
public ScrollViewer GetScrollOwner()
{
return scrollOwner;
}
public void SetScrollOwner(ScrollViewer value)
{
scrollOwner = value;
}
public bool CanVerticallyScroll { get; set; }
public bool CanHorizontallyScroll { get; set; }
protected override bool CanHierarchicallyScrollAndVirtualizeCore => true;
/// <summary>
/// Scroll line delta for pixel based scrolling. The default value is 16 dp.
/// </summary>
public double ScrollLineDelta { get => (double)GetValue(ScrollLineDeltaProperty); set => SetValue(ScrollLineDeltaProperty, value); }
/// <summary>
/// Mouse wheel delta for pixel based scrolling. The default value is 48 dp.
/// </summary>
public double MouseWheelDelta { get => (double)GetValue(MouseWheelDeltaProperty); set => SetValue(MouseWheelDeltaProperty, value); }
/// <summary>
/// Scroll line delta for item based scrolling. The default value is 1 item.
/// </summary>
public double ScrollLineDeltaItem { get => (int)GetValue(ScrollLineDeltaItemProperty); set => SetValue(ScrollLineDeltaItemProperty, value); }
/// <summary>
/// Mouse wheel delta for item based scrolling. The default value is 3 items.
/// </summary>
public int MouseWheelDeltaItem { get => (int)GetValue(MouseWheelDeltaItemProperty); set => SetValue(MouseWheelDeltaItemProperty, value); }
protected ScrollUnit ScrollUnit => GetScrollUnit(ItemsControl);
/// <summary>
/// The direction in which the panel scrolls when user turns the mouse wheel.
/// </summary>
protected ScrollDirection MouseWheelScrollDirection { get; set; } = ScrollDirection.Vertical;
protected bool IsVirtualizing => GetIsVirtualizing(ItemsControl);
protected VirtualizationMode VirtualizationMode => GetVirtualizationMode(ItemsControl);
/// <summary>
/// Returns true if the panel is in VirtualizationMode.Recycling, otherwise false.
/// </summary>
protected bool IsRecycling => VirtualizationMode == VirtualizationMode.Recycling;
/// <summary>
/// The cache length before and after the viewport.
/// </summary>
protected VirtualizationCacheLength CacheLength { get; private set; }
/// <summary>
/// The Unit of the cache length. Can be Pixel, Item or Page.
/// When the ItemsOwner is a group item it can only be pixel or item.
/// </summary>
protected VirtualizationCacheLengthUnit CacheLengthUnit { get; private set; }
/// <summary>
/// The ItemsControl (e.g. ListView).
/// </summary>
protected ItemsControl ItemsControl => ItemsControl.GetItemsOwner(this);
/// <summary>
/// The ItemsControl (e.g. ListView) or if the ItemsControl is grouping a GroupItem.
/// </summary>
protected DependencyObject ItemsOwner
{
get
{
if (ItemsOwner1 is null)
{
/* Use reflection to access internal method because the public
* GetItemsOwner method does always return the itmes control instead
* of the real items owner for example the group item when grouping */
MethodInfo getItemsOwnerInternalMethod = typeof(ItemsControl).GetMethod(
"GetItemsOwnerInternal",
BindingFlags.Static | BindingFlags.NonPublic,
null,
new Type[] { typeof(DependencyObject) },
null
);
ItemsOwner1 = (DependencyObject)getItemsOwnerInternalMethod.Invoke(null, new object[] { this });
}
return ItemsOwner1;
}
}
private DependencyObject _itemsOwner;
protected ReadOnlyCollection<object> Items => ((ItemContainerGenerator)ItemContainerGenerator).Items;
protected new IRecyclingItemContainerGenerator ItemContainerGenerator
{
get
{
if (_itemContainerGenerator is null)
{
/* Because of a bug in the framework the ItemContainerGenerator
* is null until InternalChildren accessed at least one time. */
var children = InternalChildren;
_itemContainerGenerator = (IRecyclingItemContainerGenerator)base.ItemContainerGenerator;
}
return _itemContainerGenerator;
}
}
private IRecyclingItemContainerGenerator _itemContainerGenerator;
public double ExtentWidth => Extent.Width;
public double ExtentHeight => Extent.Height;
protected Size Extent { get; private set; } = new Size(0, 0);
public double HorizontalOffset => Offset.X;
public double VerticalOffset => Offset.Y;
protected Size Viewport { get; private set; } = new Size(0, 0);
public double ViewportWidth => Viewport.Width;
public double ViewportHeight => Viewport.Height;
protected Point Offset { get; private set; } = new Point(0, 0);
/// <summary>
/// The range of items that a realized in viewport or cache.
/// </summary>
protected ItemRange ItemRange { get; set; }
public ScrollViewer ScrollOwner { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public DependencyObject ItemsOwner1 { get => _itemsOwner; set => _itemsOwner = value; }
private Visibility previousVerticalScrollBarVisibility = Visibility.Collapsed;
private Visibility previousHorizontalScrollBarVisibility = Visibility.Collapsed;
protected virtual void UpdateScrollInfo(Size availableSize, Size extent)
{
bool invalidateScrollInfo = false;
if (extent != Extent)
{
Extent = extent;
invalidateScrollInfo = true;
}
if (availableSize != Viewport)
{
Viewport = availableSize;
invalidateScrollInfo = true;
}
if (ViewportHeight != 0 && VerticalOffset != 0 && VerticalOffset + ViewportHeight + 1 >= ExtentHeight)
{
Offset = new Point(Offset.X, extent.Height - availableSize.Height);
invalidateScrollInfo = true;
}
if (ViewportWidth != 0 && HorizontalOffset != 0 && HorizontalOffset + ViewportWidth + 1 >= ExtentWidth)
{
Offset = new Point(extent.Width - availableSize.Width, Offset.Y);
invalidateScrollInfo = true;
}
if (invalidateScrollInfo)
{
GetScrollOwner()?.InvalidateScrollInfo();
}
}
public virtual Rect MakeVisible(Visual visual, Rect rectangle)
{
Point pos = visual.TransformToAncestor(this).Transform(Offset);
double scrollAmountX = 0;
double scrollAmountY = 0;
if (pos.X < Offset.X)
{
scrollAmountX = -(Offset.X - pos.X);
}
else if ((pos.X + rectangle.Width) > (Offset.X + Viewport.Width))
{
double notVisibleX = (pos.X + rectangle.Width) - (Offset.X + Viewport.Width);
double maxScrollX = pos.X - Offset.X; // keep left of the visual visible
scrollAmountX = Math.Min(notVisibleX, maxScrollX);
}
if (pos.Y < Offset.Y)
{
scrollAmountY = -(Offset.Y - pos.Y);
}
else if ((pos.Y + rectangle.Height) > (Offset.Y + Viewport.Height))
{
double notVisibleY = (pos.Y + rectangle.Height) - (Offset.Y + Viewport.Height);
double maxScrollY = pos.Y - Offset.Y; // keep top of the visual visible
scrollAmountY = Math.Min(notVisibleY, maxScrollY);
}
SetHorizontalOffset(Offset.X + scrollAmountX);
SetVerticalOffset(Offset.Y + scrollAmountY);
double visibleRectWidth = Math.Min(rectangle.Width, Viewport.Width);
double visibleRectHeight = Math.Min(rectangle.Height, Viewport.Height);
return new Rect(scrollAmountX, scrollAmountY, visibleRectWidth, visibleRectHeight);
}
protected override void OnItemsChanged(object sender, ItemsChangedEventArgs args)
{
switch (args.Action)
{
case NotifyCollectionChangedAction.Remove:
case NotifyCollectionChangedAction.Replace:
RemoveInternalChildRange(args.Position.Index, args.ItemUICount);
break;
case NotifyCollectionChangedAction.Move:
RemoveInternalChildRange(args.OldPosition.Index, args.ItemUICount);
break;
}
}
protected int GetItemIndexFromChildIndex(int childIndex)
{
var generatorPosition = GetGeneratorPositionFromChildIndex(childIndex);
return ItemContainerGenerator.IndexFromGeneratorPosition(generatorPosition);
}
protected virtual GeneratorPosition GetGeneratorPositionFromChildIndex(int childIndex)
{
return new GeneratorPosition(childIndex, 0);
}
protected override Size MeasureOverride(Size availableSize)
{
/* Sometimes when scrolling the scrollbar gets hidden without any reason. In this case the "IsMeasureValid"
* property of the ScrollOwner is false. To prevent a infinite circle the mesasure call is ignored. */
if (GetScrollOwner() != null)
{
bool verticalScrollBarGotHidden = GetScrollOwner().VerticalScrollBarVisibility == ScrollBarVisibility.Auto
&& GetScrollOwner().ComputedVerticalScrollBarVisibility != Visibility.Visible
&& GetScrollOwner().ComputedVerticalScrollBarVisibility != previousVerticalScrollBarVisibility;
bool horizontalScrollBarGotHidden = GetScrollOwner().HorizontalScrollBarVisibility == ScrollBarVisibility.Auto
&& GetScrollOwner().ComputedHorizontalScrollBarVisibility != Visibility.Visible
&& GetScrollOwner().ComputedHorizontalScrollBarVisibility != previousHorizontalScrollBarVisibility;
previousVerticalScrollBarVisibility = GetScrollOwner().ComputedVerticalScrollBarVisibility;
previousHorizontalScrollBarVisibility = GetScrollOwner().ComputedHorizontalScrollBarVisibility;
if (!GetScrollOwner().IsMeasureValid && verticalScrollBarGotHidden || horizontalScrollBarGotHidden)
{
return availableSize;
}
}
var groupItem = ItemsOwner as IHierarchicalVirtualizationAndScrollInfo;
Size extent;
Size desiredSize;
if (groupItem != null)
{
/* If the ItemsOwner is a group item the availableSize is ifinity.
* Therfore the vieport size provided by the group item is used. */
var viewportSize = groupItem.Constraints.Viewport.Size;
var headerSize = groupItem.HeaderDesiredSizes.PixelSize;
double availableWidth = Math.Max(viewportSize.Width - 5, 0); // left margin of 5 dp
double availableHeight = Math.Max(viewportSize.Height - headerSize.Height, 0);
availableSize = new Size(availableWidth, availableHeight);
extent = CalculateExtent(availableSize);
desiredSize = new Size(extent.Width, extent.Height);
Extent = extent;
Offset = groupItem.Constraints.Viewport.Location;
Viewport = groupItem.Constraints.Viewport.Size;
CacheLength = groupItem.Constraints.CacheLength;
CacheLengthUnit = groupItem.Constraints.CacheLengthUnit; // can be Item or Pixel
}
else
{
extent = CalculateExtent(availableSize);
double desiredWidth = Math.Min(availableSize.Width, extent.Width);
double desiredHeight = Math.Min(availableSize.Height, extent.Height);
desiredSize = new Size(desiredWidth, desiredHeight);
UpdateScrollInfo(desiredSize, extent);
CacheLength = GetCacheLength(ItemsOwner);
CacheLengthUnit = GetCacheLengthUnit(ItemsOwner); // can be Page, Item or Pixel
}
ItemRange = UpdateItemRange();
RealizeItems();
VirtualizeItems();
return desiredSize;
}
/// <summary>
/// Realizes visible and cached items.
/// </summary>
protected virtual void RealizeItems()
{
var startPosition = ItemContainerGenerator.GeneratorPositionFromIndex(ItemRange.StartIndex);
int childIndex = startPosition.Offset == 0 ? startPosition.Index : startPosition.Index + 1;
using (ItemContainerGenerator.StartAt(startPosition, GeneratorDirection.Forward, true))
{
for (int i = ItemRange.StartIndex; i <= ItemRange.EndIndex; i++, childIndex++)
{
UIElement child = (UIElement)ItemContainerGenerator.GenerateNext(out bool isNewlyRealized);
if (isNewlyRealized || /*recycled*/!InternalChildren.Contains(child))
{
if (childIndex >= InternalChildren.Count)
{
AddInternalChild(child);
}
else
{
InsertInternalChild(childIndex, child);
}
ItemContainerGenerator.PrepareItemContainer(child);
child.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
}
if (child is IHierarchicalVirtualizationAndScrollInfo groupItem)
{
groupItem.Constraints = new HierarchicalVirtualizationConstraints(
new VirtualizationCacheLength(0),
VirtualizationCacheLengthUnit.Item,
new Rect(0, 0, ViewportWidth, ViewportHeight));
child.Measure(new Size(ViewportWidth, ViewportHeight));
}
}
}
}
/// <summary>
/// Virtualizes (cleanups) no longer visible or cached items.
/// </summary>
protected virtual void VirtualizeItems()
{
for (int childIndex = InternalChildren.Count - 1; childIndex >= 0; childIndex--)
{
var generatorPosition = GetGeneratorPositionFromChildIndex(childIndex);
int itemIndex = ItemContainerGenerator.IndexFromGeneratorPosition(generatorPosition);
if (itemIndex != -1 && !ItemRange.Contains(itemIndex))
{
if (VirtualizationMode == VirtualizationMode.Recycling)
{
ItemContainerGenerator.Recycle(generatorPosition, 1);
}
else
{
ItemContainerGenerator.Remove(generatorPosition, 1);
}
RemoveInternalChildRange(childIndex, 1);
}
}
}
/// <summary>
/// Calculates the extent that would be needed to show all items.
/// </summary>
protected abstract Size CalculateExtent(Size availableSize);
/// <summary>
/// Calculates the item range that is visible in the viewport or cached.
/// </summary>
protected abstract ItemRange UpdateItemRange();
public void SetVerticalOffset(double offset)
{
if (offset < 0 || Viewport.Height >= Extent.Height)
{
offset = 0;
}
else if (offset + Viewport.Height >= Extent.Height)
{
offset = Extent.Height - Viewport.Height;
}
Offset = new Point(Offset.X, offset);
GetScrollOwner()?.InvalidateScrollInfo();
InvalidateMeasure();
}
public void SetHorizontalOffset(double offset)
{
if (offset < 0 || Viewport.Width >= Extent.Width)
{
offset = 0;
}
else if (offset + Viewport.Width >= Extent.Width)
{
offset = Extent.Width - Viewport.Width;
}
Offset = new Point(offset, Offset.Y);
GetScrollOwner()?.InvalidateScrollInfo();
InvalidateMeasure();
}
protected void ScrollVertical(double amount)
{
SetVerticalOffset(VerticalOffset + amount);
}
protected void ScrollHorizontal(double amount)
{
SetHorizontalOffset(HorizontalOffset + amount);
}
public void LineUp() => ScrollVertical(ScrollUnit == ScrollUnit.Pixel ? -ScrollLineDelta : GetLineUpScrollAmount());
public void LineDown() => ScrollVertical(ScrollUnit == ScrollUnit.Pixel ? ScrollLineDelta : GetLineDownScrollAmount());
public void LineLeft() => ScrollHorizontal(ScrollUnit == ScrollUnit.Pixel ? -ScrollLineDelta : GetLineLeftScrollAmount());
public void LineRight() => ScrollHorizontal(ScrollUnit == ScrollUnit.Pixel ? ScrollLineDelta : GetLineRightScrollAmount());
public void MouseWheelUp()
{
if (MouseWheelScrollDirection == ScrollDirection.Vertical)
{
ScrollVertical(ScrollUnit == ScrollUnit.Pixel ? -MouseWheelDelta : GetMouseWheelUpScrollAmount());
}
else
{
MouseWheelLeft();
}
}
public void MouseWheelDown()
{
if (MouseWheelScrollDirection == ScrollDirection.Vertical)
{
ScrollVertical(ScrollUnit == ScrollUnit.Pixel ? MouseWheelDelta : GetMouseWheelDownScrollAmount());
}
else
{
MouseWheelRight();
}
}
public void MouseWheelLeft() => ScrollHorizontal(ScrollUnit == ScrollUnit.Pixel ? -MouseWheelDelta : GetMouseWheelLeftScrollAmount());
public void MouseWheelRight() => ScrollHorizontal(ScrollUnit == ScrollUnit.Pixel ? MouseWheelDelta : GetMouseWheelRightScrollAmount());
public void PageUp() => ScrollVertical(ScrollUnit == ScrollUnit.Pixel ? -ViewportHeight : GetPageUpScrollAmount());
public void PageDown() => ScrollVertical(ScrollUnit == ScrollUnit.Pixel ? ViewportHeight : GetPageDownScrollAmount());
public void PageLeft() => ScrollHorizontal(ScrollUnit == ScrollUnit.Pixel ? -ViewportHeight : GetPageLeftScrollAmount());
public void PageRight() => ScrollHorizontal(ScrollUnit == ScrollUnit.Pixel ? ViewportHeight : GetPageRightScrollAmount());
protected abstract double GetLineUpScrollAmount();
protected abstract double GetLineDownScrollAmount();
protected abstract double GetLineLeftScrollAmount();
protected abstract double GetLineRightScrollAmount();
protected abstract double GetMouseWheelUpScrollAmount();
protected abstract double GetMouseWheelDownScrollAmount();
protected abstract double GetMouseWheelLeftScrollAmount();
protected abstract double GetMouseWheelRightScrollAmount();
protected abstract double GetPageUpScrollAmount();
protected abstract double GetPageDownScrollAmount();
protected abstract double GetPageLeftScrollAmount();
protected abstract double GetPageRightScrollAmount();
}
}

View File

@@ -0,0 +1,474 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls.Primitives;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows;
using GeekDesk.CustomComponent.VirtualizingWrapPanel;
namespace GeekDesk.CustomComponent.VirtualizingWrapPanel
{
public class VirtualizingWrapPanel : VirtualizingPanelBase
{
#region Deprecated properties
[Obsolete("Use SpacingMode")]
public static readonly DependencyProperty IsSpacingEnabledProperty = DependencyProperty.Register(nameof(IsSpacingEnabled), typeof(bool), typeof(VirtualizingWrapPanel), new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.AffectsMeasure));
[Obsolete("Use IsSpacingEnabled")]
public bool SpacingEnabled { get => IsSpacingEnabled; set => IsSpacingEnabled = value; }
/// <summary>
/// Gets or sets a value that specifies whether the items are distributed evenly across the width (horizontal orientation)
/// or height (vertical orientation). The default value is true.
/// </summary>
[Obsolete("Use SpacingMode")]
public bool IsSpacingEnabled { get => (bool)GetValue(IsSpacingEnabledProperty); set => SetValue(IsSpacingEnabledProperty, value); }
[Obsolete("Use ItemSize")]
public Size ChildrenSize { get => ItemSize; set => ItemSize = value; }
#endregion
public static readonly DependencyProperty SpacingModeProperty = DependencyProperty.Register(nameof(SpacingMode), typeof(SpacingMode), typeof(VirtualizingWrapPanel), new FrameworkPropertyMetadata(SpacingMode.Uniform, FrameworkPropertyMetadataOptions.AffectsMeasure));
public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(nameof(Orientation), typeof(Orientation), typeof(VirtualizingWrapPanel), new FrameworkPropertyMetadata(Orientation.Vertical, FrameworkPropertyMetadataOptions.AffectsMeasure, (obj, args) => ((VirtualizingWrapPanel)obj).Orientation_Changed()));
public static readonly DependencyProperty ItemSizeProperty = DependencyProperty.Register(nameof(ItemSize), typeof(Size), typeof(VirtualizingWrapPanel), new FrameworkPropertyMetadata(Size.Empty, FrameworkPropertyMetadataOptions.AffectsMeasure));
public static readonly DependencyProperty StretchItemsProperty = DependencyProperty.Register(nameof(StretchItems), typeof(bool), typeof(VirtualizingWrapPanel), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsArrange));
/// <summary>
/// Gets or sets the spacing mode used when arranging the items. The default value is <see cref="SpacingMode.Uniform"/>.
/// </summary>
public SpacingMode SpacingMode { get => (SpacingMode)GetValue(SpacingModeProperty); set => SetValue(SpacingModeProperty, value); }
/// <summary>
/// Gets or sets a value that specifies the orientation in which items are arranged. The default value is <see cref="Orientation.Vertical"/>.
/// </summary>
public Orientation Orientation { get => (Orientation)GetValue(OrientationProperty); set => SetValue(OrientationProperty, value); }
/// <summary>
/// Gets or sets a value that specifies the size of the items. The default value is <see cref="Size.Empty"/>.
/// If the value is <see cref="Size.Empty"/> the size of the items gots measured by the first realized item.
/// </summary>
public Size ItemSize { get => (Size)GetValue(ItemSizeProperty); set => SetValue(ItemSizeProperty, value); }
/// <summary>
/// Gets or sets a value that specifies if the items get stretched to fill up remaining space. The default value is false.
/// </summary>
/// <remarks>
/// The MaxWidth and MaxHeight properties of the ItemContainerStyle can be used to limit the stretching.
/// In this case the use of the remaining space will be determined by the SpacingMode property.
/// </remarks>
public bool StretchItems { get => (bool)GetValue(StretchItemsProperty); set => SetValue(StretchItemsProperty, value); }
protected Size childSize;
protected int rowCount;
protected int itemsPerRowCount;
private void Orientation_Changed()
{
MouseWheelScrollDirection = Orientation == Orientation.Vertical ? ScrollDirection.Vertical : ScrollDirection.Horizontal;
}
protected override Size MeasureOverride(Size availableSize)
{
UpdateChildSize(availableSize);
return base.MeasureOverride(availableSize);
}
private void UpdateChildSize(Size availableSize)
{
if (ItemsOwner is IHierarchicalVirtualizationAndScrollInfo groupItem
&& VirtualizingPanel.GetIsVirtualizingWhenGrouping(ItemsControl))
{
if (Orientation == Orientation.Vertical)
{
availableSize.Width = groupItem.Constraints.Viewport.Size.Width;
availableSize.Width = Math.Max(availableSize.Width - (Margin.Left + Margin.Right), 0);
}
else
{
availableSize.Height = groupItem.Constraints.Viewport.Size.Height;
availableSize.Height = Math.Max(availableSize.Height - (Margin.Top + Margin.Bottom), 0);
}
}
if (ItemSize != Size.Empty)
{
childSize = ItemSize;
}
else if (InternalChildren.Count != 0)
{
childSize = InternalChildren[0].DesiredSize;
}
else
{
childSize = CalculateChildSize(availableSize);
}
if (double.IsInfinity(GetWidth(availableSize)))
{
itemsPerRowCount = Items.Count;
}
else
{
itemsPerRowCount = Math.Max(1, (int)Math.Floor(GetWidth(availableSize) / GetWidth(childSize)));
}
rowCount = (int)Math.Ceiling((double)Items.Count / itemsPerRowCount);
}
private Size CalculateChildSize(Size availableSize)
{
if (Items.Count == 0)
{
return new Size(0, 0);
}
var startPosition = ItemContainerGenerator.GeneratorPositionFromIndex(0);
using (ItemContainerGenerator.StartAt(startPosition, GeneratorDirection.Forward, true))
{
var child = (UIElement)ItemContainerGenerator.GenerateNext();
AddInternalChild(child);
ItemContainerGenerator.PrepareItemContainer(child);
child.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
return child.DesiredSize;
}
}
protected override Size CalculateExtent(Size availableSize)
{
double extentWidth = IsSpacingEnabled && SpacingMode != SpacingMode.None && !double.IsInfinity(GetWidth(availableSize))
? GetWidth(availableSize)
: GetWidth(childSize) * itemsPerRowCount;
if (ItemsOwner is IHierarchicalVirtualizationAndScrollInfo groupItem)
{
if (Orientation == Orientation.Vertical)
{
extentWidth = Math.Max(extentWidth - (Margin.Left + Margin.Right), 0);
}
else
{
extentWidth = Math.Max(extentWidth - (Margin.Top + Margin.Bottom), 0);
}
}
double extentHeight = GetHeight(childSize) * rowCount;
return CreateSize(extentWidth, extentHeight);
}
protected void CalculateSpacing(Size finalSize, out double innerSpacing, out double outerSpacing)
{
Size childSize = CalculateChildArrangeSize(finalSize);
double finalWidth = GetWidth(finalSize);
double totalItemsWidth = Math.Min(GetWidth(childSize) * itemsPerRowCount, finalWidth);
double unusedWidth = finalWidth - totalItemsWidth;
SpacingMode spacingMode = IsSpacingEnabled ? SpacingMode : SpacingMode.None;
switch (spacingMode)
{
case SpacingMode.Uniform:
innerSpacing = outerSpacing = unusedWidth / (itemsPerRowCount + 1);
break;
case SpacingMode.BetweenItemsOnly:
innerSpacing = unusedWidth / Math.Max(itemsPerRowCount - 1, 1);
outerSpacing = 0;
break;
case SpacingMode.StartAndEndOnly:
innerSpacing = 0;
outerSpacing = unusedWidth / 2;
break;
case SpacingMode.None:
default:
innerSpacing = 0;
outerSpacing = 0;
break;
}
}
protected override Size ArrangeOverride(Size finalSize)
{
double offsetX = GetX(Offset);
double offsetY = GetY(Offset);
/* When the items owner is a group item offset is handled by the parent panel. */
if (ItemsOwner is IHierarchicalVirtualizationAndScrollInfo groupItem)
{
offsetY = 0;
}
Size childSize = CalculateChildArrangeSize(finalSize);
CalculateSpacing(finalSize, out double innerSpacing, out double outerSpacing);
for (int childIndex = 0; childIndex < InternalChildren.Count; childIndex++)
{
UIElement child = InternalChildren[childIndex];
int itemIndex = GetItemIndexFromChildIndex(childIndex);
int columnIndex = itemIndex % itemsPerRowCount;
int rowIndex = itemIndex / itemsPerRowCount;
double x = outerSpacing + columnIndex * (GetWidth(childSize) + innerSpacing);
double y = rowIndex * GetHeight(childSize);
if (GetHeight(finalSize) == 0.0)
{
/* When the parent panel is grouping and a cached group item is not
* in the viewport it has no valid arrangement. That means that the
* height/width is 0. Therefore the items should not be visible so
* that they are not falsely displayed. */
child.Arrange(new Rect(0, 0, 0, 0));
}
else
{
child.Arrange(CreateRect(x - offsetX, y - offsetY, childSize.Width, childSize.Height));
}
}
return finalSize;
}
protected Size CalculateChildArrangeSize(Size finalSize)
{
if (StretchItems)
{
if (Orientation == Orientation.Vertical)
{
double childMaxWidth = ReadItemContainerStyle(MaxWidthProperty, double.PositiveInfinity);
double maxPossibleChildWith = finalSize.Width / itemsPerRowCount;
double childWidth = Math.Min(maxPossibleChildWith, childMaxWidth);
return new Size(childWidth, childSize.Height);
}
else
{
double childMaxHeight = ReadItemContainerStyle(MaxHeightProperty, double.PositiveInfinity);
double maxPossibleChildHeight = finalSize.Height / itemsPerRowCount;
double childHeight = Math.Min(maxPossibleChildHeight, childMaxHeight);
return new Size(childSize.Width, childHeight);
}
}
else
{
return childSize;
}
}
private T ReadItemContainerStyle<T>(DependencyProperty property, T fallbackValue)
{
var value = ItemsControl.ItemContainerStyle?.Setters.OfType<Setter>()
.FirstOrDefault(setter => setter.Property == property)?.Value;
return (T)(value ?? fallbackValue);
}
protected override ItemRange UpdateItemRange()
{
if (!IsVirtualizing)
{
return new ItemRange(0, Items.Count - 1);
}
int startIndex;
int endIndex;
if (ItemsOwner is IHierarchicalVirtualizationAndScrollInfo groupItem)
{
if (!VirtualizingPanel.GetIsVirtualizingWhenGrouping(ItemsControl))
{
return new ItemRange(0, Items.Count - 1);
}
var offset = new Point(Offset.X, groupItem.Constraints.Viewport.Location.Y);
int offsetRowIndex;
double offsetInPixel;
int rowCountInViewport;
if (ScrollUnit == ScrollUnit.Item)
{
offsetRowIndex = GetY(offset) >= 1 ? (int)GetY(offset) - 1 : 0; // ignore header
offsetInPixel = offsetRowIndex * GetHeight(childSize);
}
else
{
offsetInPixel = Math.Min(Math.Max(GetY(offset) - GetHeight(groupItem.HeaderDesiredSizes.PixelSize), 0), GetHeight(Extent));
offsetRowIndex = GetRowIndex(offsetInPixel);
}
double viewportHeight = Math.Min(GetHeight(Viewport), Math.Max(GetHeight(Extent) - offsetInPixel, 0));
rowCountInViewport = (int)Math.Ceiling((offsetInPixel + viewportHeight) / GetHeight(childSize)) - (int)Math.Floor(offsetInPixel / GetHeight(childSize));
startIndex = offsetRowIndex * itemsPerRowCount;
endIndex = Math.Min(((offsetRowIndex + rowCountInViewport) * itemsPerRowCount) - 1, Items.Count - 1);
if (CacheLengthUnit == VirtualizationCacheLengthUnit.Pixel)
{
double cacheBeforeInPixel = Math.Min(CacheLength.CacheBeforeViewport, offsetInPixel);
double cacheAfterInPixel = Math.Min(CacheLength.CacheAfterViewport, GetHeight(Extent) - viewportHeight - offsetInPixel);
int rowCountInCacheBefore = (int)(cacheBeforeInPixel / GetHeight(childSize));
int rowCountInCacheAfter = ((int)Math.Ceiling((offsetInPixel + viewportHeight + cacheAfterInPixel) / GetHeight(childSize))) - (int)Math.Ceiling((offsetInPixel + viewportHeight) / GetHeight(childSize));
startIndex = Math.Max(startIndex - rowCountInCacheBefore * itemsPerRowCount, 0);
endIndex = Math.Min(endIndex + rowCountInCacheAfter * itemsPerRowCount, Items.Count - 1);
}
else if (CacheLengthUnit == VirtualizationCacheLengthUnit.Item)
{
startIndex = Math.Max(startIndex - (int)CacheLength.CacheBeforeViewport, 0);
endIndex = Math.Min(endIndex + (int)CacheLength.CacheAfterViewport, Items.Count - 1);
}
}
else
{
double viewportSartPos = GetY(Offset);
double viewportEndPos = GetY(Offset) + GetHeight(Viewport);
if (CacheLengthUnit == VirtualizationCacheLengthUnit.Pixel)
{
viewportSartPos = Math.Max(viewportSartPos - CacheLength.CacheBeforeViewport, 0);
viewportEndPos = Math.Min(viewportEndPos + CacheLength.CacheAfterViewport, GetHeight(Extent));
}
int startRowIndex = GetRowIndex(viewportSartPos);
startIndex = startRowIndex * itemsPerRowCount;
int endRowIndex = GetRowIndex(viewportEndPos);
endIndex = Math.Min(endRowIndex * itemsPerRowCount + (itemsPerRowCount - 1), Items.Count - 1);
if (CacheLengthUnit == VirtualizationCacheLengthUnit.Page)
{
int itemsPerPage = endIndex - startIndex + 1;
startIndex = Math.Max(startIndex - (int)CacheLength.CacheBeforeViewport * itemsPerPage, 0);
endIndex = Math.Min(endIndex + (int)CacheLength.CacheAfterViewport * itemsPerPage, Items.Count - 1);
}
else if (CacheLengthUnit == VirtualizationCacheLengthUnit.Item)
{
startIndex = Math.Max(startIndex - (int)CacheLength.CacheBeforeViewport, 0);
endIndex = Math.Min(endIndex + (int)CacheLength.CacheAfterViewport, Items.Count - 1);
}
}
return new ItemRange(startIndex, endIndex);
}
private int GetRowIndex(double location)
{
int calculatedRowIndex = (int)Math.Floor(location / GetHeight(childSize));
int maxRowIndex = (int)Math.Ceiling((double)Items.Count / (double)itemsPerRowCount);
return Math.Max(Math.Min(calculatedRowIndex, maxRowIndex), 0);
}
protected override void BringIndexIntoView(int index)
{
if (index < 0 || index >= Items.Count)
{
throw new ArgumentOutOfRangeException(nameof(index), $"The argument {nameof(index)} must be >= 0 and < the number of items.");
}
if (itemsPerRowCount == 0)
{
throw new InvalidOperationException();
}
var offset = (index / itemsPerRowCount) * GetHeight(childSize);
if (Orientation == Orientation.Horizontal)
{
SetHorizontalOffset(offset);
}
else
{
SetVerticalOffset(offset);
}
}
protected override double GetLineUpScrollAmount()
{
return -Math.Min(childSize.Height * ScrollLineDeltaItem, Viewport.Height);
}
protected override double GetLineDownScrollAmount()
{
return Math.Min(childSize.Height * ScrollLineDeltaItem, Viewport.Height);
}
protected override double GetLineLeftScrollAmount()
{
return -Math.Min(childSize.Width * ScrollLineDeltaItem, Viewport.Width);
}
protected override double GetLineRightScrollAmount()
{
return Math.Min(childSize.Width * ScrollLineDeltaItem, Viewport.Width);
}
protected override double GetMouseWheelUpScrollAmount()
{
return -Math.Min(childSize.Height * MouseWheelDeltaItem, Viewport.Height);
}
protected override double GetMouseWheelDownScrollAmount()
{
return Math.Min(childSize.Height * MouseWheelDeltaItem, Viewport.Height);
}
protected override double GetMouseWheelLeftScrollAmount()
{
return -Math.Min(childSize.Width * MouseWheelDeltaItem, Viewport.Width);
}
protected override double GetMouseWheelRightScrollAmount()
{
return Math.Min(childSize.Width * MouseWheelDeltaItem, Viewport.Width);
}
protected override double GetPageUpScrollAmount()
{
return -Viewport.Height;
}
protected override double GetPageDownScrollAmount()
{
return Viewport.Height;
}
protected override double GetPageLeftScrollAmount()
{
return -Viewport.Width;
}
protected override double GetPageRightScrollAmount()
{
return Viewport.Width;
}
/* orientation aware helper methods */
protected double GetX(Point point) => Orientation == Orientation.Vertical ? point.X : point.Y;
protected double GetY(Point point) => Orientation == Orientation.Vertical ? point.Y : point.X;
protected double GetWidth(Size size) => Orientation == Orientation.Vertical ? size.Width : size.Height;
protected double GetHeight(Size size) => Orientation == Orientation.Vertical ? size.Height : size.Width;
protected Size CreateSize(double width, double height) => Orientation == Orientation.Vertical ? new Size(width, height) : new Size(height, width);
protected Rect CreateRect(double x, double y, double width, double height) => Orientation == Orientation.Vertical ? new Rect(x, y, width, height) : new Rect(y, x, width, height);
}
}

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props" Condition="Exists('packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" />
<Import Project="packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props" Condition="Exists('packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props')" />
<Import Project="packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props" Condition="Exists('packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -15,6 +18,9 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
<IsWebBootstrapper>false</IsWebBootstrapper>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
@@ -27,7 +33,6 @@
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
@@ -52,6 +57,8 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Prefer32Bit>false</Prefer32Bit>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
</PropertyGroup>
<PropertyGroup>
<StartupObject>GeekDesk.App</StartupObject>
@@ -60,7 +67,7 @@
<SignManifests>false</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Taskbar.ico</ApplicationIcon>
<ApplicationIcon>Logo.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<TargetZone>LocalIntranet</TargetZone>
@@ -68,6 +75,9 @@
<PropertyGroup>
<GenerateManifests>false</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="CommonServiceLocator, Version=2.0.6.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>packages\CommonServiceLocator.2.0.6\lib\net45\CommonServiceLocator.dll</HintPath>
@@ -75,8 +85,8 @@
<Reference Include="Gma.System.MouseKeyHook, Version=5.6.130.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\MouseKeyHook.5.6.0\lib\net40\Gma.System.MouseKeyHook.dll</HintPath>
</Reference>
<Reference Include="HandyControl, Version=3.3.0.0, Culture=neutral, PublicKeyToken=45be8712787a1e5b, processorArchitecture=MSIL">
<HintPath>packages\HandyControl.3.3.0\lib\net472\HandyControl.dll</HintPath>
<Reference Include="HandyControl, Version=3.5.1.0, Culture=neutral, PublicKeyToken=45be8712787a1e5b, processorArchitecture=MSIL">
<HintPath>packages\HandyControl.3.5.1\lib\net472\HandyControl.dll</HintPath>
</Reference>
<Reference Include="KeyMouseHook, Version=1.0.6.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\KeyMouseHook.1.0.6\lib\net40\KeyMouseHook.dll</HintPath>
@@ -98,6 +108,7 @@
<HintPath>packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Data" />
<Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Diagnostics.DiagnosticSource.4.7.1\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
@@ -106,6 +117,7 @@
<Reference Include="System.Drawing.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Drawing.Common.6.0.0-preview.6.21352.12\lib\net461\System.Drawing.Common.dll</HintPath>
</Reference>
<Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
@@ -113,12 +125,20 @@
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Reactive, Version=5.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>packages\System.Reactive.5.0.0\lib\net472\System.Reactive.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Remoting" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Windows" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
@@ -129,9 +149,15 @@
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsAPICodePack.Shell.CommonFileDialogs, Version=1.1.5.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\WindowsAPICodePack.Shell.CommonFileDialogs.1.1.5\lib\net452\WindowsAPICodePack.Shell.CommonFileDialogs.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="XamlFlair.WPF, Version=1.2.13.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\XamlFlair.WPF.1.2.13\lib\net472\XamlFlair.WPF.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
@@ -142,16 +168,23 @@
<Compile Include="Command\DelegateCommandBase.cs" />
<Compile Include="Constant\AppHideType.cs" />
<Compile Include="Constant\Constants.cs" />
<Compile Include="Constant\DictConst.cs" />
<Compile Include="Constant\HotKeyType.cs" />
<Compile Include="Constant\IconType.cs" />
<Compile Include="Constant\CommonEnum.cs" />
<Compile Include="Constant\IconStartType.cs" />
<Compile Include="Constant\MenuType.cs" />
<Compile Include="Constant\PasswordType.cs" />
<Compile Include="Constant\RunTimeStatus.cs" />
<Compile Include="Constant\SearchType.cs" />
<Compile Include="Constant\SortType.cs" />
<Compile Include="Constant\TodoTaskExecType.cs" />
<Compile Include="Constant\BGStyle.cs" />
<Compile Include="Constant\UpdateType.cs" />
<Compile Include="Constant\WidthTypeEnum.cs" />
<Compile Include="Control\Other\GlobalMsgNotification.xaml.cs">
<DependentUpon>GlobalMsgNotification.xaml</DependentUpon>
</Compile>
<Compile Include="Control\Other\BacklogNotificatin.xaml.cs">
<DependentUpon>BacklogNotificatin.xaml</DependentUpon>
</Compile>
@@ -161,12 +194,21 @@
<Compile Include="Control\Other\GradientBGDialog.xaml.cs">
<DependentUpon>GradientBGDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Control\Other\BGNmaeDialog.xaml.cs">
<DependentUpon>BGNmaeDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Control\Other\PasswordDialog.xaml.cs">
<DependentUpon>PasswordDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Control\Other\MyColorPickerDialog.xaml.cs">
<DependentUpon>MyColorPickerDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Control\Other\IconInfoUrlDialog.xaml.cs">
<DependentUpon>IconInfoUrlDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Control\Other\SearchResControl.xaml.cs">
<DependentUpon>SearchResControl.xaml</DependentUpon>
</Compile>
<Compile Include="Control\UserControls\Config\OtherControl.xaml.cs">
<DependentUpon>OtherControl.xaml</DependentUpon>
</Compile>
@@ -221,8 +263,10 @@
<Compile Include="Control\Windows\UpdateWindow.xaml.cs">
<DependentUpon>UpdateWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Converts\ValueConvert.cs" />
<Compile Include="Converts\CountGreZero2BoolConvert.cs" />
<Compile Include="Converts\Count2VisibleConvert.cs" />
<Compile Include="Converts\GetWidthByWWConvert.cs" />
<Compile Include="Converts\SearchTypeConvert.cs" />
<Compile Include="Converts\StringAppendConvert.cs" />
<Compile Include="Converts\DoubleToGridLength.cs" />
@@ -234,34 +278,74 @@
<Compile Include="Converts\OpcityConvert.cs" />
<Compile Include="Converts\BGStyleConvert.cs" />
<Compile Include="Converts\UpdateTypeConvert.cs" />
<Compile Include="Converts\ReverseBoolConvert.cs" />
<Compile Include="Converts\Boolean2VisibilityConverter.cs" />
<Compile Include="Converts\TextToColorConverter.cs" />
<Compile Include="Converts\Visibility2BooleanConverter.cs" />
<Compile Include="DraggAnimatedPanel\DraggAnimatedPanel.cs" />
<Compile Include="DraggAnimatedPanel\DraggAnimatedPanel.Drag.cs" />
<Compile Include="CustomComponent\DraggAnimatedPanel\DraggAnimatedPanel.cs" />
<Compile Include="CustomComponent\DraggAnimatedPanel\DraggAnimatedPanel.Drag.cs" />
<Compile Include="Converts\HideTypeConvert.cs" />
<Compile Include="Interface\IWindowCommon.cs" />
<Compile Include="MyThread\RelativePathThread.cs" />
<Compile Include="Plugins\EveryThing\Constant\EveryThingConst.cs" />
<Compile Include="Plugins\EveryThing\EveryThing32.cs" />
<Compile Include="Plugins\EveryThing\EveryThing64.cs" />
<Compile Include="Plugins\EveryThing\EveryThingUtil.cs" />
<Compile Include="Plugins\ShowSeconds\Common\Constants.cs" />
<Compile Include="Plugins\ShowSeconds\SecondsWindow.xaml.cs">
<DependentUpon>SecondsWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Plugins\ShowSeconds\ViewModel\SecondsDataContext.cs" />
<Compile Include="Task\BakTask.cs" />
<Compile Include="Task\ToDoTask.cs" />
<Compile Include="MyThread\MouseHookThread.cs" />
<Compile Include="MyThread\DispatcherBuild.cs" />
<Compile Include="MyThread\UpdateThread.cs" />
<Compile Include="Task\UpdateTask.cs" />
<Compile Include="Util\AeroGlassHelper.cs" />
<Compile Include="Util\BGSettingUtil.cs" />
<Compile Include="Util\BlurGlassUtil.cs" />
<Compile Include="Util\ColorUtil.cs" />
<Compile Include="Util\DeepCopyUtil.cs" />
<Compile Include="Util\DefaultIcons.cs" />
<Compile Include="Util\DragAdorner.cs" />
<Compile Include="Util\FileWatcher.cs" />
<Compile Include="Util\GlobalHotKey.cs" />
<Compile Include="Util\CommonCode.cs" />
<Compile Include="Util\FileIcon.cs" />
<Compile Include="Util\FileUtil.cs" />
<Compile Include="ViewModel\Temp\GuideInfoList.cs" />
<Compile Include="Util\HideWindowUtil.cs" />
<Compile Include="Util\IconHelper.cs" />
<Compile Include="Util\IconUtil.cs" />
<Compile Include="Util\KeyUtil.cs" />
<Compile Include="Util\ListBoxDragDropManager.cs" />
<Compile Include="Util\LogUtil.cs" />
<Compile Include="Util\MarginHide.cs" />
<Compile Include="Util\HttpUtil.cs" />
<Compile Include="Util\ImageUtil.cs" />
<Compile Include="Converts\MenuWidthConvert.cs" />
<Compile Include="Util\MD5Util.cs" />
<Compile Include="Util\MessageUtil.cs" />
<Compile Include="Util\MouseHook.cs" />
<Compile Include="Util\MouseUtil.cs" />
<Compile Include="Util\NativeMethods.cs" />
<Compile Include="Util\ProcessUtil.cs" />
<Compile Include="Util\RegisterUtil.cs" />
<Compile Include="Util\RelayCommand.cs" />
<Compile Include="Util\ScreenUtil.cs" />
<Compile Include="Util\ScrollUtil.cs" />
<Compile Include="Util\ShellContextMenu.cs" />
<Compile Include="Util\ShowWindowFollowMouse.cs" />
<Compile Include="Util\StringUtil.cs" />
<Compile Include="Util\SvgToGeometry.cs" />
<Compile Include="Util\UserActivityHook.cs" />
<Compile Include="CustomComponent\VirtualizingWrapPanel\ItemRange.cs" />
<Compile Include="CustomComponent\VirtualizingWrapPanel\SpacingMode.cs" />
<Compile Include="CustomComponent\VirtualizingWrapPanel\VirtualizingPanelBase.cs" />
<Compile Include="CustomComponent\VirtualizingWrapPanel\VirtualizingWrapPanel.cs" />
<Compile Include="Util\WindowsThumbnailProvider.cs" />
<Compile Include="Util\WindowUtil.cs" />
<Compile Include="CustomComponent\VirtualizingWrapPanel\ScrollDirection.cs" />
<Compile Include="ViewModel\AppConfig.cs" />
<Compile Include="ViewModel\AppData.cs" />
<Compile Include="ViewModel\GradientBGParam.cs" />
@@ -272,6 +356,10 @@
<Compile Include="ViewModel\IconfontInfo.cs" />
<Compile Include="ViewModel\IconInfo.cs" />
<Compile Include="ViewModel\MenuInfo.cs" />
<Page Include="Control\Other\GlobalMsgNotification.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Control\Other\BacklogNotificatin.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -284,6 +372,14 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Control\Other\BGNmaeDialog.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Control\Other\PasswordDialog.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Control\Other\MyColorPickerDialog.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -292,6 +388,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Control\Other\SearchResControl.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Control\UserControls\Config\OtherControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -376,6 +476,10 @@
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="Plugins\ShowSeconds\SecondsWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resource\Dictionary\Geometry.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -384,6 +488,11 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Resource\Dictionary\XamlFlairSettings.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
@@ -404,6 +513,19 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<Resource Include="Resource\Iconfont\iconfont.json" />
<None Include="app.manifest" />
<None Include="Plugins\EveryThing\32\Everything.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Plugins\EveryThing\32\Everything.lng">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Plugins\EveryThing\64\Everything.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Plugins\EveryThing\64\Everything.lng">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Properties\app.manifest" />
<None Include="Update.json" />
<None Include="packages.config" />
@@ -472,10 +594,57 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Resource Include="Logo.ico" />
</ItemGroup>
<ItemGroup>
<None Include="Plugins\EveryThing\lib\Everything32.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Plugins\EveryThing\lib\Everything64.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<Content Include="Plugins\EveryThing\32\Everything.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Plugins\EveryThing\64\Everything.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
<UserProperties update_1json__JsonSchema="https://typedoc.org/schema.json" />
<UserProperties update_1json__JsonSchema="https://beaujs.com/schema.json" />
</VisualStudio>
</ProjectExtensions>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.props'))" />
<Error Condition="!Exists('packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets'))" />
<Error Condition="!Exists('packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.props'))" />
<Error Condition="!Exists('packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets'))" />
<Error Condition="!Exists('packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.props'))" />
<Error Condition="!Exists('packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets'))" />
</Target>
<Import Project="packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets" Condition="Exists('packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets')" />
<Import Project="packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets" Condition="Exists('packages\Microsoft.SourceLink.Common.1.0.0\build\Microsoft.SourceLink.Common.targets')" />
<Import Project="packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets" Condition="Exists('packages\Microsoft.SourceLink.GitHub.1.0.0\build\Microsoft.SourceLink.GitHub.targets')" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>; Move all assemblies and related files to lib folder
ROBOCOPY "$(TargetDir) " "$(TargetDir)lib\ " /XF Data *.exe *.config *.manifest /XD "$(TargetDir)lib" plugins logs bak /E /IS /MOVE
ROBOCOPY "$(TargetDir) " "$(TargetDir)lib\ " *.dll /XD "$(TargetDir)lib" /E /S /MOVE
if %25errorlevel%25 leq 4 exit 0 else exit %25errorlevel%25</PostBuildEvent>
</PropertyGroup>
</Project>

201
LICENSE Normal file
View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -1,2 +0,0 @@
- 这是个人开发的程序,任何人可任意修改和免费使用(未做较大功能性改动不允许修改赞赏码,重新修改发布需注明出处)
- 商用需联系作者

BIN
Logo.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

View File

@@ -5,94 +5,197 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:uc="clr-namespace:GeekDesk.Control.UserControls.PannelCard"
xmlns:cn="clr-namespace:GeekDesk.Constant"
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
xmlns:local="clr-namespace:GeekDesk"
mc:Ignorable="d"
xmlns:cvt="clr-namespace:GeekDesk.Converts"
x:Name="AppWindow"
xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:viewmodel="clr-namespace:GeekDesk.ViewModel"
xmlns:my="clr-namespace:GeekDesk.Util"
d:DataContext="{d:DesignInstance Type=viewmodel:AppData}"
Title="GeekDesk"
Title="GeekDesk_Main_8400A17AEEF7C029"
MinWidth="600"
MinHeight="400"
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent"
ShowInTaskbar="False"
Opacity="0"
Opacity="1"
Deactivated="AppWindow_Deactivated"
SizeChanged="Window_SizeChanged"
KeyDown="OnKeyDown"
PreviewKeyDown="OnKeyDown"
Focusable="True"
MouseDown="MainWindow_MouseDown"
MouseEnter="MainWindow_MouseEnter"
GotFocus="Window_GotFocus"
Loaded="Window_Loaded"
SourceInitialized="Window_SourceInitialized"
Topmost="{Binding AppConfig.AlwaysTopmost}"
>
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="0" ResizeBorderThickness="15"/>
</WindowChrome.WindowChrome>
<Window.Resources>
<RoutedUICommand x:Key="SearchHotKeyDown" Text="SearchHotKeyDown"/>
<cvt:MenuWidthConvert x:Key="MenuWidthConvert"/>
<cvt:OpcityConvert x:Key="OpcityConvert"/>
<cvt:IntToCornerRadius x:Key="IntToCornerRadius"/>
<cvt:DoubleToGridLength x:Key="DoubleToGridLength"/>
<Style x:Key="BorderBacStyle" TargetType="Border">
</Style>
<cvt:ReverseBoolConvert x:Key="ReverseBoolConvert"/>
</Window.Resources>
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="0" CornerRadius="30" ResizeBorderThickness="23"/>
</WindowChrome.WindowChrome>
<Window.InputBindings>
<KeyBinding Gesture="Ctrl+F" Key="F" Command="{StaticResource SearchHotKeyDown}"/>
</Window.InputBindings>
<Window.CommandBindings>
<CommandBinding Command="{StaticResource SearchHotKeyDown}" CanExecute="SearchHotKeyDown"/>
<!--<CommandBinding Command="ChangeImgBG" Executed="ChangeImgBG_Executed" CanExecute="ChangeImgBG_CanExecute" />-->
</Window.CommandBindings>
<Window.Effect>
<!--Opacity="{Binding AppConfig.PannelOpacity, Mode=TwoWay, Converter={StaticResource OpcityConvert}}"-->
<Grid>
<!--遮罩层border 用于引导提示-->
<Border Margin="20"
Visibility="Collapsed"
MouseDown="DragMove"
CornerRadius="{Binding AppConfig.PannelCornerRadius, Mode=OneWay, Converter={StaticResource IntToCornerRadius}}"
BorderThickness="0"
x:Name="GrayBorder"
Panel.ZIndex="888"
>
<Border.Background>
<SolidColorBrush Color="Gray" Opacity="0.9"/>
</Border.Background>
<!--<hc:Poptip.Instance>
<hc:Poptip PlacementType="Top" IsOpen="False" HitMode="None">
<hc:Poptip.ContentTemplate>
<DataTemplate>
<Border Background="White" Width="300" Height="150">
<TextBlock Text="这是一个测测试"/>
</Border>
</DataTemplate>
</hc:Poptip.ContentTemplate>
</hc:Poptip>
</hc:Poptip.Instance>-->
</Border>
<hc:Card x:Name="GuideCard" Width="300" Height="180" Panel.ZIndex="888"
VerticalAlignment="Top"
HorizontalAlignment="Left" Visibility="Collapsed">
<hc:Card.Background>
<SolidColorBrush Color="White" Opacity="0.85"/>
</hc:Card.Background>
<!--Card 的内容部分-->
<Border CornerRadius="4,4,0,0" Width="300" Height="100">
<TextBlock TextWrapping="Wrap"
x:Name="GuideText"
VerticalAlignment="Center"
HorizontalAlignment="Center"
LineHeight="22"
FontSize="14"
Text=""/>
</Border>
<!--Card 的尾部部分-->
<hc:Card.Footer>
<Grid>
<StackPanel Margin="10" Width="150" Height="50" HorizontalAlignment="Left">
<!--Card 的一级内容-->
<WrapPanel>
<TextBlock TextWrapping="Wrap"
x:Name="GuideTitle1"
Style="{DynamicResource TextBlockLargeBold}"
TextTrimming="CharacterEllipsis"
Text="引导提示"
FontSize="20"
HorizontalAlignment="Left"/>
<TextBlock TextWrapping="Wrap"
x:Name="GuideNum"
Style="{DynamicResource TextBlockLargeBold}"
TextTrimming="CharacterEllipsis"
Text="1"
FontSize="20"
HorizontalAlignment="Left"/>
</WrapPanel>
<!--Card 的二级内容-->
<TextBlock TextWrapping="NoWrap"
x:Name="GuideTitle2"
Style="{DynamicResource TextBlockDefault}"
TextTrimming="CharacterEllipsis"
Text="快捷方式创建"
Margin="0,6,0,0"
FontSize="14"
HorizontalAlignment="Left"/>
</StackPanel>
<hc:UniformSpacingPanel HorizontalAlignment="Right">
<Button Style="{StaticResource MyBtnStyle}" x:Name="PreviewGuideBtn" Click="PreviewGuideBtn_Click" Margin="0,0,20,0" Content="上一步"/>
<Button Style="{StaticResource MyBtnStyle}" x:Name="NextGuideBtn" Click="NextGuideBtn_Click" Margin="0,0,20,0" Content="下一步"/>
</hc:UniformSpacingPanel>
</Grid>
</hc:Card.Footer>
</hc:Card>
<Border Margin="20" CornerRadius="{Binding AppConfig.PannelCornerRadius, Mode=TwoWay, Converter={StaticResource IntToCornerRadius}}"
BorderThickness="0"
Focusable="True"
Panel.ZIndex="1"
x:Name="BGBorder"
Background="AliceBlue"
hc:Dialog.Token="MainWindowDialog"
xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndGrowHorizontally}, Event=None}"
xf:Animations.PrimaryBinding="{Binding AppConfig.IsShow, Mode=OneWay}"
xf:Animations.Secondary="{xf:Animate BasedOn={StaticResource FadeOut}, Event=None}"
xf:Animations.SecondaryBinding="{Binding AppConfig.IsShow, Mode=OneWay, Converter={StaticResource ReverseBoolConvert}}"
xf:Animations.SecondaryCompletionCommand="{Binding HideCommand, RelativeSource={RelativeSource AncestorType={x:Type Window}}}"
xf:Animations.AllowOpacityReset="False"
>
<Border.Effect>
<DropShadowEffect BlurRadius="30" Direction="-90" Color="Gray"
RenderingBias="Quality" ShadowDepth="2"/>
</Window.Effect>
<Border Margin="20" CornerRadius="{Binding AppConfig.PannelCornerRadius, Mode=TwoWay, Converter={StaticResource IntToCornerRadius}}" BorderThickness="0"
Background="AliceBlue"
Opacity="{Binding AppConfig.PannelOpacity, Mode=TwoWay, Converter={StaticResource OpcityConvert}}"
hc:Dialog.Token="IconInfoDialog"
Focusable="True"
>
</Border.Effect>
<hc:DialogContainer Focusable="True">
<!-- -1是为了解决圆角白线的问题-->
<Border x:Name="BGBorder"
CornerRadius="{Binding AppConfig.PannelCornerRadius, Mode=TwoWay, Converter={StaticResource IntToCornerRadius}}"
BorderThickness="0"
Margin="-1"
>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40" MouseMove="DragMove"></RowDefinition>
<RowDefinition Height="40" MouseDown="DragMove"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="LeftColumn" MinWidth="80" Width="{Binding AppConfig.MenuCardWidth, Mode=TwoWay, Converter={StaticResource DoubleToGridLength}}" MaxWidth="200"></ColumnDefinition>
<ColumnDefinition x:Name="LeftColumn" MinWidth="80" Width="{Binding AppConfig.MenuCardWidth, Mode=TwoWay, Converter={StaticResource DoubleToGridLength}}" MaxWidth="280"></ColumnDefinition>
<ColumnDefinition x:Name="RightColumn" Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!--获取焦点用-->
<TextBox x:Name="EmptyTextBox" Width="0"/>
<DockPanel Grid.Row="0" Grid.Column="0" MouseMove="DragMove">
<CheckBox Style="{StaticResource MyCheckBoxStyle}" x:Name="ShowBox" Visibility="Hidden" Panel.ZIndex="2"/>
<CheckBox Style="{StaticResource MyCheckBoxStyle}" x:Name="HideBox" Visibility="Hidden" Panel.ZIndex="2"/>
<StackPanel HorizontalAlignment="Right" Panel.ZIndex="99" hc:Growl.GrowlParent="False" hc:Growl.Token="MainWindowGrowl" Grid.Column="1" Grid.Row="1"/>
<StackPanel HorizontalAlignment="Center" Panel.ZIndex="99" hc:Growl.GrowlParent="False" hc:Growl.Token="MainWindowAskGrowl" Grid.Column="1" Grid.Row="1"/>
<DockPanel Grid.Row="0" Grid.Column="0" MouseDown="DragMove">
<DockPanel.Background>
<SolidColorBrush Opacity="0.01"/>
</DockPanel.Background>
<Image Visibility="{Binding AppConfig.TitleLogoVisible}" Source="/Resource/Image/TitleLogo.png" Margin="10,0,0,0" Width="94" Height="30" HorizontalAlignment="Left"/>
<Image Visibility="{Binding AppConfig.TitleLogoVisible}"
Source="/Resource/Image/TitleLogo.png"
RenderOptions.BitmapScalingMode="HighQuality"
Margin="10,0,0,0"
Width="200"
Height="30"
Opacity="0.8"
HorizontalAlignment="Left"/>
</DockPanel>
<DockPanel Grid.Row="0" Grid.Column="2" MouseMove="DragMove">
<DockPanel Grid.Row="0" Grid.Column="2" MouseDown="DragMove">
<DockPanel.Background>
<SolidColorBrush Opacity="0.01"/>
</DockPanel.Background>
<hc:UniformSpacingPanel Grid.ColumnSpan="4" HorizontalAlignment="Right" VerticalAlignment="Center">
<hc:UniformSpacingPanel x:Name="MainBtnPanel" Grid.ColumnSpan="4" HorizontalAlignment="Right" VerticalAlignment="Center">
<Button Background="Transparent"
BorderThickness="0"
hc:IconElement.Geometry="M917.930667 512c0-57.6 36.181333-106.496 86.869333-125.952a505.429333 505.429333 0 0 0-55.210667-133.461333A134.826667 134.826667 0 0 1 771.413333 74.410667 507.733333 507.733333 0 0 0 637.952 19.2 135.168 135.168 0 0 1 512 106.069333 134.912 134.912 0 0 1 386.048 19.2 505.429333 505.429333 0 0 0 252.586667 74.410667c22.186667 49.749333 13.141333 109.824-27.562667 150.528a135.168 135.168 0 0 1-150.528 27.648 502.016 502.016 0 0 0-55.296 133.461333c50.688 19.626667 86.869333 68.437333 86.869333 125.952 0 57.6-36.181333 106.496-86.869333 125.952 12.117333 47.530667 30.72 92.330667 55.210667 133.461333a134.826667 134.826667 0 0 1 178.090666 178.176 507.733333 507.733333 0 0 0 133.546667 55.210667A135.168 135.168 0 0 1 512 917.930667c57.6 0 106.496 36.181333 125.952 86.869333a505.429333 505.429333 0 0 0 133.461333-55.210667 134.912 134.912 0 0 1 27.562667-150.528 135.168 135.168 0 0 1 150.528-27.648 502.016 502.016 0 0 0 55.296-133.461333A134.912 134.912 0 0 1 917.930667 512zM512 647.338667a135.338667 135.338667 0 1 1 0.085333-270.762667A135.338667 135.338667 0 0 1 512 647.338667z"
@@ -101,6 +204,7 @@
HorizontalAlignment="Right"
Click="ConfigButtonClick"
Initialized="SettingButton_Initialized"
PreviewMouseLeftButtonDown="AppButton_PreviewMouseLeftButtonDown"
x:Name="SettingButton"
FocusVisualStyle="{x:Null}"
>
@@ -108,6 +212,7 @@
<ContextMenu x:Name="SettingMenus" Width="130">
<MenuItem Header="设置" Click="ConfigMenuClick"/>
<MenuItem Header="待办" Click="BacklogMenuClick"/>
<MenuItem Header="新手引导" Click="Guide_Click"/>
</ContextMenu>
</Button.ContextMenu>
</Button>
@@ -118,17 +223,46 @@
hc:IconElement.Width="18"
HorizontalAlignment="Right"
Click="CloseButtonClick"
PreviewMouseLeftButtonDown="AppButton_PreviewMouseLeftButtonDown"
FocusVisualStyle="{x:Null}"
/>
</hc:UniformSpacingPanel>
</DockPanel>
<uc:LeftCardControl Grid.Row="1" Grid.Column="0"/>
<uc:LeftCardControl x:Name="LeftCard" Grid.Row="1" Grid.Column="0"/>
<!--分割线-->
<GridSplitter Opacity="0" Grid.Row="1" Grid.Column="0" Width="1" VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
<GridSplitter Opacity="0" Grid.Row="1" Grid.Column="0" Width="5" VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
<Border x:Name="SearchResContainer" Panel.ZIndex="2"
Visibility="Collapsed"
Grid.Row="1" Grid.Column="1"
HorizontalAlignment="Right" MaxWidth="200"
VerticalAlignment="Top"
CornerRadius="8"
Margin="0,20,40,0"
>
<Border.Style>
<Style TargetType="Border" >
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="White" Opacity="0.6"/>
</Setter.Value>
</Setter>
<Setter Property="MaxWidth" Value="300"/>
</Style>
</Border.Style>
<WrapPanel Margin="8">
<TextBlock Opacity="0.6" Text="g:"/>
<TextBlock x:Name="GeekDeskSearchTotal" Opacity="0.6" Text="0"/>
<TextBlock Opacity="0.6" Text="+"/>
<TextBlock Opacity="0.6" Text="e:"/>
<TextBlock x:Name="EverythingSearchCount" Opacity="0.6" Text="0"/>
<TextBlock Opacity="0.6" Text=" of "/>
<TextBlock x:Name="EverythingSearchTotal" Opacity="0.6" Text="0"/>
</WrapPanel>
</Border>
<!--搜索输入框-->
<TextBox Panel.ZIndex="2" Grid.Row="0" Grid.Column="1"
@@ -139,17 +273,21 @@
FontSize="16"
BorderThickness="0"
TextChanged="SearchBox_TextChanged"
/>
Style="{StaticResource MyTextBoxStyle}"
>
<TextBox.Background>
<SolidColorBrush Color="White" Opacity="0.5" />
</TextBox.Background>
</TextBox>
<uc:RightCardControl x:Name="RightCard" Grid.Row="1" Grid.Column="1"/>
<hc:NotifyIcon Icon="/Taskbar.ico" Click="NotifyIcon_Click" x:Name="BarIcon"
MouseRightButtonDown="BarIcon_MouseRightButtonDown"
<hc:NotifyIcon Icon="/Logo.ico" Click="NotifyIcon_Click" x:Name="BarIcon"
Visibility="{Binding AppConfig.ShowBarIcon, Mode=TwoWay, Converter={StaticResource Boolean2VisibilityConverter}}">
<hc:NotifyIcon.ContextMenu>
<ContextMenu Width="130" x:Name="TaskbarContextMenu">
<MenuItem Header="打开面板" Click="ShowApp"/>
<MenuItem Header="拾色器" Click="ColorPicker"/>
<MenuItem Header="备份" Click="BakDataFile"/>
<MenuItem Header="隐藏图标" Click="CloseBarIcon"/>
<MenuItem Header="待办" Click="BacklogMenuClick"/>
<MenuItem Header="程序目录" Click="OpenThisDir"/>
@@ -158,12 +296,16 @@
<MenuItem Header="退出" Click="ExitApp"/>
</ContextMenu>
</hc:NotifyIcon.ContextMenu>
</hc:NotifyIcon>
<uc:RightCardControl x:Name="RightCard" Grid.Row="1" Grid.Column="1"/>
<StackPanel hc:Growl.GrowlParent="True" VerticalAlignment="Top" Margin="0,10,10,0"/>
</Grid>
</Border>
</hc:DialogContainer>
</Border>
</Grid>
</Window>

View File

@@ -1,21 +1,36 @@
using GeekDesk.Constant;
using GeekDesk.Control.Other;
using GeekDesk.Control.UserControls.Config;
using GeekDesk.Control.UserControls.PannelCard;
using GeekDesk.Control.Windows;
using GeekDesk.Interface;
using GeekDesk.MyThread;
using GeekDesk.Plugins.EveryThing;
using GeekDesk.Plugins.EveryThing.Constant;
using GeekDesk.Task;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using GeekDesk.ViewModel.Temp;
using Microsoft.Win32;
using NPinyin;
using ShowSeconds;
using System;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Shell;
using System.Windows.Threading;
using static GeekDesk.Util.ShowWindowFollowMouse;
@@ -28,22 +43,28 @@ namespace GeekDesk
public partial class MainWindow : Window, IWindowCommon
{
public static AppData appData = CommonCode.GetAppDataByFile();
public static AppData appData;
public static ToDoInfoWindow toDoInfoWindow;
public static int hotKeyId = -1;
public static int toDoHotKeyId = -1;
public static int colorPickerHotKeyId = -1;
public static MainWindow mainWindow;
private static bool dataFileExist = true;
public MainWindow()
{
//加载数据
LoadData();
InitializeComponent();
mainWindow = this;
this.Topmost = true;
this.Loaded += Window_Loaded;
this.SizeChanged += MainWindow_Resize;
ToDoTask.BackLogCheck();
//用于其他类访问
mainWindow = this;
//执行待办提醒
ToDoTask.BackLogCheck();
////实例化隐藏 Hide类进行时间timer设置
MarginHide.ReadyHide(this);
@@ -51,28 +72,54 @@ namespace GeekDesk
{
MarginHide.StartHide();
}
}
private void Window_SourceInitialized(object sender, EventArgs e)
{
try
{
//禁用窗口最大化
WindowUtil.DisableMaxWindow(this);
}
catch (Exception) { }
}
/// <summary>
/// 显示搜索框
/// 搜索快捷键按下
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SearchHotKeyDown(object sender, CanExecuteRoutedEventArgs e)
{
if (appData.AppConfig.SearchType == SearchType.HOT_KEY)
if (appData.AppConfig.SearchType == SearchType.HOT_KEY && !RunTimeStatus.SEARCH_BOX_SHOW)
{
ShowSearchBox();
} else if (RunTimeStatus.SEARCH_BOX_SHOW)
{
HidedSearchBox();
}
}
/// <summary>
/// 显示搜索框
/// </summary>
private void ShowSearchBox()
{
RunTimeStatus.SEARCH_BOX_SHOW = true;
RightCard.VisibilitySearchCard(Visibility.Visible);
SearchBox.Width = 400;
SearchBox.Focus();
//执行一遍a查询
//SearchBox_TextChanged(null, null);
}
/// <summary>
/// 搜索开始
@@ -93,43 +140,153 @@ namespace GeekDesk
if (!RunTimeStatus.SEARCH_BOX_SHOW) ShowSearchBox();
//刷新搜索后 鼠标移动次数置为0
RunTimeStatus.MOUSE_MOVE_COUNT = 0;
//隐藏popup
RightCard.MyPoptip.IsOpen = false;
string inputText = SearchBox.Text.ToLower();
RightCard.VerticalUFG.Visibility = Visibility.Collapsed;
if (!string.IsNullOrEmpty(inputText))
{
SearchIconList.IconList.Clear();
RunTimeStatus.EVERYTHING_SEARCH_DELAY_TIME = 300;
if (!RunTimeStatus.EVERYTHING_NEW_SEARCH)
{
RunTimeStatus.EVERYTHING_NEW_SEARCH = true;
//显示搜索结果列表
RightCard.VisibilitySearchCard(Visibility.Visible);
//暂时隐藏条目信息
SearchResContainer.Visibility = Visibility.Collapsed;
//显示加载条
RightCard.Loading_RightCard.Visibility = Visibility.Visible;
object obj = RightCard.VerticalCard.Content;
if (obj != null)
{
SearchResControl control = obj as SearchResControl;
control.VerticalUFG.Visibility = Visibility.Collapsed;
}
SearchDelay();
}
} else
{
//隐藏条目信息
SearchResContainer.Visibility = Visibility.Collapsed;
//清空查询结果
object obj = RightCard.VerticalCard.Content;
if (obj != null)
{
SearchResControl control = obj as SearchResControl;
control.VerticalUFG.Visibility = Visibility.Collapsed;
}
}
}
private void SearchDelay()
{
new Thread(() =>
{
while (RunTimeStatus.EVERYTHING_SEARCH_DELAY_TIME > 0)
{
Thread.Sleep(10);
RunTimeStatus.EVERYTHING_SEARCH_DELAY_TIME -= 10;
}
RunTimeStatus.EVERYTHING_NEW_SEARCH = false;
this.Dispatcher.Invoke(() =>
{
string inputText = SearchBox.Text.ToLower().Trim();
if (string.IsNullOrEmpty(inputText))
{
RightCard.Loading_RightCard.Visibility = Visibility.Collapsed;
return;
}
new Thread(() =>
{
ObservableCollection<IconInfo> resList = new ObservableCollection<IconInfo>();
if (appData.AppConfig.EnableEveryThing == true)
{
ObservableCollection<IconInfo> iconBakList = EveryThingUtil.Search(inputText);
foreach (IconInfo icon in iconBakList)
{
resList.Add(icon);
}
}
int geekDeskCount = 0;
//GeekDesk数据搜索
ObservableCollection<MenuInfo> menuList = appData.MenuList;
foreach (MenuInfo menu in menuList)
{
ObservableCollection<IconInfo> iconList = menu.IconList;
foreach (IconInfo icon in iconList)
{
if (RunTimeStatus.EVERYTHING_NEW_SEARCH) return;
string pyName = Pinyin.GetInitials(icon.Name).ToLower();
if (icon.Name.Contains(inputText) || pyName.Contains(inputText))
{
SearchIconList.IconList.Add(icon);
geekDeskCount++;
resList.Add(icon);
}
}
}
}
else
{
SearchIconList.IconList.Clear();
}
RightCard.VerticalUFG.Visibility = Visibility.Visible;
}
this.Dispatcher.Invoke(() =>
{
if (appData.AppConfig.EnableEveryThing == true)
{
int everythingTotal = Convert.ToInt32(EveryThingUtil.Everything_GetNumResults());
GeekDeskSearchTotal.Text = Convert.ToString(geekDeskCount);
EverythingSearchCount.Text = Convert.ToString(resList.Count - geekDeskCount);
EverythingSearchTotal.Text = Convert.ToString(everythingTotal + geekDeskCount);
SearchResContainer.Visibility = Visibility.Visible;
}
SearchResControl control = new SearchResControl(resList);
RightCard.VerticalCard.Content = control;
//关闭加载效果
RightCard.Loading_RightCard.Visibility = Visibility.Collapsed;
});
}).Start();
});
}).Start();
}
/// <summary>
/// 隐藏搜索框
/// </summary>
public void HidedSearchBox()
{
RunTimeStatus.EVERYTHING_NEW_SEARCH = true;
RunTimeStatus.SEARCH_BOX_HIDED_300 = false;
new Thread(() =>
{
Thread.Sleep(300);
RunTimeStatus.SEARCH_BOX_HIDED_300 = true;
}).Start();
new Thread(() =>
{
Thread.Sleep(1000);
RunTimeStatus.EVERYTHING_NEW_SEARCH = false;
}).Start();
new Thread(() =>
{
this.Dispatcher.Invoke(() =>
{
Keyboard.Focus(SearchBox);
RunTimeStatus.SEARCH_BOX_SHOW = false;
SearchBox.TextChanged -= SearchBox_TextChanged;
SearchBox.Clear();
SearchBox.TextChanged += SearchBox_TextChanged;
SearchBox.Width = 0;
SearchIconList.IconList.Clear();
SearchResContainer.Visibility = Visibility.Collapsed;
RightCard.VerticalCard.Content = null;
RightCard.VisibilitySearchCard(Visibility.Collapsed);
Keyboard.Focus(SearchBox);
App.DoEvents();
});
}).Start();
}
@@ -138,6 +295,11 @@ namespace GeekDesk
/// </summary>
private void LoadData()
{
//判断数据文件是否存在 如果不存在那么是第一次打开程序
dataFileExist = File.Exists(Constants.DATA_FILE_PATH);
appData = CommonCode.GetAppDataByFile();
this.DataContext = appData;
if (appData.MenuList.Count == 0)
{
@@ -148,7 +310,6 @@ namespace GeekDesk
this.Height = appData.AppConfig.WindowHeight;
}
/// <summary>
/// 窗口加载完毕 执行方法
/// </summary>
@@ -158,21 +319,13 @@ namespace GeekDesk
{
BGSettingUtil.BGSetting();
if (!appData.AppConfig.StartedShowPanel)
{
if (appData.AppConfig.AppAnimation)
{
this.Opacity = 0;
}
else
{
this.Visibility = Visibility.Collapsed;
}
}
else
{
ShowApp();
}
//给任务栏图标一个名字
BarIcon.Text = Constants.MY_NAME;
@@ -197,16 +350,57 @@ namespace GeekDesk
RegisterUtil.SetSelfStarting(appData.AppConfig.SelfStartUp, Constants.MY_NAME);
}
//注册鼠标中键监听事件
//注册鼠标监听事件
if (appData.AppConfig.MouseMiddleShow)
{
MouseHookThread.MiddleHook();
MouseHookThread.Hook();
}
//更新线程开启 检测更新
UpdateThread.Update();
//显秒插件
if (appData.AppConfig.SecondsWindow == true)
{
SecondsWindow.ShowWindow();
}
//监听实时文件夹菜单
FileWatcher.EnableLinkMenuWatcher(appData);
//更新任务开启 检测更新
UpdateTask.Start();
//建立相对路径
RelativePathThread.MakeRelativePath();
//毛玻璃 暂时未解决阴影问题
//BlurGlassUtil.EnableBlur(this);
//设置归属桌面 解决桌面覆盖程序界面的bug
WindowUtil.SetOwner(this, WindowUtil.GetDesktopHandle(this, DesktopLayer.Progman));
if (appData.AppConfig.EnableEveryThing == true)
{
//开启EveryThing插件
EveryThingUtil.EnableEveryThing();
}
//启动文件备份任务
BakTask.Start();
Keyboard.Focus(SearchBox);
MessageUtil.ChangeWindowMessageFilter(MessageUtil.WM_COPYDATA, 1);
if (!dataFileExist)
{
Guide();
}
}
/// <summary>
/// 注册当前窗口的热键
/// </summary>
@@ -218,9 +412,17 @@ namespace GeekDesk
{
hotKeyId = GlobalHotKey.RegisterHotKey(appData.AppConfig.HotkeyModifiers, appData.AppConfig.Hotkey, () =>
{
if (RunTimeStatus.MAIN_HOT_KEY_DOWN) return;
RunTimeStatus.MAIN_HOT_KEY_DOWN = true;
new Thread(() =>
{
Thread.Sleep(RunTimeStatus.MAIN_HOT_KEY_TIME);
RunTimeStatus.MAIN_HOT_KEY_DOWN = false;
}).Start();
if (MotionControl.hotkeyFinished)
{
if (mainWindow.Visibility == Visibility.Collapsed || mainWindow.Opacity == 0 || MarginHide.IS_HIDE)
if (CheckShouldShowApp())
{
ShowApp();
}
@@ -234,7 +436,8 @@ namespace GeekDesk
{
HandyControl.Controls.Growl.Success("GeekDesk快捷键注册成功(" + appData.AppConfig.HotkeyStr + ")!", "HotKeyGrowl");
}
} else
}
else
{
}
}
@@ -329,21 +532,6 @@ namespace GeekDesk
}
/// <summary>
/// 重置窗体大小 写入缓存
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void MainWindow_Resize(object sender, System.EventArgs e)
{
if (this.DataContext != null)
{
AppData appData = this.DataContext as AppData;
appData.AppConfig.WindowWidth = this.Width;
appData.AppConfig.WindowHeight = this.Height;
}
}
/// <summary>
@@ -353,28 +541,9 @@ namespace GeekDesk
/// <param name="e"></param>
private void DragMove(object sender, MouseEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed)
{
var windowMode = this.ResizeMode;
if (this.ResizeMode != ResizeMode.NoResize)
{
this.ResizeMode = ResizeMode.NoResize;
}
this.UpdateLayout();
/* 当点击拖拽区域的时候,让窗口跟着移动
(When clicking the drag area, make the window follow) */
DragMove();
if (this.ResizeMode != windowMode)
{
this.ResizeMode = windowMode;
}
this.UpdateLayout();
}
}
@@ -422,8 +591,6 @@ namespace GeekDesk
// return;
//}
MainWindow.mainWindow.Activate();
if (MarginHide.ON_HIDE)
{
//修改贴边隐藏状态为未隐藏
@@ -437,35 +604,73 @@ namespace GeekDesk
if (appData.AppConfig.FollowMouse)
{
ShowWindowFollowMouse.Show(mainWindow, MousePosition.CENTER, 0, 0, false);
ShowWindowFollowMouse.Show(mainWindow, MousePosition.CENTER, 0, 0);
//ShowWindowFollowMouse.FollowMouse(mainWindow);
}
FadeStoryBoard(1, (int)CommonEnum.WINDOW_ANIMATION_TIME, Visibility.Visible);
MainWindow.mainWindow.Activate();
mainWindow.Show();
//mainWindow.Visibility = Visibility.Visible;
if (appData.AppConfig.AppAnimation)
{
appData.AppConfig.IsShow = true;
}
else
{
appData.AppConfig.IsShow = null;
//防止永远不显示界面
if (mainWindow.Opacity < 1)
{
mainWindow.Opacity = 1;
}
}
//FadeStoryBoard(1, (int)CommonEnum.WINDOW_ANIMATION_TIME, Visibility.Visible);
Keyboard.Focus(mainWindow);
if (RunTimeStatus.SHOW_MENU_PASSWORDBOX)
{
mainWindow.RightCard.PDDialog.SetFocus();
}
else
{
Keyboard.Focus(mainWindow.SearchBox);
}
}
public static void HideApp()
{
if (!MarginHide.IS_HIDE)
if (appData.AppConfig.AppAnimation)
{
appData.AppConfig.IsShow = false;
}
else
{
appData.AppConfig.IsShow = null;
HideAppVis();
}
}
private static void HideAppVis()
{
//关闭锁定
RunTimeStatus.LOCK_APP_PANEL = false;
if (RunTimeStatus.SEARCH_BOX_SHOW)
{
mainWindow.HidedSearchBox();
FadeStoryBoard(0, (int)CommonEnum.WINDOW_ANIMATION_TIME, Visibility.Collapsed);
}
else
{
FadeStoryBoard(0, (int)CommonEnum.WINDOW_ANIMATION_TIME, Visibility.Collapsed);
}
}
else
{
ShowApp();
}
mainWindow.Visibility = Visibility.Collapsed;
//if (!MarginHide.IS_HIDE)
//{
//}
//else
//{
// ShowApp();
//}
}
/// <summary>
@@ -522,7 +727,7 @@ namespace GeekDesk
/// <param name="e"></param>
private void NotifyIcon_Click(object sender, RoutedEventArgs e)
{
if (this.Visibility == Visibility.Collapsed || this.Opacity == 0)
if (CheckShouldShowApp())
{
ShowApp();
}
@@ -532,6 +737,14 @@ namespace GeekDesk
}
}
private static bool CheckShouldShowApp()
{
return mainWindow.Visibility == Visibility.Collapsed
|| mainWindow.Opacity == 0
|| MarginHide.IS_HIDE
|| !WindowUtil.WindowIsTop(mainWindow);
}
/// <summary>
/// 右键任务栏图标 设置
/// </summary>
@@ -620,6 +833,10 @@ namespace GeekDesk
appData.AppConfig.WindowWidth = this.Width;
appData.AppConfig.WindowHeight = this.Height;
}
if (guideRun)
{
Guide();
}
}
@@ -631,10 +848,14 @@ namespace GeekDesk
/// <param name="e"></param>
private void ExitApp(object sender, RoutedEventArgs e)
{
if (appData.AppConfig.MouseMiddleShow)
if (appData.AppConfig.MouseMiddleShow || appData.AppConfig.SecondsWindow == true)
{
MouseHookThread.Dispose();
}
if (appData.AppConfig.EnableEveryThing == true)
{
EveryThingUtil.DisableEveryThing();
}
Application.Current.Shutdown();
}
/// <summary>
@@ -642,19 +863,9 @@ namespace GeekDesk
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ReStartApp(object sender, RoutedEventArgs e)
public void ReStartApp(object sender, RoutedEventArgs e)
{
if (appData.AppConfig.MouseMiddleShow)
{
MouseHookThread.Dispose();
}
Process p = new Process();
p.StartInfo.FileName = Constants.APP_DIR + "GeekDesk.exe";
p.StartInfo.WorkingDirectory = Constants.APP_DIR;
p.Start();
Application.Current.Shutdown();
ProcessUtil.ReStartApp();
}
/// <summary>
@@ -676,16 +887,29 @@ namespace GeekDesk
{
HideApp();
}
//else if (
// appData.AppConfig.SearchType == SearchType.KEY_DOWN &&
// (
// (e.Key >= Key.D0 && e.Key <= Key.Z)
// || (e.Key >= Key.NumPad0 && e.Key < Key.NumPad9)
// )
// )
//{
// ShowSearchBox();
//}
if (RunTimeStatus.SEARCH_BOX_SHOW && (e.Key == Key.Up
|| e.Key == Key.Down
|| e.Key == Key.Tab
|| e.Key == Key.Enter
))
{
if (e.Key == Key.Down || e.Key == Key.Tab)
{
SearchResControl res = RightCard.VerticalCard.Content as SearchResControl;
res.SearchListBoxIndexAdd();
}
else if (e.Key == Key.Up)
{
SearchResControl res = RightCard.VerticalCard.Content as SearchResControl;
res.SearchListBoxIndexSub();
}
else if (e.Key == Key.Enter)
{
SearchResControl res = RightCard.VerticalCard.Content as SearchResControl;
res.StartupSelectionItem();
}
}
}
@@ -718,29 +942,227 @@ namespace GeekDesk
/// <param name="e"></param>
private void ColorPicker(object sender, RoutedEventArgs e)
{
TaskbarContextMenu.Visibility = Visibility.Collapsed;
App.DoEvents();
TaskbarContextMenu.IsOpen = false;
GlobalColorPickerWindow.CreateNoShow();
}
/// <summary>
/// 防止点击拾色器后无法显示菜单的问题
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void BarIcon_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
TaskbarContextMenu.Visibility = Visibility.Visible;
}
private void Window_GotFocus(object sender, RoutedEventArgs e)
{
// 如果没有在修改菜单 并且不是右键点击了面板
if (!RunTimeStatus.IS_MENU_EDIT
&& !RunTimeStatus.SHOW_RIGHT_BTN_MENU
&& !RunTimeStatus.APP_BTN_IS_DOWN)
{
if (RunTimeStatus.SHOW_MENU_PASSWORDBOX)
{
//必须在其它文本框没有工作的时候才给密码框焦点
RightCard.PDDialog.SetFocus();
}
else
{
//必须在其它文本框没有工作的时候才给搜索框焦点
Keyboard.Focus(SearchBox);
}
}
}
private void AppWindow_Deactivated(object sender, EventArgs e)
{
AppWindowLostFocus();
}
/// <summary>
/// 备份数据文件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
[Obsolete]
private void BakDataFile(object sender, RoutedEventArgs e)
{
Thread t = new Thread(() =>
{
CommonCode.BakAppData();
});
t.ApartmentState = ApartmentState.STA;
t.Start();
}
private void AppButton_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
//点击了面板
RunTimeStatus.APP_BTN_IS_DOWN = true;
new Thread(() =>
{
Thread.Sleep(50);
RunTimeStatus.APP_BTN_IS_DOWN = false;
}).Start();
}
private ICommand _hideCommand;
public ICommand HideCommand
{
get
{
if (_hideCommand == null)
{
_hideCommand = new RelayCommand(
p =>
{
return true;
},
p =>
{
HideAppVis();
});
}
return _hideCommand;
}
}
protected override void OnSourceInitialized(EventArgs e)
{
base.OnSourceInitialized(e);
HwndSource hwndSource = PresentationSource.FromVisual(this) as HwndSource;
if (hwndSource != null)
{
IntPtr handle = hwndSource.Handle;
hwndSource.AddHook(new HwndSourceHook(WndProc));
}
}
IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
if (msg == MessageUtil.WM_COPYDATA)
{
MessageUtil.CopyDataStruct cds = (MessageUtil.CopyDataStruct)System.Runtime.InteropServices.Marshal.PtrToStructure(lParam, typeof(MessageUtil.CopyDataStruct));
if ("ShowApp".Equals(cds.msg))
{
ShowApp();
}
}
return hwnd;
}
#region
private int guideIndex = 0;
private bool guideRun = false;
private void Guide()
{
try
{
guideRun = true;
//防止影响主程序进程
if (CheckShouldShowApp())
{
ShowApp();
}
GrayBorder.Visibility = Visibility.Visible;
GuideSwitch(guideIndex);
GuideCard.Visibility = Visibility.Visible;
}
catch (Exception) { guideRun = false; }
}
private void GuideSwitch(int index)
{
guideIndex = index;
GuideNum.Text = Convert.ToString(index + 1);
GuideTitle1.Text = GuideInfoList.mainWindowGuideList[index].Title1;
GuideTitle2.Text = GuideInfoList.mainWindowGuideList[index].Title2;
GuideText.Text = GuideInfoList.mainWindowGuideList[index].GuideText;
if (index == 0)
{
PreviewGuideBtn.Visibility = Visibility.Collapsed;
NextGuideBtn.Content = "下一步";
} else if (index > 0 && index < GuideInfoList.mainWindowGuideList.Count - 1)
{
PreviewGuideBtn.Visibility = Visibility.Visible;
NextGuideBtn.Content = "下一步";
} else
{
NextGuideBtn.Content = "完成";
}
switch (index)
{
default: //0 //右侧列表区域
Point point = RightCard.TransformToAncestor(this).Transform(new Point(0, 0));
//内部中上
GrayBoderClip(point.X, point.Y, RightCard.ActualWidth, RightCard.ActualHeight,
new Thickness(point.X + RightCard.ActualWidth / 2 - GuideCard.ActualWidth / 2, point.Y, 0, 0));
break;
case 1: //左侧菜单
Point leftCardPoint = LeftCard.TransformToAncestor(this).Transform(new Point(0, 0));
GrayBoderClip(leftCardPoint.X , leftCardPoint.Y , LeftCard.ActualWidth, LeftCard.ActualHeight,
// 外部中下侧
new Thickness(leftCardPoint.X + LeftCard.ActualWidth,
leftCardPoint.Y + LeftCard.ActualHeight / 2 - GuideCard.ActualHeight / 2, 0, 0));
break;
case 2: //头部拖拽栏
GrayBoderClip(0, 0, this.Width, 50,
// 外部中下侧
new Thickness(this.Width / 2 - GuideCard.ActualWidth / 2, 50, 0, 0));
break;
case 3:
Point mainBtnPoint = MainBtnPanel.TransformToAncestor(this).Transform(new Point(0, 0));
GrayBoderClip(mainBtnPoint.X, mainBtnPoint.Y, MainBtnPanel.ActualWidth, MainBtnPanel.ActualHeight,
// 外部左下侧
new Thickness(mainBtnPoint.X - GuideCard.Width,
mainBtnPoint.Y, 0, 0));
break;
}
}
private void GrayBoderClip(double x, double y, double w, double h, Thickness margin)
{
PathGeometry borGeometry = new PathGeometry();
RectangleGeometry rg = new RectangleGeometry();
rg.Rect = new Rect(0, 0, this.Width, this.Height);
borGeometry = Geometry.Combine(borGeometry, rg, GeometryCombineMode.Union, null);
GrayBorder.Clip = borGeometry;
RectangleGeometry rg1 = new RectangleGeometry();
rg1.Rect = new Rect(x - 20, y - 20, w, h);
borGeometry = Geometry.Combine(borGeometry, rg1, GeometryCombineMode.Exclude, null);
GuideCard.Margin = margin;
GrayBorder.Clip = borGeometry;
}
private void PreviewGuideBtn_Click(object sender, RoutedEventArgs e)
{
int index = Convert.ToInt32(GuideNum.Text.ToString()) - 1;
int previewIndex = index - 1;
GuideSwitch(previewIndex);
}
private void NextGuideBtn_Click(object sender, RoutedEventArgs e)
{
if ("完成".Equals(NextGuideBtn.Content.ToString())) {
GrayBorder.Visibility = Visibility.Collapsed;
GuideCard.Visibility = Visibility.Collapsed;
guideIndex = 0;
guideRun = false;
return;
}
int index = Convert.ToInt32(GuideNum.Text.ToString()) - 1;
int nextIndex = index + 1;
GuideSwitch(nextIndex);
}
#endregion
private void Guide_Click(object sender, RoutedEventArgs e)
{
Guide();
}
}
}

View File

@@ -1,3 +1,4 @@
# BookerLiu
diff a/MainWindow.xaml b/MainWindow.xaml (rejected hunks)
@@ -20,6 +20,7 @@
SizeChanged="Window_SizeChanged"

View File

@@ -1,7 +1,11 @@
using GeekDesk.Control.UserControls.Config;
using GeekDesk.Control.Windows;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using Gma.System.MouseKeyHook;
using System;
using System.Drawing;
using System.Threading;
using System.Windows;
using System.Windows.Threading;
@@ -9,28 +13,38 @@ namespace GeekDesk.MyThread
{
public class MouseHookThread
{
private static AppConfig appConfig = MainWindow.appData.AppConfig;
private static IKeyboardMouseEvents m_GlobalHook = Hook.GlobalEvents();
private static Dispatcher dispatcher;
private static readonly AppConfig appConfig = MainWindow.appData.AppConfig;
public static Dispatcher dispatcher;
private static UserActivityHook hook;
public static void MiddleHook()
public static void Hook()
{
//使用dispatcher来单独监听UI线程 防止程序卡顿
dispatcher = DispatcherBuild.Build();
m_GlobalHook = Hook.GlobalEvents();
dispatcher.BeginInvoke((Action)(() =>
dispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
{
m_GlobalHook.MouseUpExt += M_GlobalHook_MouseUpExt;
hook = new UserActivityHook();
if (appConfig.MouseMiddleShow)
{
hook.OnMouseWheelUp += OnMouseWheelUp;
}
hook.Start(true, false);
}));
}
public static void Dispose()
private static void OnMouseLeftDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
m_GlobalHook.MouseUpExt -= M_GlobalHook_MouseUpExt;
m_GlobalHook.Dispose();
dispatcher.InvokeShutdown();
}
private static void OnMouseLeftUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
}
private static void OnMouseWheelUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
MouseWheelShowApp(sender, e);
}
/// <summary>
@@ -38,13 +52,12 @@ namespace GeekDesk.MyThread
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private static void M_GlobalHook_MouseUpExt(object sender, System.Windows.Forms.MouseEventArgs e)
private static void MouseWheelShowApp(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (appConfig.MouseMiddleShow && e.Button == System.Windows.Forms.MouseButtons.Middle)
//中键打开App
if (appConfig.MouseMiddleShow && MotionControl.hotkeyFinished)
{
if (MotionControl.hotkeyFinished)
{
App.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, new Action(() =>
App.Current.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
{
if (MainWindow.mainWindow.Visibility == Visibility.Collapsed || MainWindow.mainWindow.Opacity == 0)
{
@@ -57,7 +70,38 @@ namespace GeekDesk.MyThread
}));
}
}
public static void Dispose()
{
try
{
if (hook != null)
{
if (hook.MouseWheelUpEnable())
{
hook.OnMouseWheelUp -= OnMouseWheelUp;
}
if (hook.MouseLeftDownEnable())
{
hook.OnMouseLeftDown -= OnMouseLeftDown;
}
if (hook.MouseLeftUpEnable())
{
hook.OnMouseLeftUp -= OnMouseLeftUp;
}
hook.Stop();
dispatcher.InvokeShutdown();
hook = null;
dispatcher = null;
}
}
catch (Exception ex)
{
LogUtil.WriteErrorLog(ex, "关闭hook出错");
}
}
}
}

View File

@@ -0,0 +1,48 @@
using GeekDesk.Constant;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using System;
using System.Collections.ObjectModel;
using System.IO;
using System.Threading;
namespace GeekDesk.MyThread
{
public class RelativePathThread
{
public static void MakeRelativePath()
{
new Thread(() =>
{
try
{
ObservableCollection<MenuInfo> menuList = MainWindow.appData.MenuList;
string myExePath = Constants.APP_DIR + "GeekDesk.exe";
foreach (MenuInfo mi in menuList)
{
ObservableCollection<IconInfo> iconList = mi.IconList;
if (iconList == null) continue;
foreach (IconInfo icon in iconList)
{
if (icon == null) continue;
string relativePath = FileUtil.MakeRelativePath(myExePath, icon.Path);
if (File.Exists(icon.Path)
&& !string.IsNullOrEmpty(relativePath)
&& !relativePath.Equals(icon.Path))
{
icon.RelativePath_NoWrite = relativePath;
}
}
}
CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH);
//CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_BAK_PATH);
}
catch (Exception ex)
{
LogUtil.WriteErrorLog(ex, "init相对路径出错!");
}
}).Start();
}
}
}

View File

@@ -1,70 +0,0 @@
using GeekDesk.Constant;
using GeekDesk.Control.Windows;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using Newtonsoft.Json.Linq;
using System;
using System.Configuration;
using System.Threading;
namespace GeekDesk.MyThread
{
public class UpdateThread
{
private static AppConfig appConfig = MainWindow.appData.AppConfig;
public static void Update()
{
System.Threading.Thread t = new System.Threading.Thread(new ThreadStart(UpdateApp))
{
IsBackground = true
};
t.Start();
}
private static void UpdateApp()
{
try
{
//等待1分钟后再检查更新 有的网络连接过慢
int sleepTime = 60 * 1000;
if (Constants.DEV)
{
sleepTime = 1;
}
System.Threading.Thread.Sleep(sleepTime);
string updateUrl;
string nowVersion = ConfigurationManager.AppSettings["Version"];
switch (appConfig.UpdateType)
{
case UpdateType.GitHub:
updateUrl = ConfigurationManager.AppSettings["GitHubUpdateUrl"];
break;
default:
updateUrl = ConfigurationManager.AppSettings["GiteeUpdateUrl"];
break;
}
string updateInfo = HttpUtil.Get(updateUrl);
if (!StringUtil.IsEmpty(updateInfo))
{
JObject jo = JObject.Parse(updateInfo);
string onlineVersion = jo["version"].ToString();
if (onlineVersion.CompareTo(nowVersion) > 0)
{
App.Current.Dispatcher.Invoke((Action)(() =>
{
//检测到版本更新
UpdateWindow.Show(jo);
}));
}
}
}
catch (Exception ex)
{
LogUtil.WriteErrorLog(ex, "获取更新失败!");
}
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,740 @@
; Please make sure Everything is not running before modifying this file.
[Everything]
run_as_admin=0
allow_http_server=1
allow_etp_server=1
window_x=130
window_y=130
window_wide=794
window_high=664
maximized=0
minimized=0
fullscreen=0
ontop=0
bring_into_view=1
alpha=255
match_whole_word=0
match_path=0
match_case=0
match_diacritics=0
match_regex=0
view=0
thumbnail_size=64
thumbnail_fill=0
min_thumbnail_size=32
max_thumbnail_size=256
medium_thumbnail_size=64
large_thumbnail_size=128
extra_large_thumbnail_size=256
thumbnail_load_size=0
thumbnail_overlay_icon=1
shell_max_path=0
allow_multiple_windows=0
allow_multiple_instances=0
run_in_background=1
show_in_taskbar=1
show_tray_icon=0
minimize_to_tray=0
toggle_window_from_tray_icon=0
alternate_row_color=0
show_mouseover=0
check_for_updates_on_startup=0
beta_updates=0
show_highlighted_search_terms=1
text_size=0
hide_empty_search_results=0
clear_selection_on_search=1
show_focus_on_search=0
new_window_key=0
show_window_key=0
toggle_window_key=0
language=0
show_selected_item_in_statusbar=1
statusbar_selected_item_format=
show_size_in_statusbar=0
statusbar_size_format=0
open_folder_command2=
open_file_command2=
open_path_command2=
explore_command2=
explore_path_command2=
window_title_format=
taskbar_notification_title_format=
instance_name=
translucent_selection_rectangle_alpha=70
min_zoom=-6
max_zoom=27
context_menu_type=0
context_menu_shell_extensions=1
auto_include_fixed_volumes=1
auto_include_removable_volumes=0
auto_remove_offline_ntfs_volumes=1
auto_remove_moved_ntfs_volumes=1
auto_include_fixed_refs_volumes=1
auto_include_removable_refs_volumes=0
auto_remove_offline_refs_volumes=1
auto_remove_moved_refs_volumes=1
find_mount_points_on_removable_volumes=0
scan_volume_drive_letters=1
last_export_type=0
max_threads=0
reuse_threads=1
find_subfolders_and_files_max_threads=0
single_parent_context_menu=0
auto_size_1=512
auto_size_2=640
auto_size_3=768
auto_size_aspect_ratio_x=9
auto_size_aspect_ratio_y=7
auto_size_width_only=0
auto_size_path_x=1
auto_size_path_y=2
sticky_vscroll_bottom=1
last_options_page=0
draw_focus_rect=1
date_format=
time_format=
listview_item_high=0
single_click_open=0
underline_icon_titles=0
icons_only=0
icon_shell_extensions=1
auto_scroll_repeat_delay=250
auto_scroll_repeat_rate=50
open_many_files_warning_threshold=16
set_foreground_window_attach_thread_input=0
debug=0
debug_log=0
verbose=0
lvm=1
ipc=1
home_match_case=0
home_match_whole_word=0
home_match_path=0
home_match_diacritics=0
home_regex=0
home_search=1
home_filter=0
home_sort=0
home_view=0
home_index=1
allow_multiple_windows_from_tray=0
single_click_tray=0
close_on_execute=0
double_click_path=0
update_display_after_scroll=0
update_display_after_mask=1
auto_scroll_view=0
double_quote_copy_as_path=0
snap=0
snaplen=10
rename_select_filepart_only=0
rename_move_caret_to_selection_end=0
rename_nav=0
search_edit_move_caret_to_selection_end=0
search_edit_drag_accept_files=0
select_search_on_mouse_click=1
focus_search_on_activate=0
reset_vscroll_on_search=1
wrap_focus=0
load_icon_priority=0
load_thumbnail_priority=0
load_fileinfo_priority=0
always_request_all_fileinfo=0
header_high=0
hide_on_close=0
max_hidden_windows=0
winmm=0
menu_escape_amp=1
menu_folders=0
menu_folder_separator=
menu_items_per_column=0
new_inherit=1
full_row_select=0
tray_show_command_line=
dpi=96
ctrl_mouse_wheel_action=1
lvm_scroll=1
allow_open=1
allow_context_menu=1
allow_delete=1
allow_rename=1
allow_cut=1
allow_copy=1
allow_paste=1
allow_drag_drop=1
allow_window_message_filter_dragdrop=0
auto_column_widths=0
hotkey_explorer_path_search=0
hotkey_user_notification_state=0
get_key_name_text=1
paste_new_line_op=0
esc_cancel_action=1
fast_ascii_search=1
match_path_when_search_contains_path_separator=1
allow_literal_operators=0
allow_round_bracket_parenthesis=0
expand_environment_variables=0
search_as_you_type=1
always_update_query_on_search_parameter_change=0
convert_forward_slash_to_backslash=0
match_whole_filename_when_using_wildcards=1
operator_precedence=0
replace_exact_trailing_star_dot_star_with_star=1
allow_exclamation_point_not=1
search_command_prefix=
auto_complete_search_command=1
double_buffer=1
search=
show_number_of_results_with_selection=0
date_descending_first=0
size_descending_first=0
size_format=2
alpha_select=0
tooltips=1
listview_tooltips=1
show_detailed_listview_tooltips=1
rtl_listview_edit=0
force_path_ltr_order=1
force_path_left_align=1
date_time_order=0
date_time_align=1
size_align=3
invert_layout=0
update_layout_on_input_language_change=0
control_shift_action=3
change_search_rtl_reading_action=3
invert_layout_action=3
bookmark_remember_case=1
bookmark_remember_wholeword=1
bookmark_remember_path=1
bookmark_remember_diacritic=1
bookmark_remember_regex=1
bookmark_remember_sort=1
bookmark_remember_view=1
bookmark_remember_filter=1
bookmark_remember_index=1
bookmark_remember_search=1
bookmark_organize_x=0
bookmark_organize_y=0
bookmark_organize_wide=0
bookmark_organize_high=0
exclude_list_enabled=1
exclude_hidden_files_and_folders=0
exclude_system_files_and_folders=0
include_only_files=
exclude_files=
db_location=
db_multi_user_filename=0
db_compress=0
index_size=1
fast_size_sort=1
index_date_created=0
fast_date_created_sort=0
index_date_modified=1
fast_date_modified_sort=1
index_date_accessed=0
fast_date_accessed_sort=0
index_attributes=0
fast_attributes_sort=0
index_folder_size=0
fast_path_sort=1
fast_extension_sort=0
extended_information_cache_monitor=1
db_update_thread_priority=-15
index_recent_changes=1
refs_file_id_extd_directory_info_buffer_size=0
folder_update_thread_mode_background=0
folder_update_rescan_asap=1
monitor_thread_mode_background=1
monitor_retry_delay=30000
monitor_update_delay=1000
monitor_pause=0
usn_record_filter=0xffffffff
cancel_delay=0x000003e8
allow_ntfs_open_file_by_id=1
always_update_folder_recent_change=0
editor_x=0
editor_y=0
editor_wide=0
editor_high=0
editor_maximized=0
file_list_relative_paths=0
rename_x=0
rename_y=0
rename_wide=0
rename_high=0
rename_match_case=0
rename_regex=0
advanced_copy_to_x=0
advanced_copy_to_y=0
advanced_copy_to_wide=0
advanced_copy_to_high=0
advanced_copy_to_match_case=0
advanced_copy_to_regex=0
advanced_move_to_x=0
advanced_move_to_y=0
advanced_move_to_wide=0
advanced_move_to_high=0
advanced_move_to_match_case=0
advanced_move_to_regex=0
advanced_search_x=0
advanced_search_y=0
advanced_search_wide=0
advanced_search_high=0
advanced_search_page_y_offset=0
advanced_search_focus_id=0
advanced_search_warnings=1
max_recv_size=8388608
display_full_path_name=0
size_tiny=10240
size_small=102400
size_medium=1048576
size_large=16777216
size_huge=134217728
themed_toolbar=1
show_copy_name=2
show_copy_path=2
show_copy_full_name=2
show_open_path=2
show_explore=2
show_explore_path=2
copy_path_folder_append_backslash=0
custom_verb01=
custom_verb02=
custom_verb03=
custom_verb04=
custom_verb05=
custom_verb06=
custom_verb07=
custom_verb08=
custom_verb09=
custom_verb10=
custom_verb11=
custom_verb12=
filters_visible=0
filters_wide=128
filters_right_align=1
filters_tab_stop=0
filter=
filter_everything_name=
filter_organize_x=0
filter_organize_y=0
filter_organize_wide=0
filter_organize_high=0
preview_visible=0
preview_x=640
preview_tab_stop=0
preview_mag_filter=0
preview_min_filter=0
preview_fill=0
show_preview_handlers_in_preview_pane=0
preview_load_size=0
preview_context=0x00000000
preview_release_handler_on_clear=0
sort=Run Count
sort_ascending=0
always_keep_sort=0
index=0
index_file_list=
index_etp_server=
index_link_type=1
status_bar_visible=1
select_search_on_focus_mode=1
select_search_on_set_mode=2
search_history_enabled=0
run_history_enabled=1
search_history_days_to_keep=90
run_history_days_to_keep=90
search_history_keep_forever=1
run_history_keep_forever=1
search_history_always_suggest=0
search_history_always_suggest_extend_toolbar=0
search_history_visible_count_max=12
search_history_always_suggest_visible_count_max=1
search_history_show_all_max=256
search_history_suggestion_max=256
search_history_show_all_sort=2
search_history_suggestion_sort=1
search_history_show_above=0
search_history_sort=2
search_history_sort_ascending=0
search_history_x=0
search_history_y=0
search_history_wide=0
search_history_high=0
search_history_column_search_wide=208
search_history_column_search_order=0
search_history_column_count_wide=128
search_history_column_count_order=1
search_history_column_date_wide=128
search_history_column_date_order=2
etp_server_enabled=0
etp_server_bindings=
etp_server_port=21
etp_server_username=
etp_server_password=
etp_server_welcome_message=
etp_server_log_file_name=
etp_server_logging_enabled=0
etp_server_log_max_size=4194304
etp_server_log_delta_size=524288
etp_server_allow_file_download=1
ftp_allow_port=1
ftp_check_data_connection_ip=1
http_server_enabled=0
http_server_bindings=
http_title_format=
http_server_port=80
http_server_username=
http_server_password=
http_server_home=
http_server_default_page=
http_server_log_file_name=
http_server_logging_enabled=0
http_server_log_max_size=4194304
http_server_log_delta_size=524288
http_server_allow_file_download=1
http_server_items_per_page=32
http_server_show_drive_labels=0
http_server_strings=
http_server_header=
service_pipe_name=
name_column_pos=0
name_column_width=256
path_column_visible=1
path_column_pos=1
path_column_width=256
size_column_visible=1
size_column_pos=2
size_column_width=96
extension_column_visible=0
extension_column_pos=3
extension_column_width=96
type_column_visible=0
type_column_pos=4
type_column_width=96
last_write_time_column_visible=1
last_write_time_column_pos=3
last_write_time_column_width=153
creation_time_column_visible=0
creation_time_column_pos=6
creation_time_column_width=153
date_accessed_column_visible=0
date_accessed_column_pos=7
date_accessed_column_width=153
attribute_column_visible=0
attribute_column_pos=8
attribute_column_width=70
date_recently_changed_column_visible=0
date_recently_changed_column_pos=9
date_recently_changed_column_width=153
run_count_column_visible=0
run_count_column_pos=10
run_count_column_width=96
date_run_column_visible=0
date_run_column_pos=11
date_run_column_width=153
file_list_filename_column_visible=0
file_list_filename_column_pos=12
file_list_filename_column_width=96
translucent_selection_rectangle_background_color=
translucent_selection_rectangle_border_color=
thumbnail_mouseover_border_color=
preview_background_color=
ntfs_volume_guids="\\\\?\\Volume{6afe1915-0a0b-4e59-96bc-666ff914ea4f}","\\\\?\\Volume{71be44cf-e03a-462f-a9c8-b53c16e002a4}"
ntfs_volume_paths="C:","D:"
ntfs_volume_roots="",""
ntfs_volume_includes=1,1
ntfs_volume_load_recent_changes=0,0
ntfs_volume_include_onlys="",""
ntfs_volume_monitors=1,1
refs_volume_guids=
refs_volume_paths=
refs_volume_roots=
refs_volume_includes=
refs_volume_load_recent_changes=
refs_volume_include_onlys=
refs_volume_monitors=
filelists=
filelist_monitor_changes=
folders=
folder_monitor_changes=
folder_buffer_size_list=
folder_rescan_if_full_list=
folder_update_types=
folder_update_days=
folder_update_ats=
folder_update_intervals=
folder_update_interval_types=
exclude_folders=
connect_history_hosts=
connect_history_ports=
connect_history_usernames=
connect_history_link_types=
etp_client_rewrite_patterns=
etp_client_rewrite_substitutions=
file_new_search_window_keys=334
file_open_file_list_keys=335
file_close_file_list_keys=
file_close_keys=343,27
file_export_keys=339
file_copy_full_name_to_clipboard_keys=9539
file_copy_path_to_clipboard_keys=
file_set_run_count_keys=
file_create_shortcut_keys=
file_delete_keys=8238
file_delete_permanently_keys=9262
file_edit_keys=
file_open_keys=8205
file_open_selection_and_close_everything_keys=
file_explore_path_keys=
file_open_new_keys=
file_open_path_keys=8461
file_open_with_keys=
file_open_with_default_verb_keys=
file_play_keys=
file_preview_keys=
file_print_keys=
file_print_to_keys=
file_properties_keys=8717
file_read_extended_information_keys=8517
file_rename_keys=8305
file_run_as_keys=
file_exit_keys=337
file_copy_name_to_clipboard_keys=
file_open_selection_and_do_not_close_everything_keys=
file_open_most_run_keys=
file_open_last_run_keys=
file_custom_verb_1_keys=
file_custom_verb_2_keys=
file_custom_verb_3_keys=
file_custom_verb_4_keys=
file_custom_verb_5_keys=
file_custom_verb_6_keys=
file_custom_verb_7_keys=
file_custom_verb_8_keys=
file_custom_verb_9_keys=
file_custom_verb_10_keys=
file_custom_verb_11_keys=
file_custom_verb_12_keys=
indexes_folders_rescan_all_now_keys=
indexes_force_rebuild_keys=
edit_cut_keys=8536
edit_copy_keys=8515,8493
edit_paste_keys=8534,9261
edit_select_all_keys=8513
edit_invert_selection_keys=
edit_copy_to_folder_keys=
edit_move_to_folder_keys=
edit_advanced_advanced_copy_to_folder_keys=
edit_advanced_advanced_move_to_folder_keys=
view_filters_keys=
view_preview_keys=592
view_status_bar_keys=
view_details_keys=1334
view_medium_thumbnails_keys=1331
view_large_thumbnails_keys=1330
view_extra_large_thumbnails_keys=1329
view_increase_thumbnail_size_keys=1467
view_decrease_thumbnail_size_keys=1469
view_window_size_small_keys=561
view_window_size_medium_keys=562
view_window_size_large_keys=563
view_window_size_auto_fit_keys=564
view_zoom_zoom_in_keys=443
view_zoom_zoom_out_keys=445
view_zoom_reset_keys=304,352
view_go_to_back_keys=549,166
view_go_to_forward_keys=551,167
view_go_to_home_keys=548
view_go_to_show_all_history_keys=1352,328
view_sort_by_name_keys=305
view_sort_by_path_keys=306
view_sort_by_size_keys=307
view_sort_by_extension_keys=308
view_sort_by_type_keys=309
view_sort_by_date_modified_keys=310
view_sort_by_date_created_keys=311
view_sort_by_attributes_keys=312
view_sort_by_file_list_filename_keys=
view_sort_by_run_count_keys=
view_sort_by_date_run_keys=
view_sort_by_date_recently_changed_keys=313
view_sort_by_date_accessed_keys=
view_sort_by_ascending_keys=
view_sort_by_descending_keys=
view_refresh_keys=116
view_fullscreen_keys=122
view_toggle_ltrrtl_direction_keys=
view_on_top_never_keys=
view_on_top_always_keys=
view_on_top_while_searching_keys=
search_match_case_keys=329
search_match_whole_word_keys=322
search_match_path_keys=341
search_match_diacritics_keys=333
search_enable_regex_keys=338
search_advanced_search_keys=
search_add_to_filters_keys=
search_organize_filters_keys=1350
bookmarks_add_to_bookmarks_keys=324
bookmarks_organize_bookmarks_keys=1346
tools_options_keys=336
tools_console_keys=448
tools_file_list_editor_keys=
tools_connect_to_etp_server_keys=
tools_disconnect_from_etp_server_keys=
help_everything_help_keys=112
help_search_syntax_keys=
help_regex_syntax_keys=
help_command_line_options_keys=
help_everything_website_keys=
help_check_for_updates_keys=
help_about_everything_keys=368
help_donate_keys=
search_edit_focus_search_edit_keys=326,114,580
search_edit_delete_previous_word_keys=4360
search_edit_auto_complete_search_keys=4384
search_edit_show_search_history_keys=
search_edit_show_all_search_history_keys=4646,4648
result_list_item_up_keys=8230,4134
result_list_item_down_keys=8232,4136
result_list_page_up_keys=8225,4129
result_list_page_down_keys=8226,4130
result_list_start_of_list_keys=8228
result_list_end_of_list_keys=8227
result_list_item_up_extend_keys=9254,5158
result_list_item_down_extend_keys=9256,5160
result_list_page_up_extend_keys=9249,5153
result_list_page_down_extend_keys=9250,5154
result_list_start_of_list_extend_keys=9252
result_list_end_of_list_extend_keys=9251
result_list_focus_up_keys=8486,4390
result_list_focus_down_keys=8488,4392
result_list_focus_page_up_keys=8481,4385
result_list_focus_page_down_keys=8482,4386
result_list_focus_start_of_list_keys=8484
result_list_focus_end_of_list_keys=8483
result_list_focus_up_extend_keys=9510,5414
result_list_focus_down_extend_keys=9512,5416
result_list_focus_page_up_extend_keys=9505,5409
result_list_focus_page_down_extend_keys=9506,5410
result_list_focus_start_of_list_extend_keys=9508
result_list_focus_end_of_list_extend_keys=9507
result_list_focus_result_list_keys=
result_list_focus_highest_run_count_result_keys=
result_list_focus_last_run_result_keys=
result_list_toggle_path_column_keys=
result_list_toggle_size_column_keys=
result_list_toggle_extension_column_keys=
result_list_toggle_type_column_keys=
result_list_toggle_date_modified_column_keys=
result_list_toggle_date_created_column_keys=
result_list_toggle_attributes_column_keys=
result_list_toggle_file_list_filename_column_keys=
result_list_toggle_run_count_column_keys=
result_list_toggle_date_recently_changed_column_keys=
result_list_toggle_date_accessed_column_keys=
result_list_toggle_date_run_column_keys=
result_list_size_all_columns_to_fit_keys=8555
result_list_size_result_list_to_fit_keys=
result_list_context_menu_keys=9337
result_list_scroll_left_or_thumbnail_left_keys=8229
result_list_scroll_right_or_thumbnail_right_keys=8231
result_list_scroll_page_left_or_thumbnail_focus_left_keys=8485
result_list_scroll_page_right_or_thumbnail_focus_right_keys=8487
result_list_left_extend_keys=9253
result_list_right_extend_keys=9255
result_list_focus_left_extend_keys=9509
result_list_focus_right_extend_keys=9511
result_list_select_focus_keys=8224
result_list_toggle_focus_selection_keys=8480
result_list_copy_as_csv_keys=
preview_focus_preview_keys=
result_list_font=
result_list_font_size=
search_edit_font=
search_edit_font_size=
status_bar_font=
status_bar_font_size=
header_font=
header_font_size=
normal_background_color=
normal_foreground_color=
normal_bold=
highlighted_background_color=
highlighted_foreground_color=
highlighted_bold=
current_sort_background_color=
current_sort_foreground_color=
current_sort_bold=
current_sort_highlighted_background_color=
current_sort_highlighted_foreground_color=
current_sort_highlighted_bold=
selected_background_color=
selected_foreground_color=
selected_bold=
selected_highlighted_background_color=
selected_highlighted_foreground_color=
selected_highlighted_bold=
selected_inactive_background_color=
selected_inactive_foreground_color=
selected_inactive_bold=
selected_inactive_highlighted_background_color=
selected_inactive_highlighted_foreground_color=
selected_inactive_highlighted_bold=
drop_target_background_color=
drop_target_foreground_color=
drop_target_bold=
drop_target_highlighted_background_color=
drop_target_highlighted_foreground_color=
drop_target_highlighted_bold=
mouseover_background_color=
mouseover_foreground_color=
mouseover_bold=
mouseover_highlighted_background_color=
mouseover_highlighted_foreground_color=
mouseover_highlighted_bold=
mouseover_current_sort_background_color=
mouseover_current_sort_foreground_color=
mouseover_current_sort_bold=
mouseover_current_sort_highlighted_background_color=
mouseover_current_sort_highlighted_foreground_color=
mouseover_current_sort_highlighted_bold=
alternate_row_background_color=
alternate_row_foreground_color=
alternate_row_bold=
alternate_row_highlighted_background_color=
alternate_row_highlighted_foreground_color=
alternate_row_highlighted_bold=
current_sort_alternate_row_background_color=
current_sort_alternate_row_foreground_color=
current_sort_alternate_row_bold=
current_sort_alternate_row_highlighted_background_color=
current_sort_alternate_row_highlighted_foreground_color=
current_sort_alternate_row_highlighted_bold=
hot_background_color=
hot_foreground_color=
hot_bold=
hot_highlighted_background_color=
hot_highlighted_foreground_color=
hot_highlighted_bold=
selected_hot_background_color=
selected_hot_foreground_color=
selected_hot_bold=
selected_hot_highlighted_background_color=
selected_hot_highlighted_foreground_color=
selected_hot_highlighted_bold=
selected_inactive_hot_background_color=
selected_inactive_hot_foreground_color=
selected_inactive_hot_bold=
selected_inactive_hot_highlighted_background_color=
selected_inactive_hot_highlighted_foreground_color=
selected_inactive_hot_highlighted_bold=
thumbnail_mouseover_background_color=
thumbnail_mouseover_foreground_color=
thumbnail_mouseover_bold=
thumbnail_mouseover_highlighted_background_color=
thumbnail_mouseover_highlighted_foreground_color=
thumbnail_mouseover_highlighted_bold=

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,740 @@
; Please make sure Everything is not running before modifying this file.
[Everything]
run_as_admin=0
allow_http_server=1
allow_etp_server=1
window_x=130
window_y=130
window_wide=794
window_high=664
maximized=0
minimized=0
fullscreen=0
ontop=0
bring_into_view=1
alpha=255
match_whole_word=0
match_path=0
match_case=0
match_diacritics=0
match_regex=0
view=0
thumbnail_size=64
thumbnail_fill=0
min_thumbnail_size=32
max_thumbnail_size=256
medium_thumbnail_size=64
large_thumbnail_size=128
extra_large_thumbnail_size=256
thumbnail_load_size=0
thumbnail_overlay_icon=1
shell_max_path=0
allow_multiple_windows=0
allow_multiple_instances=0
run_in_background=1
show_in_taskbar=1
show_tray_icon=0
minimize_to_tray=0
toggle_window_from_tray_icon=0
alternate_row_color=0
show_mouseover=0
check_for_updates_on_startup=0
beta_updates=0
show_highlighted_search_terms=1
text_size=0
hide_empty_search_results=0
clear_selection_on_search=1
show_focus_on_search=0
new_window_key=0
show_window_key=0
toggle_window_key=0
language=0
show_selected_item_in_statusbar=1
statusbar_selected_item_format=
show_size_in_statusbar=0
statusbar_size_format=0
open_folder_command2=
open_file_command2=
open_path_command2=
explore_command2=
explore_path_command2=
window_title_format=
taskbar_notification_title_format=
instance_name=
translucent_selection_rectangle_alpha=70
min_zoom=-6
max_zoom=27
context_menu_type=0
context_menu_shell_extensions=1
auto_include_fixed_volumes=1
auto_include_removable_volumes=0
auto_remove_offline_ntfs_volumes=1
auto_remove_moved_ntfs_volumes=1
auto_include_fixed_refs_volumes=1
auto_include_removable_refs_volumes=0
auto_remove_offline_refs_volumes=1
auto_remove_moved_refs_volumes=1
find_mount_points_on_removable_volumes=0
scan_volume_drive_letters=1
last_export_type=0
max_threads=0
reuse_threads=1
find_subfolders_and_files_max_threads=0
single_parent_context_menu=0
auto_size_1=512
auto_size_2=640
auto_size_3=768
auto_size_aspect_ratio_x=9
auto_size_aspect_ratio_y=7
auto_size_width_only=0
auto_size_path_x=1
auto_size_path_y=2
sticky_vscroll_bottom=1
last_options_page=0
draw_focus_rect=1
date_format=
time_format=
listview_item_high=0
single_click_open=0
underline_icon_titles=0
icons_only=0
icon_shell_extensions=1
auto_scroll_repeat_delay=250
auto_scroll_repeat_rate=50
open_many_files_warning_threshold=16
set_foreground_window_attach_thread_input=0
debug=0
debug_log=0
verbose=0
lvm=1
ipc=1
home_match_case=0
home_match_whole_word=0
home_match_path=0
home_match_diacritics=0
home_regex=0
home_search=1
home_filter=0
home_sort=0
home_view=0
home_index=1
allow_multiple_windows_from_tray=0
single_click_tray=0
close_on_execute=0
double_click_path=0
update_display_after_scroll=0
update_display_after_mask=1
auto_scroll_view=0
double_quote_copy_as_path=0
snap=0
snaplen=10
rename_select_filepart_only=0
rename_move_caret_to_selection_end=0
rename_nav=0
search_edit_move_caret_to_selection_end=0
search_edit_drag_accept_files=0
select_search_on_mouse_click=1
focus_search_on_activate=0
reset_vscroll_on_search=1
wrap_focus=0
load_icon_priority=0
load_thumbnail_priority=0
load_fileinfo_priority=0
always_request_all_fileinfo=0
header_high=0
hide_on_close=0
max_hidden_windows=0
winmm=0
menu_escape_amp=1
menu_folders=0
menu_folder_separator=
menu_items_per_column=0
new_inherit=1
full_row_select=0
tray_show_command_line=
dpi=96
ctrl_mouse_wheel_action=1
lvm_scroll=1
allow_open=1
allow_context_menu=1
allow_delete=1
allow_rename=1
allow_cut=1
allow_copy=1
allow_paste=1
allow_drag_drop=1
allow_window_message_filter_dragdrop=0
auto_column_widths=0
hotkey_explorer_path_search=0
hotkey_user_notification_state=0
get_key_name_text=1
paste_new_line_op=0
esc_cancel_action=1
fast_ascii_search=1
match_path_when_search_contains_path_separator=1
allow_literal_operators=0
allow_round_bracket_parenthesis=0
expand_environment_variables=0
search_as_you_type=1
always_update_query_on_search_parameter_change=0
convert_forward_slash_to_backslash=0
match_whole_filename_when_using_wildcards=1
operator_precedence=0
replace_exact_trailing_star_dot_star_with_star=1
allow_exclamation_point_not=1
search_command_prefix=
auto_complete_search_command=1
double_buffer=1
search=
show_number_of_results_with_selection=0
date_descending_first=0
size_descending_first=0
size_format=2
alpha_select=0
tooltips=1
listview_tooltips=1
show_detailed_listview_tooltips=1
rtl_listview_edit=0
force_path_ltr_order=1
force_path_left_align=1
date_time_order=0
date_time_align=1
size_align=3
invert_layout=0
update_layout_on_input_language_change=0
control_shift_action=3
change_search_rtl_reading_action=3
invert_layout_action=3
bookmark_remember_case=1
bookmark_remember_wholeword=1
bookmark_remember_path=1
bookmark_remember_diacritic=1
bookmark_remember_regex=1
bookmark_remember_sort=1
bookmark_remember_view=1
bookmark_remember_filter=1
bookmark_remember_index=1
bookmark_remember_search=1
bookmark_organize_x=0
bookmark_organize_y=0
bookmark_organize_wide=0
bookmark_organize_high=0
exclude_list_enabled=1
exclude_hidden_files_and_folders=0
exclude_system_files_and_folders=0
include_only_files=
exclude_files=
db_location=
db_multi_user_filename=0
db_compress=0
index_size=1
fast_size_sort=1
index_date_created=0
fast_date_created_sort=0
index_date_modified=1
fast_date_modified_sort=1
index_date_accessed=0
fast_date_accessed_sort=0
index_attributes=0
fast_attributes_sort=0
index_folder_size=0
fast_path_sort=1
fast_extension_sort=0
extended_information_cache_monitor=1
db_update_thread_priority=-15
index_recent_changes=1
refs_file_id_extd_directory_info_buffer_size=0
folder_update_thread_mode_background=0
folder_update_rescan_asap=1
monitor_thread_mode_background=1
monitor_retry_delay=30000
monitor_update_delay=1000
monitor_pause=0
usn_record_filter=0xffffffff
cancel_delay=0x000003e8
allow_ntfs_open_file_by_id=1
always_update_folder_recent_change=0
editor_x=0
editor_y=0
editor_wide=0
editor_high=0
editor_maximized=0
file_list_relative_paths=0
rename_x=0
rename_y=0
rename_wide=0
rename_high=0
rename_match_case=0
rename_regex=0
advanced_copy_to_x=0
advanced_copy_to_y=0
advanced_copy_to_wide=0
advanced_copy_to_high=0
advanced_copy_to_match_case=0
advanced_copy_to_regex=0
advanced_move_to_x=0
advanced_move_to_y=0
advanced_move_to_wide=0
advanced_move_to_high=0
advanced_move_to_match_case=0
advanced_move_to_regex=0
advanced_search_x=0
advanced_search_y=0
advanced_search_wide=0
advanced_search_high=0
advanced_search_page_y_offset=0
advanced_search_focus_id=0
advanced_search_warnings=1
max_recv_size=8388608
display_full_path_name=0
size_tiny=10240
size_small=102400
size_medium=1048576
size_large=16777216
size_huge=134217728
themed_toolbar=1
show_copy_name=2
show_copy_path=2
show_copy_full_name=2
show_open_path=2
show_explore=2
show_explore_path=2
copy_path_folder_append_backslash=0
custom_verb01=
custom_verb02=
custom_verb03=
custom_verb04=
custom_verb05=
custom_verb06=
custom_verb07=
custom_verb08=
custom_verb09=
custom_verb10=
custom_verb11=
custom_verb12=
filters_visible=0
filters_wide=128
filters_right_align=1
filters_tab_stop=0
filter=
filter_everything_name=
filter_organize_x=0
filter_organize_y=0
filter_organize_wide=0
filter_organize_high=0
preview_visible=0
preview_x=640
preview_tab_stop=0
preview_mag_filter=0
preview_min_filter=0
preview_fill=0
show_preview_handlers_in_preview_pane=0
preview_load_size=0
preview_context=0x00000000
preview_release_handler_on_clear=0
sort=Run Count
sort_ascending=0
always_keep_sort=0
index=0
index_file_list=
index_etp_server=
index_link_type=1
status_bar_visible=1
select_search_on_focus_mode=1
select_search_on_set_mode=2
search_history_enabled=0
run_history_enabled=1
search_history_days_to_keep=90
run_history_days_to_keep=90
search_history_keep_forever=1
run_history_keep_forever=1
search_history_always_suggest=0
search_history_always_suggest_extend_toolbar=0
search_history_visible_count_max=12
search_history_always_suggest_visible_count_max=1
search_history_show_all_max=256
search_history_suggestion_max=256
search_history_show_all_sort=2
search_history_suggestion_sort=1
search_history_show_above=0
search_history_sort=2
search_history_sort_ascending=0
search_history_x=0
search_history_y=0
search_history_wide=0
search_history_high=0
search_history_column_search_wide=208
search_history_column_search_order=0
search_history_column_count_wide=128
search_history_column_count_order=1
search_history_column_date_wide=128
search_history_column_date_order=2
etp_server_enabled=0
etp_server_bindings=
etp_server_port=21
etp_server_username=
etp_server_password=
etp_server_welcome_message=
etp_server_log_file_name=
etp_server_logging_enabled=0
etp_server_log_max_size=4194304
etp_server_log_delta_size=524288
etp_server_allow_file_download=1
ftp_allow_port=1
ftp_check_data_connection_ip=1
http_server_enabled=0
http_server_bindings=
http_title_format=
http_server_port=80
http_server_username=
http_server_password=
http_server_home=
http_server_default_page=
http_server_log_file_name=
http_server_logging_enabled=0
http_server_log_max_size=4194304
http_server_log_delta_size=524288
http_server_allow_file_download=1
http_server_items_per_page=32
http_server_show_drive_labels=0
http_server_strings=
http_server_header=
service_pipe_name=
name_column_pos=0
name_column_width=256
path_column_visible=1
path_column_pos=1
path_column_width=256
size_column_visible=1
size_column_pos=2
size_column_width=96
extension_column_visible=0
extension_column_pos=3
extension_column_width=96
type_column_visible=0
type_column_pos=4
type_column_width=96
last_write_time_column_visible=1
last_write_time_column_pos=3
last_write_time_column_width=153
creation_time_column_visible=0
creation_time_column_pos=6
creation_time_column_width=153
date_accessed_column_visible=0
date_accessed_column_pos=7
date_accessed_column_width=153
attribute_column_visible=0
attribute_column_pos=8
attribute_column_width=70
date_recently_changed_column_visible=0
date_recently_changed_column_pos=9
date_recently_changed_column_width=153
run_count_column_visible=0
run_count_column_pos=10
run_count_column_width=96
date_run_column_visible=0
date_run_column_pos=11
date_run_column_width=153
file_list_filename_column_visible=0
file_list_filename_column_pos=12
file_list_filename_column_width=96
translucent_selection_rectangle_background_color=
translucent_selection_rectangle_border_color=
thumbnail_mouseover_border_color=
preview_background_color=
ntfs_volume_guids="\\\\?\\Volume{6afe1915-0a0b-4e59-96bc-666ff914ea4f}","\\\\?\\Volume{71be44cf-e03a-462f-a9c8-b53c16e002a4}"
ntfs_volume_paths="C:","D:"
ntfs_volume_roots="",""
ntfs_volume_includes=1,1
ntfs_volume_load_recent_changes=0,0
ntfs_volume_include_onlys="",""
ntfs_volume_monitors=1,1
refs_volume_guids=
refs_volume_paths=
refs_volume_roots=
refs_volume_includes=
refs_volume_load_recent_changes=
refs_volume_include_onlys=
refs_volume_monitors=
filelists=
filelist_monitor_changes=
folders=
folder_monitor_changes=
folder_buffer_size_list=
folder_rescan_if_full_list=
folder_update_types=
folder_update_days=
folder_update_ats=
folder_update_intervals=
folder_update_interval_types=
exclude_folders=
connect_history_hosts=
connect_history_ports=
connect_history_usernames=
connect_history_link_types=
etp_client_rewrite_patterns=
etp_client_rewrite_substitutions=
file_new_search_window_keys=334
file_open_file_list_keys=335
file_close_file_list_keys=
file_close_keys=343,27
file_export_keys=339
file_copy_full_name_to_clipboard_keys=9539
file_copy_path_to_clipboard_keys=
file_set_run_count_keys=
file_create_shortcut_keys=
file_delete_keys=8238
file_delete_permanently_keys=9262
file_edit_keys=
file_open_keys=8205
file_open_selection_and_close_everything_keys=
file_explore_path_keys=
file_open_new_keys=
file_open_path_keys=8461
file_open_with_keys=
file_open_with_default_verb_keys=
file_play_keys=
file_preview_keys=
file_print_keys=
file_print_to_keys=
file_properties_keys=8717
file_read_extended_information_keys=8517
file_rename_keys=8305
file_run_as_keys=
file_exit_keys=337
file_copy_name_to_clipboard_keys=
file_open_selection_and_do_not_close_everything_keys=
file_open_most_run_keys=
file_open_last_run_keys=
file_custom_verb_1_keys=
file_custom_verb_2_keys=
file_custom_verb_3_keys=
file_custom_verb_4_keys=
file_custom_verb_5_keys=
file_custom_verb_6_keys=
file_custom_verb_7_keys=
file_custom_verb_8_keys=
file_custom_verb_9_keys=
file_custom_verb_10_keys=
file_custom_verb_11_keys=
file_custom_verb_12_keys=
indexes_folders_rescan_all_now_keys=
indexes_force_rebuild_keys=
edit_cut_keys=8536
edit_copy_keys=8515,8493
edit_paste_keys=8534,9261
edit_select_all_keys=8513
edit_invert_selection_keys=
edit_copy_to_folder_keys=
edit_move_to_folder_keys=
edit_advanced_advanced_copy_to_folder_keys=
edit_advanced_advanced_move_to_folder_keys=
view_filters_keys=
view_preview_keys=592
view_status_bar_keys=
view_details_keys=1334
view_medium_thumbnails_keys=1331
view_large_thumbnails_keys=1330
view_extra_large_thumbnails_keys=1329
view_increase_thumbnail_size_keys=1467
view_decrease_thumbnail_size_keys=1469
view_window_size_small_keys=561
view_window_size_medium_keys=562
view_window_size_large_keys=563
view_window_size_auto_fit_keys=564
view_zoom_zoom_in_keys=443
view_zoom_zoom_out_keys=445
view_zoom_reset_keys=304,352
view_go_to_back_keys=549,166
view_go_to_forward_keys=551,167
view_go_to_home_keys=548
view_go_to_show_all_history_keys=1352,328
view_sort_by_name_keys=305
view_sort_by_path_keys=306
view_sort_by_size_keys=307
view_sort_by_extension_keys=308
view_sort_by_type_keys=309
view_sort_by_date_modified_keys=310
view_sort_by_date_created_keys=311
view_sort_by_attributes_keys=312
view_sort_by_file_list_filename_keys=
view_sort_by_run_count_keys=
view_sort_by_date_run_keys=
view_sort_by_date_recently_changed_keys=313
view_sort_by_date_accessed_keys=
view_sort_by_ascending_keys=
view_sort_by_descending_keys=
view_refresh_keys=116
view_fullscreen_keys=122
view_toggle_ltrrtl_direction_keys=
view_on_top_never_keys=
view_on_top_always_keys=
view_on_top_while_searching_keys=
search_match_case_keys=329
search_match_whole_word_keys=322
search_match_path_keys=341
search_match_diacritics_keys=333
search_enable_regex_keys=338
search_advanced_search_keys=
search_add_to_filters_keys=
search_organize_filters_keys=1350
bookmarks_add_to_bookmarks_keys=324
bookmarks_organize_bookmarks_keys=1346
tools_options_keys=336
tools_console_keys=448
tools_file_list_editor_keys=
tools_connect_to_etp_server_keys=
tools_disconnect_from_etp_server_keys=
help_everything_help_keys=112
help_search_syntax_keys=
help_regex_syntax_keys=
help_command_line_options_keys=
help_everything_website_keys=
help_check_for_updates_keys=
help_about_everything_keys=368
help_donate_keys=
search_edit_focus_search_edit_keys=326,114,580
search_edit_delete_previous_word_keys=4360
search_edit_auto_complete_search_keys=4384
search_edit_show_search_history_keys=
search_edit_show_all_search_history_keys=4646,4648
result_list_item_up_keys=8230,4134
result_list_item_down_keys=8232,4136
result_list_page_up_keys=8225,4129
result_list_page_down_keys=8226,4130
result_list_start_of_list_keys=8228
result_list_end_of_list_keys=8227
result_list_item_up_extend_keys=9254,5158
result_list_item_down_extend_keys=9256,5160
result_list_page_up_extend_keys=9249,5153
result_list_page_down_extend_keys=9250,5154
result_list_start_of_list_extend_keys=9252
result_list_end_of_list_extend_keys=9251
result_list_focus_up_keys=8486,4390
result_list_focus_down_keys=8488,4392
result_list_focus_page_up_keys=8481,4385
result_list_focus_page_down_keys=8482,4386
result_list_focus_start_of_list_keys=8484
result_list_focus_end_of_list_keys=8483
result_list_focus_up_extend_keys=9510,5414
result_list_focus_down_extend_keys=9512,5416
result_list_focus_page_up_extend_keys=9505,5409
result_list_focus_page_down_extend_keys=9506,5410
result_list_focus_start_of_list_extend_keys=9508
result_list_focus_end_of_list_extend_keys=9507
result_list_focus_result_list_keys=
result_list_focus_highest_run_count_result_keys=
result_list_focus_last_run_result_keys=
result_list_toggle_path_column_keys=
result_list_toggle_size_column_keys=
result_list_toggle_extension_column_keys=
result_list_toggle_type_column_keys=
result_list_toggle_date_modified_column_keys=
result_list_toggle_date_created_column_keys=
result_list_toggle_attributes_column_keys=
result_list_toggle_file_list_filename_column_keys=
result_list_toggle_run_count_column_keys=
result_list_toggle_date_recently_changed_column_keys=
result_list_toggle_date_accessed_column_keys=
result_list_toggle_date_run_column_keys=
result_list_size_all_columns_to_fit_keys=8555
result_list_size_result_list_to_fit_keys=
result_list_context_menu_keys=9337
result_list_scroll_left_or_thumbnail_left_keys=8229
result_list_scroll_right_or_thumbnail_right_keys=8231
result_list_scroll_page_left_or_thumbnail_focus_left_keys=8485
result_list_scroll_page_right_or_thumbnail_focus_right_keys=8487
result_list_left_extend_keys=9253
result_list_right_extend_keys=9255
result_list_focus_left_extend_keys=9509
result_list_focus_right_extend_keys=9511
result_list_select_focus_keys=8224
result_list_toggle_focus_selection_keys=8480
result_list_copy_as_csv_keys=
preview_focus_preview_keys=
result_list_font=
result_list_font_size=
search_edit_font=
search_edit_font_size=
status_bar_font=
status_bar_font_size=
header_font=
header_font_size=
normal_background_color=
normal_foreground_color=
normal_bold=
highlighted_background_color=
highlighted_foreground_color=
highlighted_bold=
current_sort_background_color=
current_sort_foreground_color=
current_sort_bold=
current_sort_highlighted_background_color=
current_sort_highlighted_foreground_color=
current_sort_highlighted_bold=
selected_background_color=
selected_foreground_color=
selected_bold=
selected_highlighted_background_color=
selected_highlighted_foreground_color=
selected_highlighted_bold=
selected_inactive_background_color=
selected_inactive_foreground_color=
selected_inactive_bold=
selected_inactive_highlighted_background_color=
selected_inactive_highlighted_foreground_color=
selected_inactive_highlighted_bold=
drop_target_background_color=
drop_target_foreground_color=
drop_target_bold=
drop_target_highlighted_background_color=
drop_target_highlighted_foreground_color=
drop_target_highlighted_bold=
mouseover_background_color=
mouseover_foreground_color=
mouseover_bold=
mouseover_highlighted_background_color=
mouseover_highlighted_foreground_color=
mouseover_highlighted_bold=
mouseover_current_sort_background_color=
mouseover_current_sort_foreground_color=
mouseover_current_sort_bold=
mouseover_current_sort_highlighted_background_color=
mouseover_current_sort_highlighted_foreground_color=
mouseover_current_sort_highlighted_bold=
alternate_row_background_color=
alternate_row_foreground_color=
alternate_row_bold=
alternate_row_highlighted_background_color=
alternate_row_highlighted_foreground_color=
alternate_row_highlighted_bold=
current_sort_alternate_row_background_color=
current_sort_alternate_row_foreground_color=
current_sort_alternate_row_bold=
current_sort_alternate_row_highlighted_background_color=
current_sort_alternate_row_highlighted_foreground_color=
current_sort_alternate_row_highlighted_bold=
hot_background_color=
hot_foreground_color=
hot_bold=
hot_highlighted_background_color=
hot_highlighted_foreground_color=
hot_highlighted_bold=
selected_hot_background_color=
selected_hot_foreground_color=
selected_hot_bold=
selected_hot_highlighted_background_color=
selected_hot_highlighted_foreground_color=
selected_hot_highlighted_bold=
selected_inactive_hot_background_color=
selected_inactive_hot_foreground_color=
selected_inactive_hot_bold=
selected_inactive_hot_highlighted_background_color=
selected_inactive_hot_highlighted_foreground_color=
selected_inactive_hot_highlighted_bold=
thumbnail_mouseover_background_color=
thumbnail_mouseover_foreground_color=
thumbnail_mouseover_bold=
thumbnail_mouseover_highlighted_background_color=
thumbnail_mouseover_highlighted_foreground_color=
thumbnail_mouseover_highlighted_bold=

Binary file not shown.

View File

@@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GeekDesk.Plugins.EveryThing.Constant
{
public class EveryThingConst
{
public const int EVERYTHING_OK = 0;
public const int EVERYTHING_ERROR_MEMORY = 1;
public const int EVERYTHING_ERROR_IPC = 2;
public const int EVERYTHING_ERROR_REGISTERCLASSEX = 3;
public const int EVERYTHING_ERROR_CREATEWINDOW = 4;
public const int EVERYTHING_ERROR_CREATETHREAD = 5;
public const int EVERYTHING_ERROR_INVALIDINDEX = 6;
public const int EVERYTHING_ERROR_INVALIDCALL = 7;
public const int EVERYTHING_REQUEST_FILE_NAME = 0x00000001;
public const int EVERYTHING_REQUEST_PATH = 0x00000002;
public const int EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME = 0x00000004;
public const int EVERYTHING_REQUEST_EXTENSION = 0x00000008;
public const int EVERYTHING_REQUEST_SIZE = 0x00000010;
public const int EVERYTHING_REQUEST_DATE_CREATED = 0x00000020;
public const int EVERYTHING_REQUEST_DATE_MODIFIED = 0x00000040;
public const int EVERYTHING_REQUEST_DATE_ACCESSED = 0x00000080;
public const int EVERYTHING_REQUEST_ATTRIBUTES = 0x00000100;
public const int EVERYTHING_REQUEST_FILE_LIST_FILE_NAME = 0x00000200;
public const int EVERYTHING_REQUEST_RUN_COUNT = 0x00000400;
public const int EVERYTHING_REQUEST_DATE_RUN = 0x00000800;
public const int EVERYTHING_REQUEST_DATE_RECENTLY_CHANGED = 0x00001000;
public const int EVERYTHING_REQUEST_HIGHLIGHTED_FILE_NAME = 0x00002000;
public const int EVERYTHING_REQUEST_HIGHLIGHTED_PATH = 0x00004000;
public const int EVERYTHING_REQUEST_HIGHLIGHTED_FULL_PATH_AND_FILE_NAME = 0x00008000;
public const int EVERYTHING_SORT_NAME_ASCENDING = 1;
public const int EVERYTHING_SORT_NAME_DESCENDING = 2;
public const int EVERYTHING_SORT_PATH_ASCENDING = 3;
public const int EVERYTHING_SORT_PATH_DESCENDING = 4;
public const int EVERYTHING_SORT_SIZE_ASCENDING = 5;
public const int EVERYTHING_SORT_SIZE_DESCENDING = 6;
public const int EVERYTHING_SORT_EXTENSION_ASCENDING = 7;
public const int EVERYTHING_SORT_EXTENSION_DESCENDING = 8;
public const int EVERYTHING_SORT_TYPE_NAME_ASCENDING = 9;
public const int EVERYTHING_SORT_TYPE_NAME_DESCENDING = 10;
public const int EVERYTHING_SORT_DATE_CREATED_ASCENDING = 11;
public const int EVERYTHING_SORT_DATE_CREATED_DESCENDING = 12;
public const int EVERYTHING_SORT_DATE_MODIFIED_ASCENDING = 13;
public const int EVERYTHING_SORT_DATE_MODIFIED_DESCENDING = 14;
public const int EVERYTHING_SORT_ATTRIBUTES_ASCENDING = 15;
public const int EVERYTHING_SORT_ATTRIBUTES_DESCENDING = 16;
public const int EVERYTHING_SORT_FILE_LIST_FILENAME_ASCENDING = 17;
public const int EVERYTHING_SORT_FILE_LIST_FILENAME_DESCENDING = 18;
public const int EVERYTHING_SORT_RUN_COUNT_ASCENDING = 19;
public const int EVERYTHING_SORT_RUN_COUNT_DESCENDING = 20;
public const int EVERYTHING_SORT_DATE_RECENTLY_CHANGED_ASCENDING = 21;
public const int EVERYTHING_SORT_DATE_RECENTLY_CHANGED_DESCENDING = 22;
public const int EVERYTHING_SORT_DATE_ACCESSED_ASCENDING = 23;
public const int EVERYTHING_SORT_DATE_ACCESSED_DESCENDING = 24;
public const int EVERYTHING_SORT_DATE_RUN_ASCENDING = 25;
public const int EVERYTHING_SORT_DATE_RUN_DESCENDING = 26;
public const int EVERYTHING_TARGET_MACHINE_X86 = 1;
public const int EVERYTHING_TARGET_MACHINE_X64 = 2;
public const int EVERYTHING_TARGET_MACHINE_ARM = 3;
}
}

View File

@@ -0,0 +1,126 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace GeekDesk.Plugins.EveryThing
{
public class EveryThing32
{
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll", CharSet = CharSet.Unicode)]
public static extern UInt32 Everything_SetSearchW(string lpSearchString);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern void Everything_SetMatchPath(bool bEnable);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern void Everything_SetMatchCase(bool bEnable);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern void Everything_SetMatchWholeWord(bool bEnable);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern void Everything_SetRegex(bool bEnable);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern void Everything_SetMax(UInt32 dwMax);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern void Everything_SetOffset(UInt32 dwOffset);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern bool Everything_GetMatchPath();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern bool Everything_GetMatchCase();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern bool Everything_GetMatchWholeWord();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern bool Everything_GetRegex();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern UInt32 Everything_GetMax();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern UInt32 Everything_GetOffset();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern IntPtr Everything_GetSearchW();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern UInt32 Everything_GetLastError();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern bool Everything_Query(bool bWait);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern void Everything_SortResultsByPath();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern UInt32 Everything_GetNumFileResults();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern UInt32 Everything_GetNumFolderResults();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern UInt32 Everything_GetNumResults();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern UInt32 Everything_GetTotFileResults();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern UInt32 Everything_GetTotFolderResults();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern UInt32 Everything_GetTotResults();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern bool Everything_IsVolumeResult(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern bool Everything_IsFolderResult(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern bool Everything_IsFileResult(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll", CharSet = CharSet.Unicode)]
public static extern void Everything_GetResultFullPathName(UInt32 nIndex, StringBuilder lpString, UInt32 nMaxCount);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern void Everything_Reset();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr Everything_GetResultFileName(UInt32 nIndex);
// Everything 1.4
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern void Everything_SetSort(UInt32 dwSortType);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern UInt32 Everything_GetSort();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern UInt32 Everything_GetResultListSort();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern void Everything_SetRequestFlags(UInt32 dwRequestFlags);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern UInt32 Everything_GetRequestFlags();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern UInt32 Everything_GetResultListRequestFlags();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr Everything_GetResultExtension(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern bool Everything_GetResultSize(UInt32 nIndex, out long lpFileSize);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern bool Everything_GetResultDateCreated(UInt32 nIndex, out long lpFileTime);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern bool Everything_GetResultDateModified(UInt32 nIndex, out long lpFileTime);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern bool Everything_GetResultDateAccessed(UInt32 nIndex, out long lpFileTime);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern UInt32 Everything_GetResultAttributes(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr Everything_GetResultFileListFileName(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern UInt32 Everything_GetResultRunCount(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern bool Everything_GetResultDateRun(UInt32 nIndex, out long lpFileTime);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern bool Everything_GetResultDateRecentlyChanged(UInt32 nIndex, out long lpFileTime);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr Everything_GetResultHighlightedFileName(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr Everything_GetResultHighlightedPath(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr Everything_GetResultHighlightedFullPathAndFileName(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern UInt32 Everything_GetRunCountFromFileName(string lpFileName);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern bool Everything_SetRunCountFromFileName(string lpFileName, UInt32 dwRunCount);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern UInt32 Everything_IncRunCountFromFileName(string lpFileName);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")]
public static extern bool Everything_Exit();
}
}

View File

@@ -0,0 +1,126 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace GeekDesk.Plugins.EveryThing
{
public class EveryThing64
{
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll", CharSet = CharSet.Unicode)]
public static extern UInt32 Everything_SetSearchW(string lpSearchString);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern void Everything_SetMatchPath(bool bEnable);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern void Everything_SetMatchCase(bool bEnable);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern void Everything_SetMatchWholeWord(bool bEnable);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern void Everything_SetRegex(bool bEnable);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern void Everything_SetMax(UInt32 dwMax);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern void Everything_SetOffset(UInt32 dwOffset);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern bool Everything_GetMatchPath();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern bool Everything_GetMatchCase();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern bool Everything_GetMatchWholeWord();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern bool Everything_GetRegex();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern UInt32 Everything_GetMax();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern UInt32 Everything_GetOffset();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern IntPtr Everything_GetSearchW();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern UInt32 Everything_GetLastError();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern bool Everything_Query(bool bWait);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern void Everything_SortResultsByPath();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern UInt32 Everything_GetNumFileResults();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern UInt32 Everything_GetNumFolderResults();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern UInt32 Everything_GetNumResults();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern UInt32 Everything_GetTotFileResults();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern UInt32 Everything_GetTotFolderResults();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern UInt32 Everything_GetTotResults();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern bool Everything_IsVolumeResult(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern bool Everything_IsFolderResult(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern bool Everything_IsFileResult(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll", CharSet = CharSet.Unicode)]
public static extern void Everything_GetResultFullPathName(UInt32 nIndex, StringBuilder lpString, UInt32 nMaxCount);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern void Everything_Reset();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr Everything_GetResultFileName(UInt32 nIndex);
// Everything 1.4
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern void Everything_SetSort(UInt32 dwSortType);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern UInt32 Everything_GetSort();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern UInt32 Everything_GetResultListSort();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern void Everything_SetRequestFlags(UInt32 dwRequestFlags);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern UInt32 Everything_GetRequestFlags();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern UInt32 Everything_GetResultListRequestFlags();
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr Everything_GetResultExtension(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern bool Everything_GetResultSize(UInt32 nIndex, out long lpFileSize);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern bool Everything_GetResultDateCreated(UInt32 nIndex, out long lpFileTime);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern bool Everything_GetResultDateModified(UInt32 nIndex, out long lpFileTime);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern bool Everything_GetResultDateAccessed(UInt32 nIndex, out long lpFileTime);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern UInt32 Everything_GetResultAttributes(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr Everything_GetResultFileListFileName(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern UInt32 Everything_GetResultRunCount(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern bool Everything_GetResultDateRun(UInt32 nIndex, out long lpFileTime);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern bool Everything_GetResultDateRecentlyChanged(UInt32 nIndex, out long lpFileTime);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr Everything_GetResultHighlightedFileName(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr Everything_GetResultHighlightedPath(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr Everything_GetResultHighlightedFullPathAndFileName(UInt32 nIndex);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern UInt32 Everything_GetRunCountFromFileName(string lpFileName);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern bool Everything_SetRunCountFromFileName(string lpFileName, UInt32 dwRunCount);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern UInt32 Everything_IncRunCountFromFileName(string lpFileName);
[DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")]
public static extern bool Everything_Exit();
}
}

View File

@@ -0,0 +1,347 @@
using GeekDesk.Constant;
using GeekDesk.Plugins.EveryThing.Constant;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Configuration.Install;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace GeekDesk.Plugins.EveryThing
{
public class EveryThingUtil
{
//每次加载20条
private static long pageCount = 20;
private static UInt32 ui = 0;
public static void EnableEveryThing(int delayTime = 2000)
{
string pluginsPath = Constants.PLUGINS_PATH;
bool Is64Bit = Environment.Is64BitOperatingSystem;
string everyThingPath = pluginsPath + "/EveryThing/" + (Is64Bit ? 64 : 32) + "/EveryThing.exe";
string installUtilPath = "C:\\Windows\\Microsoft.NET\\Framework"+ (Is64Bit ? "64" : "") + "\\v4.0.30319\\InstallUtil.exe";
new Thread(() =>
{
try
{
Thread.Sleep(delayTime);
//判断EveryThing服务是否存在
ServiceController sc = GetService("Everything");
if (sc != null)
{
//判断是否启动
if (sc.Status != ServiceControllerStatus.StartPending
&& sc.Status != ServiceControllerStatus.Running)
{
//启动服务
EveryThingService(ServiceType.START);
}
} else
{
//安装服务
EveryThingService(ServiceType.INSTALL);
}
Thread.Sleep(2000);
if (GetService("Everything") != null)
{
//启动程序
Process exeProcess = new Process();
exeProcess.StartInfo.FileName = everyThingPath;
exeProcess.Start();
int waitTime = 5000;
while (true && waitTime > 0)
{
Thread.Sleep(100);
waitTime -= 100;
exeProcess.CloseMainWindow();
}
}
} catch (Exception e)
{
}
}).Start();
}
enum ServiceType
{
START,
STOP,
INSTALL,
UNINSTALL
}
private static void EveryThingService(ServiceType type)
{
string pluginsPath = Constants.PLUGINS_PATH;
bool Is64Bit = Environment.Is64BitOperatingSystem;
string everyThingPath = pluginsPath + "/EveryThing/" + (Is64Bit ? 64 : 32) + "/EveryThing.exe";
Process p = new Process();
p.StartInfo.FileName = everyThingPath;
string arg;
switch(type)
{
default:
p.StartInfo.Verb = "runas";
arg = "-start-service";
break;
case ServiceType.STOP:
arg = "-stop-service";
break;
case ServiceType.INSTALL:
p.StartInfo.Verb = "runas";
arg = "-install-service";
break;
case ServiceType.UNINSTALL:
arg = "-uninstall-service";
break;
}
p.StartInfo.Arguments = arg;
p.Start();
}
public static ServiceController GetService(string serviceName)
{
ServiceController[] services = ServiceController.GetServices();
foreach (ServiceController s in services)
{
if (s.ServiceName.ToLower().Equals(serviceName.ToLower()))
{
return s;
}
}
return null;
}
public static void DisableEveryThing(bool uninstall = false)
{
try
{
if (Environment.Is64BitOperatingSystem)
{
EveryThing64.Everything_Exit();
}
else
{
EveryThing32.Everything_Exit();
}
}
catch (Exception e) { }
try
{
if (GetService("Everything") != null)
{
if (uninstall)
{
EveryThingService(ServiceType.UNINSTALL);
}
else
{
EveryThingService(ServiceType.STOP);
}
}
}
catch (Exception e) { }
}
public static bool HasNext()
{
return ui < Everything_GetNumResults();
}
public static ObservableCollection<IconInfo> Search(string text)
{
ui = 0;
//EveryThing全盘搜索
Everything_Reset();
EveryThingUtil.Everything_SetSearchW(text);
EveryThingUtil.Everything_SetRequestFlags(
EveryThingConst.EVERYTHING_REQUEST_FILE_NAME
| EveryThingConst.EVERYTHING_REQUEST_PATH
| EveryThingConst.EVERYTHING_REQUEST_DATE_MODIFIED
| EveryThingConst.EVERYTHING_REQUEST_SIZE);
EveryThingUtil.Everything_SetSort(
EveryThingConst.EVERYTHING_SORT_TYPE_NAME_DESCENDING
| EveryThingConst.EVERYTHING_SORT_RUN_COUNT_DESCENDING
| EveryThingConst.EVERYTHING_SORT_DATE_MODIFIED_DESCENDING
);
EveryThingUtil.Everything_Query(true);
return NextPage();
}
public static ObservableCollection<IconInfo> NextPage()
{
if (ui == 0)
{
pageCount = 40;
} else
{
pageCount = 20;
}
string filePath;
const int bufsize = 260;
StringBuilder buf = new StringBuilder(bufsize);
ObservableCollection<IconInfo> iconBakList = new ObservableCollection<IconInfo>();
for (long count = 0; ui < Everything_GetNumResults() && count < pageCount; count++, ui++)
{
buf.Clear();
EveryThingUtil.Everything_GetResultFullPathName(ui, buf, bufsize);
filePath = buf.ToString();
string tempPath = filePath;
string ext = "";
if (!ImageUtil.IsSystemItem(filePath))
{
ext = System.IO.Path.GetExtension(filePath).ToLower();
}
//if (".lnk".Equals(ext))
//{
// string targetPath = FileUtil.GetTargetPathByLnk(filePath);
// if (targetPath != null)
// {
// filePath = targetPath;
// }
//}
string name = System.IO.Path.GetFileNameWithoutExtension(tempPath);
if (string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(tempPath))
{
name = tempPath.Substring(tempPath.LastIndexOf("\\"));
}
IconInfo iconInfo = new IconInfo
{
Path_NoWrite = filePath,
LnkPath_NoWrite = tempPath,
BitmapImage_NoWrite = ImageUtil.GetBitmapIconByUnknownPath(filePath),
StartArg_NoWrite = FileUtil.GetArgByLnk(tempPath),
Name_NoWrite = name,
};
//缓存信息 异步加载图标
iconBakList.Add(iconInfo);
}
return iconBakList;
}
public static UInt32 Everything_SetSearchW(string lpSearchString)
{
if (Environment.Is64BitOperatingSystem)
{
return EveryThing64.Everything_SetSearchW(lpSearchString);
} else
{
return EveryThing32.Everything_SetSearchW(lpSearchString);
}
}
public static void Everything_SetRequestFlags(UInt32 dwRequestFlags)
{
if (Environment.Is64BitOperatingSystem)
{
EveryThing64.Everything_SetRequestFlags(dwRequestFlags);
}
else
{
EveryThing32.Everything_SetRequestFlags(dwRequestFlags);
}
}
public static void Everything_SetSort(UInt32 dwSortType)
{
if (Environment.Is64BitOperatingSystem)
{
EveryThing64.Everything_SetSort(dwSortType);
}
else
{
EveryThing32.Everything_SetSort(dwSortType);
}
}
public static bool Everything_Query(bool bWait)
{
if (Environment.Is64BitOperatingSystem)
{
return EveryThing64.Everything_Query(bWait);
}
else
{
return EveryThing32.Everything_Query(bWait);
}
}
public static UInt32 Everything_GetNumResults()
{
if (Environment.Is64BitOperatingSystem)
{
return EveryThing64.Everything_GetNumResults();
}
else
{
return EveryThing32.Everything_GetNumResults();
}
}
public static void Everything_GetResultFullPathName(UInt32 nIndex, StringBuilder lpString, UInt32 nMaxCount)
{
if (Environment.Is64BitOperatingSystem)
{
EveryThing64.Everything_GetResultFullPathName(nIndex, lpString, nMaxCount);
}
else
{
EveryThing32.Everything_GetResultFullPathName(nIndex, lpString, nMaxCount);
}
}
public static void Everything_Reset()
{
if (Environment.Is64BitOperatingSystem)
{
EveryThing64.Everything_Reset();
}
else
{
EveryThing32.Everything_Reset();
}
}
}
}

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ShowSeconds.Common
{
public class Constants
{
public readonly static string MY_UUID = "8400A17AEEF7C029";
//dark theam
public readonly static System.Windows.Media.SolidColorBrush darkBG
= new System.Windows.Media.SolidColorBrush
{
Color = System.Windows.Media.Color.FromRgb(46, 50, 54),
Opacity = 0.8
};
public readonly static System.Windows.Media.SolidColorBrush darkFont
= new System.Windows.Media.SolidColorBrush
{
Color = System.Windows.Media.Color.FromRgb(255, 255, 255)
};
//light theam
public readonly static System.Windows.Media.SolidColorBrush lightBG
= new System.Windows.Media.SolidColorBrush
{
Color = System.Windows.Media.Color.FromRgb(236, 244, 251),
Opacity = 1
};
public readonly static System.Windows.Media.SolidColorBrush lightFont
= new System.Windows.Media.SolidColorBrush
{
Color = System.Windows.Media.Color.FromRgb(65, 63, 61),
};
}
}

View File

@@ -0,0 +1,32 @@
<Window x:Class="ShowSeconds.SecondsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
Height="90"
Width="160"
WindowStyle="None"
Title=""
AllowsTransparency="True"
Background="Transparent" ShowInTaskbar="False"
Focusable="True"
Loaded="Window_Loaded"
>
<Grid Margin="20">
<Grid.Effect>
<DropShadowEffect BlurRadius="20" Direction="-90" Color="Gray"
RenderingBias="Quality" ShadowDepth="2"/>
</Grid.Effect>
<Border x:Name="BGBorder" CornerRadius="8" xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndSlideFromRight}, Event=Visibility, Delay=0}">
<TextBlock x:Name="SecondsText" HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="25"
FontWeight="Bold"
Foreground="White"
Text="{Binding Seconds}"/>
</Border>
</Grid>
</Window>

View File

@@ -0,0 +1,332 @@
using GeekDesk.Util;
using Gma.System.MouseKeyHook;
using ShowSeconds.Common;
using GeekDesk.Util;
using ShowSeconds.ViewModel;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
using GeekDesk.MyThread;
using GeekDesk;
using System.Collections;
namespace ShowSeconds
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class SecondsWindow : Window
{
private System.Drawing.Color beforeColor;
private System.Drawing.Color topBeforeColor;
private bool expandClock = true; //是否展开时钟
private System.Windows.Forms.Timer timer;
private static double lProportion = 0.82;
private static double tProportion = 0.03;
private static int sleepTime = 1000;
public SecondsWindow()
{
SecondsDataContext dc = new SecondsDataContext
{
Seconds = (DateTime.Now.Hour).ToString() + ":" +
FormatMS(DateTime.Now.Minute) + ":" +
FormatMS(DateTime.Now.Second)
};
InitializeComponent();
SolidColorBrush scb = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 47, 52, 44))
{
Opacity = 0.8
};
try
{
Hashtable settings = (Hashtable)ConfigurationManager.GetSection("ShowSecondsSettings");
lProportion = Convert.ToDouble(settings["LProportion"]);
tProportion = Convert.ToDouble(settings["TProportion"]);
sleepTime = Convert.ToInt32(settings["DelayTime"]);
}
catch (Exception ex)
{
lProportion = 0.82;
tProportion = 0.03;
sleepTime = 1000;
}
BGBorder.Background = scb;
this.DataContext = dc;
this.Topmost = true;
BGBorder.Visibility = Visibility.Collapsed;
this.Show();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
timer = new System.Windows.Forms.Timer();
timer.Interval = 1000;
timer.Tick += Timer_Tick;
Dispatcher secondsDP = DispatcherBuild.Build();
IKeyboardMouseEvents secondsHook = Hook.GlobalEvents();
secondsDP.Invoke((Action)(() =>
{
secondsHook.MouseDownExt += SecondsBakColorFun;
secondsHook.MouseUpExt += SecondsHookSetFuc;
}));
HideWindowUtil.HideAltTab(this);
}
private void Timer_Tick(object sender, EventArgs e)
{
string str = (DateTime.Now.Hour).ToString() + ":" +
FormatMS(DateTime.Now.Minute) + ":" +
FormatMS(DateTime.Now.Second);
SecondsDataContext dc = this.DataContext as SecondsDataContext;
dc.Seconds = str;
}
private static string FormatMS(int ms)
{
if (ms < 10)
{
return "0" + ms;
}
else
{
return ms.ToString();
}
}
private void SecondsHookSetFuc(object sender, MouseEventExtArgs e)
{
//IntPtr taskBarWnd = WindowUtil.FindWindow("Shell_TrayWnd", null);
//IntPtr tray = WindowUtil.FindWindowEx(taskBarWnd, IntPtr.Zero, "TrayNotifyWnd", null);
////IntPtr trayclock = WindowUtil.FindWindowEx(tray, IntPtr.Zero, "TrayClockWClass", null);
//IntPtr trayclock = WindowUtil.GetForegroundWindow();
//StringBuilder title = new StringBuilder(256);
//WindowUtil.GetWindowText(trayclock, title, title.Capacity);//得到窗口的标题
////Console.WriteLine(title.ToString());
//if (title.Equals("通知中心"))
//{
//}
if (e.Button == System.Windows.Forms.MouseButtons.Left)
{
if (ScreenUtil.IsPrimaryFullScreen()) return;
App.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, new Action(() =>
{
try
{
int x = e.X;
int y = e.Y;
double w = 1920;
double h = 1080;
double width = SystemParameters.PrimaryScreenWidth;
double height = SystemParameters.PrimaryScreenHeight;
if (x > 1843 / w * width
&& x < 1907 / w * width
&& y > 1037 / h * height
&& y < 1074 / h * height)
{
System.Drawing.Color c;
int count = sleepTime;
do
{
c = GetBottomBeforeColor();
if (c.A != beforeColor.A
|| c.R != beforeColor.R
|| c.G != beforeColor.G
|| c.B != beforeColor.B)
{
break;
}
Thread.Sleep(50);
count -= 50;
} while (count > 0);
if (c.A != beforeColor.A
|| c.R != beforeColor.R
|| c.G != beforeColor.G
|| c.B != beforeColor.B)
{
//判断是否展开时钟
System.Drawing.Color ct = GetTopBeforeColor();
if (ct.A != topBeforeColor.A
|| ct.R != topBeforeColor.R
|| ct.G != topBeforeColor.G
|| ct.B != topBeforeColor.B)
{
expandClock = true;
}
else
{
expandClock = false;
}
if (!BGBorder.IsVisible)
{
System.Drawing.Color theamColor = GetColor(1919, 1079);
if (CalculateLight(theamColor) > 255 / 2)
{
//light
BGBorder.Background = new SolidColorBrush(System.Windows.Media.Color.FromArgb(theamColor.A, theamColor.R, theamColor.G, theamColor.B));
SecondsText.Foreground = Constants.lightFont;
}
else
{
// dark
//BGBorder.Background = new SolidColorBrush(System.Windows.Media.Color.FromArgb(theamColor.A, theamColor.R, theamColor.G, theamColor.B));
BGBorder.Background = Constants.darkBG;
SecondsText.Foreground = Constants.darkFont;
}
SecondsDataContext dc = this.DataContext as SecondsDataContext;
dc.Seconds = (DateTime.Now.Hour).ToString() + ":" +
FormatMS(DateTime.Now.Minute) + ":" +
FormatMS(DateTime.Now.Second);
int sx = (int)(SystemParameters.PrimaryScreenWidth * lProportion);
int sMarginBottom = (int)(SystemParameters.WorkArea.Height * tProportion);
Left = sx - Width;
Top = SystemParameters.WorkArea.Height - Height;
BGBorder.Visibility = Visibility.Visible;
timer.Start();
}
else
{
BGBorder.Visibility = Visibility.Collapsed;
timer.Stop();
}
}
}
else if (true)
{
if ((expandClock && (x < 1574 / w * width
|| x > 1906 / w * width
|| y < 598 / h * height
|| y > 1020 / h * height)
)
|| !expandClock && (x < 1574 / w * width
|| x > 1906 / w * width
|| y < 950 / h * height
|| y > 1020 / h * height)
)
{
BGBorder.Visibility = Visibility.Collapsed;
timer.Stop();
}
}
}
catch (Exception e1) { }
}));
}
}
private static System.Windows.Window window = null;
public static void ShowWindow()
{
try
{
if (window == null || !window.Activate())
{
window = new SecondsWindow();
}
} catch (Exception e)
{
LogUtil.WriteErrorLog(e, "打开显秒窗口异常!");
}
}
public static void CloseWindow()
{
try
{
window.Close();
} catch (Exception e)
{
LogUtil.WriteErrorLog(e, "关闭显秒窗口异常!");
}
}
private void SecondsBakColorFun(object sender, MouseEventExtArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Left)
{
beforeColor = GetBottomBeforeColor();
topBeforeColor = GetTopBeforeColor();
}
}
private static System.Drawing.Color GetBottomBeforeColor()
{
return GetColor(1760, 985);
}
private static System.Drawing.Color GetTopBeforeColor()
{
return GetColor(1751, 693);
}
private static System.Drawing.Color GetColor(int w2, int h2)
{
double w = 1920;
double h = 1080;
double width = SystemParameters.PrimaryScreenWidth;
double height = SystemParameters.PrimaryScreenHeight;
System.Drawing.Point p = new System.Drawing.Point((int)(w2 / w * width), (int)(h2 / h * height));
return ScreenUtil.GetColorAt(p);
}
private static int CalculateLight(System.Drawing.Color color)
{
int[] colorArr = new int[] { color.R, color.G, color.B };
int max = 0;
int min = 255;
foreach (int i in colorArr)
{
max = Math.Max(max, i);
min = Math.Min(min, i);
}
int avg = (max + min) / 2;
return avg;
}
}
}

View File

@@ -0,0 +1,25 @@
using System.ComponentModel;
namespace ShowSeconds.ViewModel
{
public class SecondsDataContext : INotifyPropertyChanged
{
private string seconds;
public string Seconds
{
set
{
seconds = value;
OnPropertyChanged("Seconds");
}
get { return seconds; }
}
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}

View File

@@ -49,5 +49,5 @@ using System.Windows;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.4.1.5")]
[assembly: AssemblyFileVersion("2.4.1.5")]
[assembly: AssemblyVersion("2.5.1.5")]
[assembly: AssemblyFileVersion("2.5.1.5")]

63
README-zh.md Normal file
View File

@@ -0,0 +1,63 @@
# GeekDesk 极客桌面
小巧、**美观**的桌面快速启动管理工具, 同时集成了Everything搜索
- [中文介绍](README-zh.md)
- [English-machine translation](README.md)
<img src="https://s4.ax1x.com/2021/12/15/TSrwfU.png" a border="0" width="800px"/>
**免费 / 美观 / 高度定制化** 是从GeekDesk诞生开始就有的需求和方向, 未来也会向着这些方向发展
大家如果有好的建议可以提Issue
另外如果你喜欢 GeekDesk的话, 或许可以为作者购买防脱洗发水
当然, 点个**Star**也是对作者的激励哦~ 😊😊😊
<img src="https://z3.ax1x.com/2021/07/20/WYdfmR.jpg" alt="WYdfmR.jpg" border="0" width="400px"/>
### GitHub
[https://github.com/BookerLiu/GeekDesk](https://github.com/BookerLiu/GeekDesk)
### 码云
[https://gitee.com/BookerLiu/GeekDesk](https://gitee.com/BookerLiu/GeekDesk)
## 集成Everything 快速搜索全盘文件
- 2.5.14及之后版本集成了Everything功能
![](https://s3.bmp.ovh/imgs/2023/04/25/ecfbf59916b9b854.gif)
## 全局热键 一键呼出 鼠标跟随
- 自定义热键 设置并使用自己习惯的快捷键
- 一键呼出 使用鼠标中键呼出
- 鼠标跟随 自动追随鼠标位置
<img src="https://s4.ax1x.com/2021/12/15/TSlg8f.gif" alt="WJt4hQ.gif" border="0" width="800px"/>
## 自定义壁纸
- 随意选择自己喜欢的壁纸
<img src="https://s4.ax1x.com/2021/12/15/TSNx4H.gif" alt="WJt4hQ.gif" border="0" width="800px"/>
## 毛玻璃等界面效果
- 背景图片毛玻璃效果
- 界面透明度
- 界面圆角
<img src="https://s4.ax1x.com/2021/12/15/TSabTO.gif" alt="WGOYSU.gif" border="0" width="800px"/>
## 自定义菜单图标
- 80多个系统图标可供选择
- 另支持在线导入阿里巴巴icon图标
- ~~篇幅原因,公众号内回复 **自定义图标** 可以查看教程~~ 现在软件内已经贴上教程链接啦 也欢迎大家关注我的公众号:blush:
<img src="https://s4.ax1x.com/2021/12/15/TSd1NF.gif" border="0" width="800px"/>
## 定时提醒 永不忘记
- 快捷键快速新建待办事项
<img src="https://s4.ax1x.com/2021/12/15/TSDCvj.gif" alt="WJU6df.gif" border="0" width="800px"/>
## 开发框架
- wpf
- .net 4.7.2
- [HandyControl](https://github.com/HandyOrg/HandyControl)
## Stargazers over time
[![Stargazers over time](https://starchart.cc/BookerLiu/GeekDesk.svg)](https://starchart.cc/BookerLiu/GeekDesk)

View File

@@ -1,77 +1,66 @@
# GeekDesk 极客桌面
小巧、**美观**的桌面快速启动管理工具
———— 大风, 雨夜...
「你来了」
「我来了」
「你究竟想干什么!」
「我想做一款软件, 这个软件要Cool」
「什么软件?」
「从最常用的桌面开始吧」
「哼!现在的软件多入牛毛, 会差你一个吗」
「我不知道, 但是我想做」
「你以为凭你一个人的力量能在这大海里掀起什么波浪吗」
「但只要我想就够了, 这是我的梦想!」
「梦想? 可笑, 这世界哪有什么梦想. 不过是一日三餐, 车子和房!」
「我想...就够了...」
「...」
———— 雨停, 狂风仍在呼啸...
Small, **beautiful** desktop quickstart management tool with integrated Everything search
- [中文介绍](README-zh.md)
- [English-machine translation](README.md)
<img src="https://s4.ax1x.com/2021/12/15/TSrwfU.png" a border="0" width="800px"/>
**免费 / 美观 / 高度定制化** 是从GeekDesk诞生开始就有的需求和方向, 未来也会向着这些方向发展
Free / beautiful / highly customized is the need and direction since the birth of GeekDesk, and will develop in these directions in the future
目前GeekDesk只有一个人在开发所以想法有限, 大家如果有好的建议也可以提Issue
you can raise issues if you have good suggestions
另外如果你喜欢 GeekDesk的话, 或许可以为作者购买防脱洗发水
当然, 点个**Star**也是对作者的激励哦~ 😊😊😊
In addition, if you like GeekDesk, you may be able to buy anti-exfoliation shampoo for the author
Of course, ordering a Star is also an incentive for the author~ 😊😊😊
[**Paypal**](https://www.paypal.com/paypalme/BookerLiu)
### Other:
<img src="https://z3.ax1x.com/2021/07/20/WYdfmR.jpg" alt="WYdfmR.jpg" border="0" width="400px"/>
### GitHub
[https://github.com/Demo-Liu/GeekDesk](https://github.com/Demo-Liu/GeekDesk)
### 码云
[https://gitee.com/demo_liu/GeekDesk](https://gitee.com/demo_liu/GeekDesk)
[https://github.com/BookerLiu/GeekDesk](https://github.com/BookerLiu/GeekDesk)
### Gitee
[https://gitee.com/BookerLiu/GeekDesk](https://gitee.com/BookerLiu/GeekDesk)
<img src="https://z3.ax1x.com/2021/07/20/WYdfmR.jpg" alt="WYdfmR.jpg" border="0" width="400px"/>
## 全局热键 一键呼出 鼠标跟随
- 自定义热键 设置并使用自己习惯的快捷键
- 一键呼出 使用鼠标中键呼出
- 鼠标跟随 自动追随鼠标位置
## Integrate Everything to quickly search the entire disk
- Integrate Everything to quickly search the entire disk
![](https://s3.bmp.ovh/imgs/2023/04/25/ecfbf59916b9b854.gif)
## Global hotkeys / one-click callout / mouse follow
- Customize hotkeys settings and use the shortcuts you are used to
- One-click outbound call Use the middle mouse button to call out
- Mouse Follow Automatically follows the mouse position
<img src="https://s4.ax1x.com/2021/12/15/TSlg8f.gif" alt="WJt4hQ.gif" border="0" width="800px"/>
## 自定义壁纸
- 随意选择自己喜欢的壁纸
## Custom wallpaper
- Feel free to choose your favorite wallpaper
<img src="https://s4.ax1x.com/2021/12/15/TSNx4H.gif" alt="WJt4hQ.gif" border="0" width="800px"/>
## 毛玻璃等界面效果
- 背景图片毛玻璃效果
- 界面透明度
- 界面圆角
## Interface effects such as frosted glass
- Background image frosted glass effect
- Interface transparency
- Interface rounded corners
<img src="https://s4.ax1x.com/2021/12/15/TSabTO.gif" alt="WGOYSU.gif" border="0" width="800px"/>
## 自定义菜单图标
- 80多个系统图标可供选择
- 另支持在线导入阿里巴巴icon图标
- ~~篇幅原因,公众号内回复 **自定义图标** 可以查看教程~~ 现在软件内已经贴上教程链接啦 也欢迎大家关注我的公众号:blush:
## Customize the menu icon
- More than 80 system icons to choose from
- It also supports online import of Alibaba icon icons
- For space reasons, reply in the public account Custom icon You can view the tutorial Now the tutorial link has been pasted in the software Welcome to pay attention to my public account😊
<img src="https://s4.ax1x.com/2021/12/15/TSd1NF.gif" border="0" width="800px"/>
## 定时提醒 永不忘记
- 快捷键快速新建待办事项
## Scheduled reminders Never forget
- Scheduled reminders Never forget
<img src="https://s4.ax1x.com/2021/12/15/TSDCvj.gif" alt="WJU6df.gif" border="0" width="800px"/>
## 开发框架
## Development framework
- wpf
- .net 4.7.2
- [HandyControl](https://github.com/HandyOrg/HandyControl)
## Stargazers over time
[![Stargazers over time](https://starchart.cc/Demo-Liu/GeekDesk.svg)](https://starchart.cc/Demo-Liu/GeekDesk)
[![Stargazers over time](https://starchart.cc/BookerLiu/GeekDesk.svg)](https://starchart.cc/BookerLiu/GeekDesk)

Some files were not shown because too many files have changed in this diff Show More