提交记录修改Core/Models/Config/BehaviorModel.cs+5 −0看文件
修改Core/Models/Config/GeneralModel.cs+5 −0看文件
修改Core/Properties/AssemblyInfo.cs+2 −2看文件
修改Core/Servicers/Instances/Main.cs+5 −5看文件
修改Core/Servicers/Instances/Sleepdiscover.cs+5 −0看文件
修改Core/Servicers/Interfaces/ISleepdiscover.cs+4 −0看文件
修改UI/Properties/AssemblyInfo.cs+2 −2看文件
修改UI/Servicers/MainServicer.cs+5 −2看文件
修改UI/ViewModels/DataPageVM.cs+58 −45看文件
| @@ -11,6 +11,11 @@ namespace Core.Models.Config | ||
| 11 | 11 | /// </summary> |
| 12 | 12 | public class BehaviorModel |
| 13 | 13 | { |
| 14 | 新增: [Config(Name = "睡眠监测", Description = "离开电脑时自动停止统计,重启软件生效。(一般情况不建议关闭)", Group = "偏好")] | |
| 15 | 新增: /// <summary> | |
| 16 | 新增: /// 睡眠监测 | |
| 17 | 新增: /// </summary> | |
| 18 | 新增: public bool IsSleepWatch { get; set; } = true; | |
| 14 | 19 | [Config(IsCanImportExport = true, Name = "忽略应用", Description = "可以通过进程名称或者正则表达式进行匹配。当使用正则表达式时可以匹配程序路径", Group = "忽略应用", Placeholder = "进程名称,不需要输入.exe。支持正则表达式")] |
| 15 | 20 | /// <summary> |
| 16 | 21 | /// 忽略的进程列表 |
| @@ -46,6 +46,11 @@ namespace Core.Models.Config | ||
| 46 | 46 | /// </summary> |
| 47 | 47 | [Config(Options = "概览|统计|详细|分类", Name = "启动页", Description = "设置打开主界面时显示的页面", Group = "基础")] |
| 48 | 48 | public int StartPage { get; set; } = 0; |
| 49 | 新增: [Config(Name = "启动软件时显示主界面", Description = "在开机自启动时此选项无效", Group = "基础")] | |
| 50 | 新增: /// <summary> | |
| 51 | 新增: /// 启动软件时显示主界面 | |
| 52 | 新增: /// </summary> | |
| 53 | 新增: public bool IsStartupShowMainWindow { get; set; } = true; | |
| 49 | 54 | /// <summary> |
| 50 | 55 | /// 概览页最为频繁显示条数 |
| 51 | 56 | /// </summary> |
| @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; | ||
| 32 | 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 |
| 33 | 33 | //通过使用 "*",如下所示: |
| 34 | 34 | // [assembly: AssemblyVersion("1.0.*")] |
| 35 | 删除:[assembly: AssemblyVersion("1.1.0.1")] | |
| 36 | 删除:[assembly: AssemblyFileVersion("1.1.0.1")] | |
| 35 | 新增:[assembly: AssemblyVersion("1.1.0.2")] | |
| 36 | 新增:[assembly: AssemblyFileVersion("1.1.0.2")] | |
| @@ -158,11 +158,6 @@ namespace Core.Servicers.Instances | ||
| 158 | 158 | config = appConfig.GetConfig(); |
| 159 | 159 | UpdateConfigIgnoreProcess(); |
| 160 | 160 | |
| 161 | 删除: | |
| 162 | 删除: | |
| 163 | 删除: // 启动睡眠监测 | |
| 164 | 删除: sleepdiscover.Start(); | |
| 165 | 删除: | |
| 166 | 161 | // 初始化过滤器 |
| 167 | 162 | _webFilter.Init(); |
| 168 | 163 | |
| @@ -180,6 +175,11 @@ namespace Core.Servicers.Instances | ||
| 180 | 175 | { |
| 181 | 176 | _webServer.Start(); |
| 182 | 177 | } |
| 178 | 新增: if (config.Behavior.IsSleepWatch) | |
| 179 | 新增: { | |
| 180 | 新增: // 启动睡眠监测 | |
| 181 | 新增: sleepdiscover.Start(); | |
| 182 | 新增: } | |
| 183 | 183 | } |
| 184 | 184 | public void Stop() |
| 185 | 185 | { |
| @@ -68,6 +68,11 @@ namespace Core.Servicers.Instances | ||
| 68 | 68 | Win32API.SetKeyboardHook(keyboardProc); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 新增: public void Stop() | |
| 72 | 新增: { | |
| 73 | 新增: StopTimer(); | |
| 74 | 新增: } | |
| 75 | 新增: | |
| 71 | 76 | private void StartTimer() |
| 72 | 77 | { |
| 73 | 78 | StopTimer(); |
| @@ -13,6 +13,10 @@ namespace Core.Servicers.Interfaces | ||
| 13 | 13 | /// 启动 |
| 14 | 14 | /// </summary> |
| 15 | 15 | void Start(); |
| 16 | 新增: /// <summary> | |
| 17 | 新增: /// 停止 | |
| 18 | 新增: /// </summary> | |
| 19 | 新增: void Stop(); | |
| 16 | 20 | |
| 17 | 21 | /// <summary> |
| 18 | 22 | /// 休眠状态发生更改 |
| @@ -51,5 +51,5 @@ using System.Windows; | ||
| 51 | 51 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 |
| 52 | 52 | //通过使用 "*",如下所示: |
| 53 | 53 | // [assembly: AssemblyVersion("1.0.*")] |
| 54 | 删除:[assembly: AssemblyVersion("1.5.0.1")] | |
| 55 | 删除:[assembly: AssemblyFileVersion("1.5.0.1")] | |
| 54 | 新增:[assembly: AssemblyVersion("1.5.0.2")] | |
| 55 | 新增:[assembly: AssemblyFileVersion("1.5.0.2")] | |
| @@ -15,6 +15,7 @@ namespace UI.Servicers | ||
| 15 | 15 | private readonly IAppContextMenuServicer appContextMenuServicer; |
| 16 | 16 | private readonly IWebSiteContextMenuServicer _webSiteContext; |
| 17 | 17 | private readonly IStatusBarIconServicer _statusBarIconServicer; |
| 18 | 新增: private readonly IAppConfig _config; | |
| 18 | 19 | private bool isSelfStart = false; |
| 19 | 20 | public MainServicer( |
| 20 | 21 | IMain main, |
| @@ -22,7 +23,8 @@ namespace UI.Servicers | ||
| 22 | 23 | IInputServicer inputServicer, |
| 23 | 24 | IAppContextMenuServicer appContextMenuServicer, |
| 24 | 25 | IWebSiteContextMenuServicer webSiteContext_, |
| 25 | 删除: IStatusBarIconServicer statusBarIconServicer_) | |
| 26 | 新增: IStatusBarIconServicer statusBarIconServicer_, | |
| 27 | 新增: IAppConfig config_) | |
| 26 | 28 | { |
| 27 | 29 | this.main = main; |
| 28 | 30 | this.themeServicer = themeServicer; |
| @@ -30,6 +32,7 @@ namespace UI.Servicers | ||
| 30 | 32 | this.appContextMenuServicer = appContextMenuServicer; |
| 31 | 33 | _webSiteContext = webSiteContext_; |
| 32 | 34 | _statusBarIconServicer = statusBarIconServicer_; |
| 35 | 新增: _config = config_; | |
| 33 | 36 | } |
| 34 | 37 | public void Start(bool isSelfStart) |
| 35 | 38 | { |
| @@ -47,7 +50,7 @@ namespace UI.Servicers | ||
| 47 | 50 | appContextMenuServicer.Init(); |
| 48 | 51 | _webSiteContext.Init(); |
| 49 | 52 | |
| 50 | 删除: if(!isSelfStart) | |
| 53 | 新增: if (!isSelfStart && _config.GetConfig().General.IsStartupShowMainWindow) | |
| 51 | 54 | { |
| 52 | 55 | _statusBarIconServicer.ShowMainWindow(); |
| 53 | 56 | } |
| @@ -204,32 +204,39 @@ namespace UI.ViewModels | ||
| 204 | 204 | private List<ChartsDataModel> MapToChartsData(IEnumerable<Core.Models.DailyLogModel> list) |
| 205 | 205 | { |
| 206 | 206 | var resData = new List<ChartsDataModel>(); |
| 207 | 删除: var config = appConfig.GetConfig(); | |
| 208 | 删除: | |
| 209 | 删除: foreach (var item in list) | |
| 207 | 新增: try | |
| 210 | 208 | { |
| 211 | 删除: var bindModel = new ChartsDataModel(); | |
| 212 | 删除: bindModel.Data = item; | |
| 213 | 删除: bindModel.Name = string.IsNullOrEmpty(item.AppModel?.Description) ? item.AppModel.Name : item.AppModel.Description; | |
| 214 | 删除: bindModel.Value = item.Time; | |
| 215 | 删除: bindModel.Tag = Time.ToString(item.Time); | |
| 216 | 删除: bindModel.PopupText = item.AppModel?.File; | |
| 217 | 删除: bindModel.Icon = item.AppModel?.IconFile; | |
| 218 | 删除: bindModel.BadgeList = new List<ChartBadgeModel>(); | |
| 219 | 删除: if (item.AppModel.Category != null) | |
| 209 | 新增: var config = appConfig.GetConfig(); | |
| 210 | 新增: | |
| 211 | 新增: foreach (var item in list) | |
| 220 | 212 | { |
| 221 | 删除: bindModel.BadgeList.Add(new ChartBadgeModel() | |
| 213 | 新增: var bindModel = new ChartsDataModel(); | |
| 214 | 新增: bindModel.Data = item; | |
| 215 | 新增: bindModel.Name = string.IsNullOrEmpty(item.AppModel?.Description) ? item.AppModel.Name : item.AppModel.Description; | |
| 216 | 新增: bindModel.Value = item.Time; | |
| 217 | 新增: bindModel.Tag = Time.ToString(item.Time); | |
| 218 | 新增: bindModel.PopupText = item.AppModel?.File; | |
| 219 | 新增: bindModel.Icon = item.AppModel?.IconFile; | |
| 220 | 新增: bindModel.BadgeList = new List<ChartBadgeModel>(); | |
| 221 | 新增: if (item.AppModel.Category != null) | |
| 222 | 222 | { |
| 223 | 删除: Name = item.AppModel.Category.Name, | |
| 224 | 删除: Color = item.AppModel.Category.Color, | |
| 225 | 删除: Type = ChartBadgeType.Category | |
| 226 | 删除: }); | |
| 227 | 删除: } | |
| 228 | 删除: if (config.Behavior.IgnoreProcessList.Contains(item.AppModel.Name)) | |
| 229 | 删除: { | |
| 230 | 删除: bindModel.BadgeList.Add(ChartBadgeModel.IgnoreBadge); | |
| 223 | 新增: bindModel.BadgeList.Add(new ChartBadgeModel() | |
| 224 | 新增: { | |
| 225 | 新增: Name = item.AppModel.Category.Name, | |
| 226 | 新增: Color = item.AppModel.Category.Color, | |
| 227 | 新增: Type = ChartBadgeType.Category | |
| 228 | 新增: }); | |
| 229 | 新增: } | |
| 230 | 新增: if (config.Behavior.IgnoreProcessList.Contains(item.AppModel.Name)) | |
| 231 | 新增: { | |
| 232 | 新增: bindModel.BadgeList.Add(ChartBadgeModel.IgnoreBadge); | |
| 233 | 新增: } | |
| 234 | 新增: resData.Add(bindModel); | |
| 231 | 235 | } |
| 232 | 删除: resData.Add(bindModel); | |
| 236 | 新增: } | |
| 237 | 新增: catch (Exception e) | |
| 238 | 新增: { | |
| 239 | 新增: Logger.Error(e.ToString()); | |
| 233 | 240 | } |
| 234 | 241 | |
| 235 | 242 | return resData; |
| @@ -238,34 +245,40 @@ namespace UI.ViewModels | ||
| 238 | 245 | private List<ChartsDataModel> MapToChartsWebData(IEnumerable<Core.Models.Db.WebSiteModel> list) |
| 239 | 246 | { |
| 240 | 247 | var resData = new List<ChartsDataModel>(); |
| 241 | 删除: var config = appConfig.GetConfig(); | |
| 242 | 删除: | |
| 243 | 删除: foreach (var item in list) | |
| 248 | 新增: try | |
| 244 | 249 | { |
| 245 | 删除: var bindModel = new ChartsDataModel(); | |
| 246 | 删除: bindModel.Data = item; | |
| 247 | 删除: bindModel.Name = item.Title; | |
| 248 | 删除: bindModel.Value = item.Duration; | |
| 249 | 删除: bindModel.Tag = Time.ToString(item.Duration); | |
| 250 | 删除: bindModel.PopupText = item.Domain; | |
| 251 | 删除: bindModel.Icon = item.IconFile; | |
| 252 | 删除: bindModel.BadgeList = new List<ChartBadgeModel>(); | |
| 253 | 删除: if (item.Category != null) | |
| 250 | 新增: var config = appConfig.GetConfig(); | |
| 251 | 新增: | |
| 252 | 新增: foreach (var item in list) | |
| 254 | 253 | { |
| 255 | 删除: bindModel.BadgeList.Add(new ChartBadgeModel() | |
| 254 | 新增: var bindModel = new ChartsDataModel(); | |
| 255 | 新增: bindModel.Data = item; | |
| 256 | 新增: bindModel.Name = item.Title; | |
| 257 | 新增: bindModel.Value = item.Duration; | |
| 258 | 新增: bindModel.Tag = Time.ToString(item.Duration); | |
| 259 | 新增: bindModel.PopupText = item.Domain; | |
| 260 | 新增: bindModel.Icon = item.IconFile; | |
| 261 | 新增: bindModel.BadgeList = new List<ChartBadgeModel>(); | |
| 262 | 新增: if (item.Category != null) | |
| 256 | 263 | { |
| 257 | 删除: Name = item.Category.Name, | |
| 258 | 删除: Color = item.Category.Color, | |
| 259 | 删除: Type = ChartBadgeType.Category | |
| 260 | 删除: }); | |
| 261 | 删除: } | |
| 262 | 删除: if (config.Behavior.IgnoreURLList.Contains(item.Domain)) | |
| 263 | 删除: { | |
| 264 | 删除: bindModel.BadgeList.Add(ChartBadgeModel.IgnoreBadge); | |
| 264 | 新增: bindModel.BadgeList.Add(new ChartBadgeModel() | |
| 265 | 新增: { | |
| 266 | 新增: Name = item.Category.Name, | |
| 267 | 新增: Color = item.Category.Color, | |
| 268 | 新增: Type = ChartBadgeType.Category | |
| 269 | 新增: }); | |
| 270 | 新增: } | |
| 271 | 新增: if (config.Behavior.IgnoreURLList.Contains(item.Domain)) | |
| 272 | 新增: { | |
| 273 | 新增: bindModel.BadgeList.Add(ChartBadgeModel.IgnoreBadge); | |
| 274 | 新增: } | |
| 275 | 新增: resData.Add(bindModel); | |
| 265 | 276 | } |
| 266 | 删除: resData.Add(bindModel); | |
| 267 | 277 | } |
| 268 | 删除: | |
| 278 | 新增: catch (Exception e) | |
| 279 | 新增: { | |
| 280 | 新增: Logger.Error(e.ToString()); | |
| 281 | 新增: } | |
| 269 | 282 | return resData; |
| 270 | 283 | } |
| 271 | 284 | #endregion |

