跳到主要内容

github/tai

公开

Tai · Windows 软件与网站使用时长统计。上游 Planshit/Tai 的源码镜像,非灵栈原创;MIT 许可。来源:https://github.com/Planshit/Tai 。本次为手动同步,暂不提供安装包。

浏览文件

ChartPageModel.cs

250 行 · 10.6 KB历史下载
1using System;
2using System.Collections.Generic;
3using System.Collections.ObjectModel;
4using System.Linq;
5using System.Text;
6using System.Threading.Tasks;
7using System.Windows.Controls;
8using UI.Controls.Charts.Model;
9using UI.Controls.Select;
10
11namespace UI.Models
12{
13 public class ChartPageModel : ModelBase
14 {
15 private List<ChartsDataModel> Data_;
16
17 public List<ChartsDataModel> Data
18 {
19 get
20 {
21 return Data_;
22 }
23 set
24 {
25 Data_ = value;
26 OnPropertyChanged();
27 }
28 }
29
30 private ObservableCollection<string> TabbarData_;
31 /// <summary>
32 /// tabbar data
33 /// </summary>
34 public ObservableCollection<string> TabbarData
35 {
36 get { return TabbarData_; }
37 set { TabbarData_ = value; OnPropertyChanged(); }
38 }
39
40 private int TabbarSelectedIndex_;
41 /// <summary>
42 /// tabbar selected item index
43 /// </summary>
44 public int TabbarSelectedIndex
45 {
46 get { return TabbarSelectedIndex_; }
47 set
48 {
49 TabbarSelectedIndex_ = value;
50 OnPropertyChanged();
51 }
52 }
53 private string WeekDateStr_;
54 public string WeekDateStr { get { return WeekDateStr_; } set { WeekDateStr_ = value; OnPropertyChanged(); } }
55 private DateTime Date_;
56 public DateTime Date { get { return Date_; } set { Date_ = value; OnPropertyChanged(); } }
57
58 private List<SelectItemModel> WeekOptions_;
59
60 public List<SelectItemModel> WeekOptions { get { return WeekOptions_; } set { WeekOptions_ = value; OnPropertyChanged(); } }
61
62 private SelectItemModel SelectedWeek_;
63
64 public SelectItemModel SelectedWeek { get { return SelectedWeek_; } set { SelectedWeek_ = value; OnPropertyChanged(); } }
65
66 private DateTime MonthDate_;
67 public DateTime MonthDate { get { return MonthDate_; } set { MonthDate_ = value; OnPropertyChanged(); } }
68
69 private DateTime YearDate_;
70 public DateTime YearDate { get { return YearDate_; } set { YearDate_ = value; OnPropertyChanged(); } }
71
72 private int NameIndexStart_ = 0;
73 public int NameIndexStart { get { return NameIndexStart_; } set { NameIndexStart_ = value; OnPropertyChanged(); } }
74
75 private List<ChartsDataModel> TopData_;
76 public List<ChartsDataModel> TopData
77 {
78 get { return TopData_; }
79 set { TopData_ = value; OnPropertyChanged(); }
80 }
81
82 private double DataMaximum_ = 0;
83 public double DataMaximum { get { return DataMaximum_; } set { DataMaximum_ = value; OnPropertyChanged(); } }
84
85 private ContextMenu AppContextMenu_;
86 public ContextMenu AppContextMenu { get { return AppContextMenu_; } set { AppContextMenu_ = value; OnPropertyChanged(); } }
87
88 private string TotalHours_;
89 public string TotalHours { get { return TotalHours_; } set { TotalHours_ = value; OnPropertyChanged(); } }
90
91 private string TopHours_;
92 public string TopHours { get { return TopHours_; } set { TopHours_ = value; OnPropertyChanged(); } }
93 private string AppCount_;
94 public string AppCount { get { return AppCount_; } set { AppCount_ = value; OnPropertyChanged(); } }
95
96 private int ColumnSelectedIndex_ = -1;
97 /// <summary>
98 /// 柱状图选中列索引
99 /// </summary>
100 public int ColumnSelectedIndex { get { return ColumnSelectedIndex_; } set { ColumnSelectedIndex_ = value; OnPropertyChanged(); } }
101 private List<ChartsDataModel> DayHoursData_;
102 /// <summary>
103 /// 指定时段app数据
104 /// </summary>
105 public List<ChartsDataModel> DayHoursData
106 {
107 get { return DayHoursData_; }
108 set { DayHoursData_ = value; OnPropertyChanged(); }
109 }
110 private string DayHoursSelectedTime_;
111 /// <summary>
112 /// 选中时段
113 /// </summary>
114 public string DayHoursSelectedTime { get { return DayHoursSelectedTime_; } set { DayHoursSelectedTime_ = value; OnPropertyChanged(); } }
115 private bool IsCanColumnSelect_ = true;
116 /// <summary>
117 /// 是否允许选择
118 /// </summary>
119 public bool IsCanColumnSelect { get { return IsCanColumnSelect_; } set { IsCanColumnSelect_ = value; OnPropertyChanged(); } }
120
121 private SelectItemModel ChartDataMode_;
122 /// <summary>
123 /// 图表数据模式(1=分类/2=汇总)
124 /// </summary>
125 public SelectItemModel ChartDataMode { get { return ChartDataMode_; } set { ChartDataMode_ = value; OnPropertyChanged(); } }
126
127 private List<ChartsDataModel> RadarData_;
128 /// <summary>
129 /// 雷达图数据
130 /// </summary>
131 public List<ChartsDataModel> RadarData { get { return RadarData_; } set { RadarData_ = value; OnPropertyChanged(); } }
132 private bool IsChartStack_ = true;
133 /// <summary>
134 /// 是否以堆叠形式展示
135 /// </summary>
136 public bool IsChartStack { get { return IsChartStack_; } set { IsChartStack_ = value; OnPropertyChanged(); } }
137
138 private Core.Models.AppModel Top1App_;
139 /// <summary>
140 /// 使用时间最长的应用
141 /// </summary>
142 public Core.Models.AppModel Top1App { get { return Top1App_; } set { Top1App_ = value; OnPropertyChanged(); } }
143
144 private string DiffTotalTimeType_;
145 /// <summary>
146 /// 时长对比上一周期变化(0无变化,1增加,-1减少)
147 /// </summary>
148 public string DiffTotalTimeType { get { return DiffTotalTimeType_; } set { DiffTotalTimeType_ = value; OnPropertyChanged(); } }
149 private string DiffAppCountType_;
150 /// <summary>
151 /// 应用量对比上一周期变化(0无变化,1增加,-1减少)
152 /// </summary>
153 public string DiffAppCountType { get { return DiffAppCountType_; } set { DiffAppCountType_ = value; OnPropertyChanged(); } }
154 private string DiffTotalTimeValue_;
155 /// <summary>
156 /// 时长差异值
157 /// </summary>
158 public string DiffTotalTimeValue { get { return DiffTotalTimeValue_; } set { DiffTotalTimeValue_ = value; OnPropertyChanged(); } }
159 private string DiffAppCountValue_;
160 /// <summary>
161 /// 应用量差异值
162 /// </summary>
163 public string DiffAppCountValue { get { return DiffAppCountValue_; } set { DiffAppCountValue_ = value; OnPropertyChanged(); } }
164
165 //private SelectItemModel ShowType_;
166 /// <summary>
167 /// 展示数据类型(0=应用/1=网页)
168 /// </summary>
169 //public SelectItemModel ShowType { get { return ShowType_; } set { ShowType_ = value; OnPropertyChanged(); } }
170
171 private List<ChartsDataModel> WebCategoriesPieData_;
172 /// <summary>
173 /// 网页分类统计饼图数据
174 /// </summary>
175 public List<ChartsDataModel> WebCategoriesPieData { get { return WebCategoriesPieData_; } set { WebCategoriesPieData_ = value; OnPropertyChanged(); } }
176
177 private List<ChartsDataModel> WebBrowseStatisticsData_;
178 /// <summary>
179 /// 网页浏览时长统计数据(柱状图)
180 /// </summary>
181 public List<ChartsDataModel> WebBrowseStatisticsData { get { return WebBrowseStatisticsData_; } set { WebBrowseStatisticsData_ = value; OnPropertyChanged(); } }
182
183 #region 网页数据
184 private string WebTotalTimeText_;
185 /// <summary>
186 /// 网页浏览总时长
187 /// </summary>
188 public string WebTotalTimeText { get { return WebTotalTimeText_; } set { WebTotalTimeText_ = value; OnPropertyChanged(); } }
189 private double WebTotalTime_;
190 /// <summary>
191 /// 网页浏览总时长
192 /// </summary>
193 public double WebTotalTime { get { return WebTotalTime_; } set { WebTotalTime_ = value; OnPropertyChanged(); } }
194 private double WebSiteCount_;
195 /// <summary>
196 /// 站点浏览数量
197 /// </summary>
198 public double WebSiteCount { get { return WebSiteCount_; } set { WebSiteCount_ = value; OnPropertyChanged(); } }
199 private double WebPageCount_;
200 /// <summary>
201 /// 网页浏览数量
202 /// </summary>
203 public double WebPageCount { get { return WebPageCount_; } set { WebPageCount_ = value; OnPropertyChanged(); } }
204
205 private double LastWebTotalTime_;
206 /// <summary>
207 /// 上一个周期网页浏览总时长
208 /// </summary>
209 public double LastWebTotalTime { get { return LastWebTotalTime_; } set { LastWebTotalTime_ = value; OnPropertyChanged(); } }
210 private double LastWebSiteCount_;
211 /// <summary>
212 /// 上一个周期站点浏览数量
213 /// </summary>
214 public double LastWebSiteCount { get { return LastWebSiteCount_; } set { LastWebSiteCount_ = value; OnPropertyChanged(); } }
215 private double LastWebPageCount_;
216 /// <summary>
217 /// 上一个周期网页浏览数量
218 /// </summary>
219 public double LastWebPageCount { get { return LastWebPageCount_; } set { LastWebPageCount_ = value; OnPropertyChanged(); } }
220
221 private List<ChartsDataModel> WebSitesTopData_;
222 /// <summary>
223 /// 网页站点最为频繁
224 /// </summary>
225 public List<ChartsDataModel> WebSitesTopData { get { return WebSitesTopData_; } set { WebSitesTopData_ = value; OnPropertyChanged(); } }
226 private int WebColSelectedIndex_ = -1;
227 /// <summary>
228 /// 网页浏览数据柱状图选中列索引
229 /// </summary>
230 public int WebColSelectedIndex { get { return WebColSelectedIndex_; } set { WebColSelectedIndex_ = value; OnPropertyChanged(); } }
231
232 private List<ChartsDataModel> WebSitesColSelectedData_;
233 /// <summary>
234 /// 网页浏览数据柱状图选中列数据
235 /// </summary>
236 public List<ChartsDataModel> WebSitesColSelectedData { get { return WebSitesColSelectedData_; } set { WebSitesColSelectedData_ = value; OnPropertyChanged(); } }
237
238 private string WebSitesColSelectedTimeText_;
239 /// <summary>
240 /// 网页浏览数据柱状图选择列时间
241 /// </summary>
242 public string WebSitesColSelectedTimeText { get { return WebSitesColSelectedTimeText_; } set { WebSitesColSelectedTimeText_ = value; OnPropertyChanged(); } }
243 private ContextMenu WebSiteContextMenu_;
244 /// <summary>
245 /// 网站右键菜单
246 /// </summary>
247 public ContextMenu WebSiteContextMenu { get { return WebSiteContextMenu_; } set { WebSiteContextMenu_ = value; OnPropertyChanged(); } }
248 #endregion
249 }
250}