|
@@ -1,97 +1,950 @@
|
1
|
|
-using System;
|
2
|
|
-using System.Collections.Generic;
|
3
|
|
-using System.Linq;
|
4
|
|
-using System.Text;
|
5
|
|
-using System.Threading.Tasks;
|
|
1
|
+using Common.system;
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+using System;
|
|
5
|
+using System.Collections.ObjectModel;
|
|
6
|
+using System.ComponentModel;
|
|
7
|
+using System.Data;
|
|
8
|
+using System.Diagnostics;
|
|
9
|
+using System.IO;
|
|
10
|
+using System.Threading;
|
6
|
11
|
using System.Windows;
|
7
|
12
|
using System.Windows.Controls;
|
8
|
|
-using System.Windows.Data;
|
9
|
|
-using System.Windows.Documents;
|
10
|
13
|
using System.Windows.Input;
|
11
|
14
|
using System.Windows.Media;
|
12
|
|
-using System.Windows.Media.Imaging;
|
13
|
|
-using System.Windows.Shapes;
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+using XHZB.Desktop.Utils;
|
|
18
|
+using XHZB.Model;
|
|
19
|
+
|
14
|
20
|
|
15
|
21
|
namespace XHZB.Desktop
|
16
|
22
|
{
|
17
|
23
|
/// <summary>
|
18
|
|
- /// UserCenterWindow.xaml 的交互逻辑
|
|
24
|
+ /// 个人空间 LessonPreparationWindow.xaml 的交互逻辑
|
19
|
25
|
/// </summary>
|
20
|
|
- public partial class UserCenterWindow : Window
|
|
26
|
+ public partial class UserCenterWindow : Window, DownloadUtil.DownloadCallback
|
21
|
27
|
{
|
|
28
|
+ private int serverReturnCode = 0;
|
|
29
|
+ private readonly RegisterController registerController = new RegisterController();
|
|
30
|
+ internal UserCenterPageData pageData = new UserCenterPageData();
|
|
31
|
+ private bool isInitial = false;
|
|
32
|
+ private Thread thread;
|
|
33
|
+ private bool initialization = true;
|
|
34
|
+ /// <summary>
|
|
35
|
+ /// 下拉框数据源
|
|
36
|
+ /// </summary>
|
|
37
|
+ public DataTable data = new DataTable();
|
|
38
|
+ /// <summary>
|
|
39
|
+ /// 是否是下载状态 默认false 不是
|
|
40
|
+ /// </summary>
|
|
41
|
+ private bool isDownloadStatus = false;
|
|
42
|
+ /// <summary>
|
|
43
|
+ /// 教材关系表id
|
|
44
|
+ /// </summary>
|
|
45
|
+ private int Lsbid = 0;
|
|
46
|
+ /// <summary>
|
|
47
|
+ /// 章节id
|
|
48
|
+ /// </summary>
|
|
49
|
+ private int Directorid = 0;
|
|
50
|
+ /// <summary>
|
|
51
|
+ /// 资源分类1音频2视频3图片4文档
|
|
52
|
+ /// </summary>
|
|
53
|
+ private int Resourceclass = 0;
|
|
54
|
+ /// <summary>
|
|
55
|
+ /// 个人空间
|
|
56
|
+ /// </summary>
|
22
|
57
|
public UserCenterWindow()
|
23
|
58
|
{
|
24
|
59
|
InitializeComponent();
|
|
60
|
+ DataContext = pageData;
|
|
61
|
+ //初始化配置文件
|
|
62
|
+ //ZJConfigUtil.init();
|
|
63
|
+ isInitial = true;
|
|
64
|
+ Resourceclass = 0;
|
|
65
|
+ Lsbid = APP.REQStartClass.lsbid;
|
|
66
|
+ Directorid = APP.REQStartClass.directorid;
|
|
67
|
+ borAll.Background = new SolidColorBrush(Colors.DodgerBlue);
|
|
68
|
+ borAudio.Background = new SolidColorBrush(Colors.Transparent);
|
|
69
|
+ borVideo.Background = new SolidColorBrush(Colors.Transparent);
|
|
70
|
+ borImage.Background = new SolidColorBrush(Colors.Transparent);
|
|
71
|
+ borDoc.Background = new SolidColorBrush(Colors.Transparent);
|
|
72
|
+ btnAll.Foreground = new SolidColorBrush(Colors.White);
|
|
73
|
+ btnAudio.Foreground = new SolidColorBrush(Colors.Black);
|
|
74
|
+ btnVideo.Foreground = new SolidColorBrush(Colors.Black);
|
|
75
|
+ btnImage.Foreground = new SolidColorBrush(Colors.Black);
|
|
76
|
+ btnDoc.Foreground = new SolidColorBrush(Colors.Black);
|
|
77
|
+ initJiaocai();
|
25
|
78
|
}
|
26
|
79
|
|
27
|
|
- private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
|
80
|
+ private void initJiaocai()
|
28
|
81
|
{
|
|
82
|
+ System.Collections.Generic.List<TsubjectbookListModel> list = APP.TsubjectbookList;
|
|
83
|
+ int selectIndex = 0;
|
|
84
|
+ for (int i = 0; i < list.Count; i++)
|
|
85
|
+ {
|
|
86
|
+ TsubjectbookListModel book = list[i];
|
|
87
|
+ if (book.lsbid == APP.lsbid)
|
|
88
|
+ {
|
|
89
|
+ selectIndex = i;
|
|
90
|
+ }
|
|
91
|
+ pageData.bookList.Add(new ComboBoxBeanModel()
|
|
92
|
+ {
|
|
93
|
+ Key = book.lsbid,
|
|
94
|
+ Value = $"{book.subjectname} {book.bookname}"
|
|
95
|
+ });
|
|
96
|
+ }
|
|
97
|
+ cmbClass.SelectedIndex = selectIndex;
|
|
98
|
+ }
|
|
99
|
+ /// <summary>
|
|
100
|
+ /// 章节列表服务-调用
|
|
101
|
+ /// </summary>
|
|
102
|
+ /// <returns></returns>
|
|
103
|
+ private object InvokeDirectorListServering()
|
|
104
|
+ {
|
|
105
|
+ APP.DirectorList = null;
|
|
106
|
+ serverReturnCode = registerController.DirectorList(Lsbid,2,APP.LoginUser.userid);
|
|
107
|
+ return APP.ErrorMessage;
|
|
108
|
+ }
|
29
|
109
|
|
|
110
|
+ /// <summary>
|
|
111
|
+ /// 章节列表服务-返回结果
|
|
112
|
+ /// </summary>
|
|
113
|
+ /// <returns></returns>
|
|
114
|
+ public void InvokeServerDirectorListCompate(object obj)
|
|
115
|
+ {
|
|
116
|
+ if (serverReturnCode == APP.ServerScuessCode)
|
|
117
|
+ {
|
|
118
|
+ if (!isInitial)
|
|
119
|
+ {
|
|
120
|
+ Directorid = 0;
|
|
121
|
+ isInitial = false;
|
|
122
|
+ }
|
|
123
|
+ pageData.zhangjieList.Clear();
|
|
124
|
+
|
|
125
|
+ pageData.zhangjieList.Add(new ChapterModel()
|
|
126
|
+ {
|
|
127
|
+ directorid = 0,
|
|
128
|
+ directorname = "全部",
|
|
129
|
+ level = 1,
|
|
130
|
+ selected = 0
|
|
131
|
+ });
|
|
132
|
+ System.Collections.Generic.List<DirectorListModel> list = APP.DirectorList;
|
|
133
|
+
|
|
134
|
+ for (int i = 0; i < list.Count; i++)
|
|
135
|
+ {
|
|
136
|
+ DirectorListModel item = APP.DirectorList[i];
|
|
137
|
+
|
|
138
|
+ pageData.zhangjieList.Add(new ChapterModel()
|
|
139
|
+ {
|
|
140
|
+ directorid = item.directorid,
|
|
141
|
+ directorname = item.directorname,
|
|
142
|
+ level = item.directorlevel,
|
|
143
|
+ selected = 0
|
|
144
|
+ });
|
|
145
|
+ addChild(item);
|
|
146
|
+ }
|
|
147
|
+ foreach (ChapterModel zhangjie in pageData.zhangjieList)
|
|
148
|
+ {
|
|
149
|
+ if (Directorid == zhangjie.directorid)
|
|
150
|
+ {
|
|
151
|
+ zhangjie.selected = 1;
|
|
152
|
+ }
|
|
153
|
+ else
|
|
154
|
+ {
|
|
155
|
+ zhangjie.selected = 0;
|
|
156
|
+ }
|
|
157
|
+ }
|
|
158
|
+ APP.BackgroundWorkerHelper.RunWorkerAsync(InvokeResourceMyListServering, InvokeServerResourceMyListCompate);
|
|
159
|
+ }
|
|
160
|
+ else
|
|
161
|
+ {
|
|
162
|
+ MessageWindow.Show(APP.ErrorMessage);
|
|
163
|
+ }
|
30
|
164
|
}
|
31
|
165
|
|
|
166
|
+ private void addChild(DirectorListModel directorList)
|
|
167
|
+ {
|
|
168
|
+ if (directorList.children != null && directorList.children.Count > 0)
|
|
169
|
+ {
|
|
170
|
+ foreach (DirectorListModel child in directorList.children)
|
|
171
|
+ {
|
|
172
|
+ pageData.zhangjieList.Add(new ChapterModel()
|
|
173
|
+ {
|
|
174
|
+ directorid = child.directorid,
|
|
175
|
+ directorname = getSpace(child.directorlevel) + child.directorname
|
|
176
|
+ });
|
|
177
|
+ if (child.children != null && child.children.Count > 0)
|
|
178
|
+ {
|
|
179
|
+ addChild(child);
|
|
180
|
+ }
|
|
181
|
+ }
|
|
182
|
+ }
|
|
183
|
+ }
|
|
184
|
+
|
|
185
|
+ private string getSpace(int num)
|
|
186
|
+ {
|
|
187
|
+ string str = "";
|
|
188
|
+ for (int i = 0; i < num; i++)
|
|
189
|
+ {
|
|
190
|
+ str += " ";
|
|
191
|
+ }
|
|
192
|
+ return str;
|
|
193
|
+ }
|
|
194
|
+
|
|
195
|
+ private void zhangjieClick(object sender, RoutedEventArgs e)
|
|
196
|
+ {
|
|
197
|
+ ChapterModel item = ((Button)sender).Tag as ChapterModel;
|
|
198
|
+ foreach (ChapterModel zhangjie in pageData.zhangjieList)
|
|
199
|
+ {
|
|
200
|
+ if (item.directorid == zhangjie.directorid)
|
|
201
|
+ {
|
|
202
|
+ zhangjie.selected = 1;
|
|
203
|
+ }
|
|
204
|
+ else
|
|
205
|
+ {
|
|
206
|
+ zhangjie.selected = 0;
|
|
207
|
+ }
|
|
208
|
+ }
|
|
209
|
+
|
|
210
|
+ Directorid = item.directorid;
|
|
211
|
+ APP.BackgroundWorkerHelper.RunWorkerAsync(InvokeResourceMyListServering, InvokeServerResourceMyListCompate);
|
|
212
|
+ }
|
|
213
|
+ /// <summary>
|
|
214
|
+ /// 我的备课列表服务-调用
|
|
215
|
+ /// </summary>
|
|
216
|
+ /// <returns></returns>
|
|
217
|
+ private object InvokeResourceMyListServering()
|
|
218
|
+ {
|
|
219
|
+ Dispatcher.Invoke(new Action(() =>
|
|
220
|
+ {
|
|
221
|
+ APP.myloading.Show();
|
|
222
|
+ }));
|
|
223
|
+
|
|
224
|
+ APP.ResourceMyList = null;
|
|
225
|
+ serverReturnCode = registerController.ResourceMyList(Lsbid, Directorid, Resourceclass);
|
|
226
|
+ return APP.ErrorMessage;
|
|
227
|
+ }
|
|
228
|
+
|
|
229
|
+ /// <summary>
|
|
230
|
+ /// 我的备课列表服务-返回结果
|
|
231
|
+ /// </summary>
|
|
232
|
+ /// <returns></returns>
|
|
233
|
+ public void InvokeServerResourceMyListCompate(object obj)
|
|
234
|
+ {
|
|
235
|
+ Dispatcher.Invoke(new Action(() =>
|
|
236
|
+ {
|
|
237
|
+ APP.myloading.Hide();
|
|
238
|
+ }));
|
|
239
|
+
|
|
240
|
+ if (serverReturnCode == APP.ServerScuessCode)
|
|
241
|
+ {
|
|
242
|
+ if (pageData.menuList.Count > 0)
|
|
243
|
+ {
|
|
244
|
+ pageData.menuList.Clear();
|
|
245
|
+ DataContext = pageData;
|
|
246
|
+ }
|
|
247
|
+
|
|
248
|
+ if (APP.ResourceMyList.obj != null)
|
|
249
|
+ {
|
|
250
|
+ System.Collections.Generic.List<string> resource = new System.Collections.Generic.List<string>();
|
|
251
|
+ for (int i = 0; i < APP.ResourceMyList.obj.Count; i++)
|
|
252
|
+ {
|
|
253
|
+ string imgSuffix = string.Empty;
|
|
254
|
+ string visDuration = "Collapsed";
|
|
255
|
+ string visButton = "Collapsed";
|
|
256
|
+ string visDownload = "Visible";
|
|
257
|
+ System.DateTime dateTime = new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
|
|
258
|
+ dateTime = dateTime.AddSeconds(APP.ResourceMyList.obj[i].createtime).ToLocalTime();
|
|
259
|
+ if ("doc".Equals(APP.ResourceMyList.obj[i].suffix)
|
|
260
|
+ || "docx".Equals(APP.ResourceMyList.obj[i].suffix))
|
|
261
|
+ {
|
|
262
|
+ imgSuffix = "../Images/Resource/DOC.png";
|
|
263
|
+ }
|
|
264
|
+ else if ("ppt".Equals(APP.ResourceMyList.obj[i].suffix)
|
|
265
|
+ || "pptx".Equals(APP.ResourceMyList.obj[i].suffix))
|
|
266
|
+ {
|
|
267
|
+ imgSuffix = "../Images/Resource/PPT.png";
|
|
268
|
+ }
|
|
269
|
+ else if ("pdf".Equals(APP.ResourceMyList.obj[i].suffix))
|
|
270
|
+ {
|
|
271
|
+ imgSuffix = "../Images/Resource/PDF.png";
|
|
272
|
+ }
|
|
273
|
+ else if ("excel".Equals(APP.ResourceMyList.obj[i].suffix)
|
|
274
|
+ || "xls".Equals(APP.ResourceMyList.obj[i].suffix) || "xlsx".Equals(APP.ResourceMyList.obj[i].suffix))
|
|
275
|
+ {
|
|
276
|
+ imgSuffix = "../Images/Resource/EXCEL.png";
|
|
277
|
+ }
|
|
278
|
+ else if ("class".Equals(APP.ResourceMyList.obj[i].suffix))
|
|
279
|
+ {
|
|
280
|
+ imgSuffix = "../Images/Resource/CLASS.png";
|
|
281
|
+ }
|
|
282
|
+ else if ("dsc".Equals(APP.ResourceMyList.obj[i].suffix))
|
|
283
|
+ {
|
|
284
|
+ imgSuffix = "../Images/Resource/DSC.png";
|
|
285
|
+ }
|
|
286
|
+ else if ("mp3".Equals(APP.ResourceMyList.obj[i].suffix))
|
|
287
|
+ {
|
|
288
|
+ visDuration = "Visible";
|
|
289
|
+ imgSuffix = "../Images/Resource/MP3.png";
|
|
290
|
+ }
|
|
291
|
+ else if ("mp4".Equals(APP.ResourceMyList.obj[i].suffix)
|
|
292
|
+ || "flv".Equals(APP.ResourceMyList.obj[i].suffix))
|
|
293
|
+ {
|
|
294
|
+ visDuration = "Visible";
|
|
295
|
+ if (APP.ResourceMyList.obj[i].resourcecover != null)
|
|
296
|
+ {
|
|
297
|
+ imgSuffix = APP.showImageUrl + APP.ResourceMyList.obj[i].resourcecover.ToString();
|
|
298
|
+ }
|
|
299
|
+ else
|
|
300
|
+ {
|
|
301
|
+ imgSuffix = "../Images/Resource/MP4.png";
|
|
302
|
+ }
|
|
303
|
+ }
|
|
304
|
+ else if ("png".Equals(APP.ResourceMyList.obj[i].suffix)
|
|
305
|
+ || "jpg".Equals(APP.ResourceMyList.obj[i].suffix)
|
|
306
|
+ || "jpeg".Equals(APP.ResourceMyList.obj[i].suffix))
|
|
307
|
+ {
|
|
308
|
+ imgSuffix = "../Images/Resource/PNG.png";
|
|
309
|
+ }
|
|
310
|
+ else if ("txt".Equals(APP.ResourceMyList.obj[i].suffix))
|
|
311
|
+ {
|
|
312
|
+ imgSuffix = "../Images/Resource/TXT.png";
|
|
313
|
+ }
|
|
314
|
+ else if ("txt".Equals(APP.ResourceMyList.obj[i].suffix))
|
|
315
|
+ {
|
|
316
|
+ imgSuffix = "../Images/Resource/FLV.png";
|
|
317
|
+ }
|
|
318
|
+ else if ("wav".Equals(APP.ResourceMyList.obj[i].suffix))
|
|
319
|
+ {
|
|
320
|
+ imgSuffix = "../Images/Resource/WAV.png";
|
|
321
|
+ }
|
|
322
|
+ string resourcesSuffix = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\" + APP.LoginUser.username + "\\" + APP.ResourceMyList.obj[i].resourcename + "." + APP.ResourceMyList.obj[i].suffix;
|
|
323
|
+ if (!string.IsNullOrWhiteSpace(APP.fileStorageAddress))
|
|
324
|
+ {
|
|
325
|
+ resourcesSuffix = APP.fileStorageAddress + "\\" + APP.ResourceMyList.obj[i].resourcename + "." + APP.ResourceMyList.obj[i].suffix;
|
|
326
|
+ }
|
|
327
|
+ if (File.Exists(resourcesSuffix))//检查资源是否已经存在
|
|
328
|
+ {
|
|
329
|
+ visButton = "Visible";
|
|
330
|
+ visDownload = "Collapsed";
|
|
331
|
+ }
|
|
332
|
+ string resourcesize;
|
|
333
|
+ if (APP.ResourceMyList.obj[i].resourcesize > 1024)
|
|
334
|
+ {
|
|
335
|
+ if (APP.ResourceMyList.obj[i].resourcesize / 1024 > 1024)
|
|
336
|
+ {
|
|
337
|
+ resourcesize = (APP.ResourceMyList.obj[i].resourcesize / 1024 / 1024).ToString() + "MB";
|
|
338
|
+ }
|
|
339
|
+ else
|
|
340
|
+ {
|
|
341
|
+ resourcesize = (APP.ResourceMyList.obj[i].resourcesize / 1024).ToString() + "KB";
|
|
342
|
+ }
|
|
343
|
+ }
|
|
344
|
+ else
|
|
345
|
+ {
|
|
346
|
+ resourcesize = (APP.ResourceMyList.obj[i].resourcesize).ToString() + "B";
|
|
347
|
+ }
|
|
348
|
+ string duration = string.Empty;
|
|
349
|
+ if (APP.ResourceMyList.obj[i].duration > 59)
|
|
350
|
+ {
|
|
351
|
+ if (APP.ResourceMyList.obj[i].duration > 3599)
|
|
352
|
+ {
|
|
353
|
+ if (APP.ResourceMyList.obj[i].duration % 3600 == 0)
|
|
354
|
+ {
|
|
355
|
+ duration = (APP.ResourceMyList.obj[i].duration / 3600).ToString() + "时";
|
|
356
|
+ }
|
|
357
|
+ else
|
|
358
|
+ {
|
|
359
|
+ duration = (APP.ResourceMyList.obj[i].duration / 3600).ToString() + "时" + (APP.ResourceMyList.obj[i].duration % 3600).ToString() + "分";
|
|
360
|
+ }
|
|
361
|
+ }
|
|
362
|
+ else
|
|
363
|
+ {
|
|
364
|
+ if (APP.ResourceMyList.obj[i].duration % 60 == 0)
|
|
365
|
+ {
|
|
366
|
+ duration = (APP.ResourceMyList.obj[i].duration / 60).ToString() + "分";
|
|
367
|
+ }
|
|
368
|
+ else
|
|
369
|
+ {
|
|
370
|
+ duration = (APP.ResourceMyList.obj[i].duration / 60).ToString() + "分" + (APP.ResourceMyList.obj[i].duration % 60).ToString() + "秒";
|
|
371
|
+ }
|
|
372
|
+ }
|
|
373
|
+ }
|
|
374
|
+ else
|
|
375
|
+ {
|
|
376
|
+ duration = APP.ResourceMyList.obj[i].duration.ToString() + "秒";
|
|
377
|
+ }
|
|
378
|
+ pageData.menuList.Add(new ToolbarMenuTwo()
|
|
379
|
+ {
|
|
380
|
+ Resourcesize = resourcesize,
|
|
381
|
+ ResourceName = APP.ResourceMyList.obj[i].resourcename,
|
|
382
|
+ Times = dateTime.ToString("yyy-MM-dd HH:mm:ss"),
|
|
383
|
+ Pic = imgSuffix,
|
|
384
|
+ VisDuration = visDuration,
|
|
385
|
+ Duration = duration,
|
|
386
|
+ VisButton = visButton,
|
|
387
|
+ VisDownload = visDownload,
|
|
388
|
+ Resourceid = APP.ResourceMyList.obj[i].resourceid
|
|
389
|
+ });
|
|
390
|
+ }
|
|
391
|
+ }
|
|
392
|
+ DataContext = pageData;
|
|
393
|
+ }
|
|
394
|
+ else
|
|
395
|
+ {
|
|
396
|
+ MessageWindow.Show(APP.ErrorMessage);
|
|
397
|
+ }
|
|
398
|
+ }
|
|
399
|
+ private void DownLoadTwo(string httpurls, int position, string savepath)
|
|
400
|
+ {
|
|
401
|
+ thread = DownloadUtil.downloadFileWithCallback(
|
|
402
|
+ httpurls,
|
|
403
|
+ position,
|
|
404
|
+ savepath,
|
|
405
|
+ Dispatcher,
|
|
406
|
+ this
|
|
407
|
+ );
|
|
408
|
+ }
|
|
409
|
+
|
|
410
|
+ /// <summary>
|
|
411
|
+ /// 下载
|
|
412
|
+ /// </summary>
|
|
413
|
+ /// <param name="sender"></param>
|
|
414
|
+ /// <param name="e"></param>
|
|
415
|
+ private void btnDownload_Click(object sender, RoutedEventArgs e)
|
|
416
|
+ {
|
|
417
|
+ if (!isDownloadStatus)
|
|
418
|
+ {
|
|
419
|
+ int clickindex = 0;
|
|
420
|
+ Button btn = (Button)sender;
|
|
421
|
+ for (int i = 0; i < APP.ResourceMyList.obj.Count; i++)
|
|
422
|
+ {
|
|
423
|
+
|
|
424
|
+ if (APP.ResourceMyList.obj[i].resourceid == Convert.ToInt32(btn.Tag))
|
|
425
|
+ {
|
|
426
|
+ clickindex = i;
|
|
427
|
+ break;
|
|
428
|
+ }
|
|
429
|
+ }
|
|
430
|
+ string fileAddress = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\" + APP.LoginUser.username + "\\" + APP.ResourceMyList.obj[clickindex].resourcename + "." + APP.ResourceMyList.obj[clickindex].suffix;
|
|
431
|
+ if (!string.IsNullOrWhiteSpace(APP.fileStorageAddress))
|
|
432
|
+ {
|
|
433
|
+ fileAddress = APP.fileStorageAddress + "\\" + APP.ResourceMyList.obj[clickindex].resourcename + "." + APP.ResourceMyList.obj[clickindex].suffix;
|
|
434
|
+ }
|
|
435
|
+ //if (APP.outputInforLog)
|
|
436
|
+ //{
|
|
437
|
+ // LogHelper.WriteInfoLog("UserCenterWindow(btnDownload_Click 下载)" + fileAddress);
|
|
438
|
+ //}
|
|
439
|
+ if (Directory.Exists(fileAddress))//存在就打开 不存在就下载
|
|
440
|
+ {
|
|
441
|
+ ProcessStartInfo psi = new ProcessStartInfo(fileAddress);
|
|
442
|
+ Process pro = new Process
|
|
443
|
+ {
|
|
444
|
+ StartInfo = psi
|
|
445
|
+ };
|
|
446
|
+ pro.Start();
|
|
447
|
+ }
|
|
448
|
+ else
|
|
449
|
+ {
|
|
450
|
+ if (!string.IsNullOrWhiteSpace(APP.fileStorageAddress))
|
|
451
|
+ {
|
|
452
|
+ fileAddress = APP.fileStorageAddress;
|
|
453
|
+ }
|
|
454
|
+ if (!Directory.Exists(fileAddress))
|
|
455
|
+ {
|
|
456
|
+ Directory.CreateDirectory(fileAddress);
|
|
457
|
+ }
|
|
458
|
+ string userHeadPic = APP.showImageUrl + APP.ResourceMyList.obj[clickindex].resourceurl.ToString();
|
|
459
|
+ DownLoadTwo(userHeadPic, 9999 + clickindex, fileAddress + "\\");
|
|
460
|
+ }
|
|
461
|
+ }
|
|
462
|
+ }
|
|
463
|
+
|
|
464
|
+ /// <summary>
|
|
465
|
+ /// 打开
|
|
466
|
+ /// </summary>
|
|
467
|
+ /// <param name="sender"></param>
|
|
468
|
+ /// <param name="e"></param>
|
32
|
469
|
private void btnTurnOn_Click(object sender, RoutedEventArgs e)
|
33
|
470
|
{
|
|
471
|
+ if (!isDownloadStatus)
|
|
472
|
+ {
|
|
473
|
+ int clickindex = 0;
|
|
474
|
+ Button btn = (Button)sender;
|
|
475
|
+ for (int i = 0; i < APP.ResourceMyList.obj.Count; i++)
|
|
476
|
+ {
|
|
477
|
+
|
|
478
|
+ if (APP.ResourceMyList.obj[i].resourceid == Convert.ToInt32(btn.Tag))
|
|
479
|
+ {
|
|
480
|
+ clickindex = i;
|
|
481
|
+ break;
|
|
482
|
+ }
|
|
483
|
+ }
|
34
|
484
|
|
|
485
|
+ string fileAddress = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\" + APP.LoginUser.username + "\\" + APP.ResourceMyList.obj[clickindex].resourcename + "." + APP.ResourceMyList.obj[clickindex].suffix;
|
|
486
|
+ if (!string.IsNullOrWhiteSpace(APP.fileStorageAddress))
|
|
487
|
+ {
|
|
488
|
+ fileAddress = APP.fileStorageAddress + "\\" + APP.ResourceMyList.obj[clickindex].resourcename + "." + APP.ResourceMyList.obj[clickindex].suffix;
|
|
489
|
+ }
|
|
490
|
+ //if (APP.outputInforLog)
|
|
491
|
+ //{
|
|
492
|
+ // LogHelper.WriteInfoLog("UserCenterWindow(btnTurnOn_Click 打开)" + fileAddress);
|
|
493
|
+ //}
|
|
494
|
+ if (Directory.Exists(fileAddress))//存在就打开 不存在就下载
|
|
495
|
+ {
|
|
496
|
+ try
|
|
497
|
+ {
|
|
498
|
+ ProcessStartInfo psi = new ProcessStartInfo(fileAddress);
|
|
499
|
+ Process pro = new Process
|
|
500
|
+ {
|
|
501
|
+ StartInfo = psi
|
|
502
|
+ };
|
|
503
|
+ pro.Start();
|
|
504
|
+ }
|
|
505
|
+ catch (Exception ex)
|
|
506
|
+ {
|
|
507
|
+ LogHelper.WriteErrLog("UserCenterWindow【btnTurnOn_Click】" + ex.Message, ex);
|
|
508
|
+ MessageWindow.Show(ex.Message);
|
|
509
|
+ return;
|
|
510
|
+ }
|
|
511
|
+ }
|
|
512
|
+ else
|
|
513
|
+ {
|
|
514
|
+ if (!string.IsNullOrWhiteSpace(APP.fileStorageAddress))
|
|
515
|
+ {
|
|
516
|
+ fileAddress = APP.fileStorageAddress;
|
|
517
|
+ }
|
|
518
|
+ if (!Directory.Exists(fileAddress))
|
|
519
|
+ {
|
|
520
|
+ Directory.CreateDirectory(fileAddress);
|
|
521
|
+ }
|
|
522
|
+ string userHeadPic = APP.showImageUrl + APP.ResourceMyList.obj[clickindex].resourceurl.ToString();
|
|
523
|
+ DownLoadTwo(userHeadPic, 9999 + clickindex, fileAddress + "\\");
|
|
524
|
+ }
|
|
525
|
+ }
|
35
|
526
|
}
|
36
|
527
|
|
37
|
|
- private void Window_MouseMove(object sender, MouseEventArgs e)
|
|
528
|
+ /// <summary>
|
|
529
|
+ /// 全部
|
|
530
|
+ /// </summary>
|
|
531
|
+ /// <param name="sender"></param>
|
|
532
|
+ /// <param name="e"></param>
|
|
533
|
+ private void btnAll_Click(object sender, RoutedEventArgs e)
|
|
534
|
+ {
|
|
535
|
+ pageData.menuList.Clear();
|
|
536
|
+ DataContext = pageData;
|
|
537
|
+ Resourceclass = 0;
|
|
538
|
+ borAll.Background = new SolidColorBrush(Colors.DodgerBlue);
|
|
539
|
+ borAudio.Background = new SolidColorBrush(Colors.Transparent);
|
|
540
|
+ borVideo.Background = new SolidColorBrush(Colors.Transparent);
|
|
541
|
+ borImage.Background = new SolidColorBrush(Colors.Transparent);
|
|
542
|
+ borDoc.Background = new SolidColorBrush(Colors.Transparent);
|
|
543
|
+ btnAll.Foreground = new SolidColorBrush(Colors.White);
|
|
544
|
+ btnAudio.Foreground = new SolidColorBrush(Colors.Black);
|
|
545
|
+ btnVideo.Foreground = new SolidColorBrush(Colors.Black);
|
|
546
|
+ btnImage.Foreground = new SolidColorBrush(Colors.Black);
|
|
547
|
+ btnDoc.Foreground = new SolidColorBrush(Colors.Black);
|
|
548
|
+ APP.BackgroundWorkerHelper.RunWorkerAsync(InvokeResourceMyListServering, InvokeServerResourceMyListCompate);
|
|
549
|
+ }
|
|
550
|
+
|
|
551
|
+ private void Window_Closing(object sender, CancelEventArgs e)
|
|
552
|
+ {
|
|
553
|
+ if (pageData.menuList.Count > 0)
|
|
554
|
+ {
|
|
555
|
+ pageData.menuList.Clear();
|
|
556
|
+ DataContext = null;
|
|
557
|
+ }
|
|
558
|
+ }
|
|
559
|
+
|
|
560
|
+ /// <summary>
|
|
561
|
+ /// 音频
|
|
562
|
+ /// </summary>
|
|
563
|
+ /// <param name="sender"></param>
|
|
564
|
+ /// <param name="e"></param>
|
|
565
|
+ private void btnAudio_Click(object sender, RoutedEventArgs e)
|
|
566
|
+ {
|
|
567
|
+ pageData.menuList.Clear();
|
|
568
|
+ DataContext = pageData;
|
|
569
|
+ Resourceclass = 1;
|
|
570
|
+ borAll.Background = new SolidColorBrush(Colors.Transparent);
|
|
571
|
+ borAudio.Background = new SolidColorBrush(Colors.DodgerBlue);
|
|
572
|
+ borVideo.Background = new SolidColorBrush(Colors.Transparent);
|
|
573
|
+ borImage.Background = new SolidColorBrush(Colors.Transparent);
|
|
574
|
+ borDoc.Background = new SolidColorBrush(Colors.Transparent);
|
|
575
|
+ btnAll.Foreground = new SolidColorBrush(Colors.Black);
|
|
576
|
+ btnAudio.Foreground = new SolidColorBrush(Colors.White);
|
|
577
|
+ btnVideo.Foreground = new SolidColorBrush(Colors.Black);
|
|
578
|
+ btnImage.Foreground = new SolidColorBrush(Colors.Black);
|
|
579
|
+ btnDoc.Foreground = new SolidColorBrush(Colors.Black);
|
|
580
|
+ APP.BackgroundWorkerHelper.RunWorkerAsync(InvokeResourceMyListServering, InvokeServerResourceMyListCompate);
|
|
581
|
+ }
|
|
582
|
+
|
|
583
|
+ /// <summary>
|
|
584
|
+ /// 视频
|
|
585
|
+ /// </summary>
|
|
586
|
+ /// <param name="sender"></param>
|
|
587
|
+ /// <param name="e"></param>
|
|
588
|
+ private void btnVideo_Click(object sender, RoutedEventArgs e)
|
38
|
589
|
{
|
|
590
|
+ pageData.menuList.Clear();
|
|
591
|
+ DataContext = pageData;
|
|
592
|
+ Resourceclass = 2;
|
|
593
|
+ borAll.Background = new SolidColorBrush(Colors.Transparent);
|
|
594
|
+ borAudio.Background = new SolidColorBrush(Colors.Transparent);
|
|
595
|
+ borVideo.Background = new SolidColorBrush(Colors.DodgerBlue);
|
|
596
|
+ borImage.Background = new SolidColorBrush(Colors.Transparent);
|
|
597
|
+ borDoc.Background = new SolidColorBrush(Colors.Transparent);
|
|
598
|
+ btnAll.Foreground = new SolidColorBrush(Colors.Black);
|
|
599
|
+ btnAudio.Foreground = new SolidColorBrush(Colors.Black);
|
|
600
|
+ btnVideo.Foreground = new SolidColorBrush(Colors.White);
|
|
601
|
+ btnImage.Foreground = new SolidColorBrush(Colors.Black);
|
|
602
|
+ btnDoc.Foreground = new SolidColorBrush(Colors.Black);
|
|
603
|
+ APP.BackgroundWorkerHelper.RunWorkerAsync(InvokeResourceMyListServering, InvokeServerResourceMyListCompate);
|
|
604
|
+ }
|
39
|
605
|
|
|
606
|
+ /// <summary>
|
|
607
|
+ /// 图片
|
|
608
|
+ /// </summary>
|
|
609
|
+ /// <param name="sender"></param>
|
|
610
|
+ /// <param name="e"></param>
|
|
611
|
+ private void btnImage_Click(object sender, RoutedEventArgs e)
|
|
612
|
+ {
|
|
613
|
+ pageData.menuList.Clear();
|
|
614
|
+ DataContext = pageData;
|
|
615
|
+ Resourceclass = 3;
|
|
616
|
+ borAll.Background = new SolidColorBrush(Colors.Transparent);
|
|
617
|
+ borAudio.Background = new SolidColorBrush(Colors.Transparent);
|
|
618
|
+ borVideo.Background = new SolidColorBrush(Colors.Transparent);
|
|
619
|
+ borImage.Background = new SolidColorBrush(Colors.DodgerBlue);
|
|
620
|
+ borDoc.Background = new SolidColorBrush(Colors.Transparent);
|
|
621
|
+ btnAll.Foreground = new SolidColorBrush(Colors.Black);
|
|
622
|
+ btnAudio.Foreground = new SolidColorBrush(Colors.Black);
|
|
623
|
+ btnVideo.Foreground = new SolidColorBrush(Colors.Black);
|
|
624
|
+ btnImage.Foreground = new SolidColorBrush(Colors.White);
|
|
625
|
+ btnDoc.Foreground = new SolidColorBrush(Colors.Black);
|
|
626
|
+ APP.BackgroundWorkerHelper.RunWorkerAsync(InvokeResourceMyListServering, InvokeServerResourceMyListCompate);
|
40
|
627
|
}
|
|
628
|
+
|
41
|
629
|
/// <summary>
|
42
|
|
- /// 关闭事件
|
|
630
|
+ /// 文档
|
43
|
631
|
/// </summary>
|
44
|
632
|
/// <param name="sender"></param>
|
45
|
633
|
/// <param name="e"></param>
|
|
634
|
+ private void btnDoc_Click(object sender, RoutedEventArgs e)
|
|
635
|
+ {
|
|
636
|
+ pageData.menuList.Clear();
|
|
637
|
+ DataContext = pageData;
|
|
638
|
+ Resourceclass = 4;
|
|
639
|
+ borAll.Background = new SolidColorBrush(Colors.Transparent);
|
|
640
|
+ borAudio.Background = new SolidColorBrush(Colors.Transparent);
|
|
641
|
+ borVideo.Background = new SolidColorBrush(Colors.Transparent);
|
|
642
|
+ borImage.Background = new SolidColorBrush(Colors.Transparent);
|
|
643
|
+ borDoc.Background = new SolidColorBrush(Colors.DodgerBlue);
|
|
644
|
+ btnAll.Foreground = new SolidColorBrush(Colors.Black);
|
|
645
|
+ btnAudio.Foreground = new SolidColorBrush(Colors.Black);
|
|
646
|
+ btnVideo.Foreground = new SolidColorBrush(Colors.Black);
|
|
647
|
+ btnImage.Foreground = new SolidColorBrush(Colors.Black);
|
|
648
|
+ btnDoc.Foreground = new SolidColorBrush(Colors.White);
|
|
649
|
+ APP.BackgroundWorkerHelper.RunWorkerAsync(InvokeResourceMyListServering, InvokeServerResourceMyListCompate);
|
|
650
|
+ }
|
|
651
|
+
|
|
652
|
+ private void Refresh()
|
|
653
|
+ {
|
|
654
|
+ pageData.menuList.Clear();
|
|
655
|
+ }
|
|
656
|
+ /// <summary>
|
|
657
|
+ /// 科目教材选择改变事件
|
|
658
|
+ /// </summary>
|
|
659
|
+ /// <param name="sender"></param>
|
|
660
|
+ /// <param name="e"></param>
|
|
661
|
+ private void cmbClass_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
662
|
+ {
|
|
663
|
+ if (initialization)
|
|
664
|
+ {
|
|
665
|
+ initialization = false;
|
|
666
|
+ }
|
|
667
|
+ else
|
|
668
|
+ {
|
|
669
|
+ Directorid = 0;
|
|
670
|
+ borAll.Background = new SolidColorBrush(Colors.DodgerBlue);
|
|
671
|
+ borAudio.Background = new SolidColorBrush(Colors.Transparent);
|
|
672
|
+ borVideo.Background = new SolidColorBrush(Colors.Transparent);
|
|
673
|
+ borImage.Background = new SolidColorBrush(Colors.Transparent);
|
|
674
|
+ borDoc.Background = new SolidColorBrush(Colors.Transparent);
|
|
675
|
+ btnAll.Foreground = new SolidColorBrush(Colors.White);
|
|
676
|
+ btnAudio.Foreground = new SolidColorBrush(Colors.Black);
|
|
677
|
+ btnVideo.Foreground = new SolidColorBrush(Colors.Black);
|
|
678
|
+ btnImage.Foreground = new SolidColorBrush(Colors.Black);
|
|
679
|
+ btnDoc.Foreground = new SolidColorBrush(Colors.Black);
|
|
680
|
+ }
|
|
681
|
+
|
|
682
|
+ if (cmbClass.SelectedValue != null)
|
|
683
|
+ {
|
|
684
|
+ Lsbid = Convert.ToInt32(cmbClass.SelectedValue.ToString());
|
|
685
|
+ Refresh();
|
|
686
|
+ APP.BackgroundWorkerHelper.RunWorkerAsync(InvokeDirectorListServering, InvokeServerDirectorListCompate);
|
|
687
|
+ }
|
|
688
|
+ else
|
|
689
|
+ {
|
|
690
|
+ Refresh();
|
|
691
|
+ }
|
|
692
|
+ }
|
|
693
|
+
|
|
694
|
+ private void Window_MouseMove(object sender, MouseEventArgs e)
|
|
695
|
+ {
|
|
696
|
+ if (e.LeftButton == MouseButtonState.Pressed)
|
|
697
|
+ {
|
|
698
|
+ //执行移动方法
|
|
699
|
+ DragMove();
|
|
700
|
+ }
|
|
701
|
+ }
|
|
702
|
+
|
46
|
703
|
private void btnDown_Click(object sender, RoutedEventArgs e)
|
47
|
704
|
{
|
48
|
|
- //if (thread != null)
|
49
|
|
- //{
|
50
|
|
- // thread.Abort();
|
51
|
|
- //}
|
52
|
|
- //MyApp.myloading.Hide();
|
|
705
|
+ if (thread != null)
|
|
706
|
+ {
|
|
707
|
+ thread.Abort();
|
|
708
|
+ }
|
|
709
|
+ APP.myloading.Hide();
|
53
|
710
|
Close();
|
54
|
711
|
//ToolbarWindow.IsOpenUserCenterWindow = false;
|
55
|
712
|
}
|
56
|
713
|
|
57
|
|
- private void cmbClass_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
714
|
+ public void downloadBegin(int position)
|
58
|
715
|
{
|
|
716
|
+ isDownloadStatus = true;
|
|
717
|
+ if (position >= 9999)
|
|
718
|
+ {
|
|
719
|
+ tip_outer.Visibility = Visibility.Visible;
|
|
720
|
+ }
|
|
721
|
+ }
|
59
|
722
|
|
|
723
|
+ public void downloadProgress(int position, int progress)
|
|
724
|
+ {
|
|
725
|
+ if (position >= 9999)
|
|
726
|
+ {
|
|
727
|
+ pgbProcess.Value = progress * 100 / 100;
|
|
728
|
+ lbProcess.Content = string.Format("{0}% / {1}%", progress, 100);
|
|
729
|
+ }
|
60
|
730
|
}
|
61
|
731
|
|
62
|
|
- private void btnAudio_Click(object sender, RoutedEventArgs e)
|
|
732
|
+ public void downloadEnd(int position, string filepath)
|
63
|
733
|
{
|
|
734
|
+ isDownloadStatus = false;
|
|
735
|
+ thread = null;
|
|
736
|
+ if (pageData.menuList.Count > 0)
|
|
737
|
+ {
|
|
738
|
+ //if (APP.outputInforLog)
|
|
739
|
+ //{
|
|
740
|
+ // LogHelper.WriteInfoLog("UserCenterWindow(downloadEnd 下载完成)" + filepath);
|
|
741
|
+ //}
|
|
742
|
+ if (position < 9999)
|
|
743
|
+ {
|
|
744
|
+ if (pageData.menuList.Count < position)
|
|
745
|
+ {
|
|
746
|
+ pageData.menuList[position].Pic = filepath;
|
|
747
|
+ }
|
|
748
|
+ }
|
|
749
|
+ else if (filepath.Contains(pageData.menuList[position - 9999].ResourceName))
|
|
750
|
+ {
|
|
751
|
+ pageData.menuList[position - 9999].VisDownload = "Collapsed";
|
|
752
|
+ pageData.menuList[position - 9999].VisButton = "Visible";
|
|
753
|
+ tip_outer.Visibility = Visibility.Hidden;
|
|
754
|
+ try
|
|
755
|
+ {
|
|
756
|
+ ProcessStartInfo psi = new ProcessStartInfo(filepath);
|
|
757
|
+ Process pro = new Process
|
|
758
|
+ {
|
|
759
|
+ StartInfo = psi
|
|
760
|
+ };
|
|
761
|
+ pro.Start();
|
|
762
|
+ }
|
|
763
|
+ catch (Exception ex)
|
|
764
|
+ {
|
|
765
|
+ LogHelper.WriteErrLog("UserCenterWindow【downloadEnd】" + ex.Message, ex);
|
|
766
|
+ MessageWindow.Show(ex.Message);
|
|
767
|
+ return;
|
|
768
|
+ }
|
|
769
|
+ }
|
|
770
|
+ else
|
|
771
|
+ {
|
|
772
|
+ tip_outer.Visibility = Visibility.Hidden;
|
|
773
|
+ try
|
|
774
|
+ {
|
|
775
|
+ ProcessStartInfo psi = new ProcessStartInfo(filepath);
|
|
776
|
+ Process pro = new Process
|
|
777
|
+ {
|
|
778
|
+ StartInfo = psi
|
|
779
|
+ };
|
|
780
|
+ pro.Start();
|
|
781
|
+ }
|
|
782
|
+ catch (Exception ex)
|
|
783
|
+ {
|
|
784
|
+ LogHelper.WriteErrLog("UserCenterWindow【downloadEnd】" + ex.Message, ex);
|
|
785
|
+ MessageWindow.Show(ex.Message);
|
|
786
|
+ return;
|
|
787
|
+ }
|
|
788
|
+ }
|
|
789
|
+ }
|
|
790
|
+ else
|
|
791
|
+ {
|
|
792
|
+ tip_outer.Visibility = Visibility.Hidden;
|
64
|
793
|
|
|
794
|
+ try
|
|
795
|
+ {
|
|
796
|
+ ProcessStartInfo psi = new ProcessStartInfo(filepath);
|
|
797
|
+ Process pro = new Process
|
|
798
|
+ {
|
|
799
|
+ StartInfo = psi
|
|
800
|
+ };
|
|
801
|
+ pro.Start();
|
|
802
|
+ }
|
|
803
|
+ catch (Exception ex)
|
|
804
|
+ {
|
|
805
|
+ LogHelper.WriteErrLog("UserCenterWindow【downloadEnd】" + ex.Message, ex);
|
|
806
|
+ MessageWindow.Show(ex.Message);
|
|
807
|
+ return;
|
|
808
|
+ }
|
|
809
|
+ }
|
65
|
810
|
}
|
66
|
811
|
|
67
|
|
- private void btnVideo_Click(object sender, RoutedEventArgs e)
|
|
812
|
+ public void downloadError(int position, string msg)
|
68
|
813
|
{
|
69
|
|
-
|
|
814
|
+ Dispatcher.Invoke(new Action(() =>
|
|
815
|
+ {
|
|
816
|
+ tip_outer.Visibility = Visibility.Collapsed;
|
|
817
|
+ }));
|
|
818
|
+ isDownloadStatus = false;
|
|
819
|
+ if (!msg.Equals("远程服务器返回错误: (404) 未找到。") && !msg.Equals("正在中止线程。"))
|
|
820
|
+ {
|
|
821
|
+ MessageWindow.Show(msg);
|
|
822
|
+ }
|
70
|
823
|
}
|
71
|
824
|
|
72
|
|
- private void btnImage_Click(object sender, RoutedEventArgs e)
|
|
825
|
+ public class ButtonBrush
|
73
|
826
|
{
|
|
827
|
+ public static readonly DependencyProperty ButtonPressBackgroundProperty = DependencyProperty.RegisterAttached(
|
|
828
|
+ "ButtonPressBackground", typeof(Brush), typeof(ButtonBrush), new PropertyMetadata(default(Brush)));
|
74
|
829
|
|
|
830
|
+ public static void SetButtonPressBackground(DependencyObject element, Brush value)
|
|
831
|
+ {
|
|
832
|
+ element.SetValue(ButtonPressBackgroundProperty, value);
|
|
833
|
+ }
|
|
834
|
+
|
|
835
|
+ public static Brush GetButtonPressBackground(DependencyObject element)
|
|
836
|
+ {
|
|
837
|
+ return (Brush)element.GetValue(ButtonPressBackgroundProperty);
|
|
838
|
+ }
|
75
|
839
|
}
|
|
840
|
+ }
|
76
|
841
|
|
77
|
|
- private void btnDoc_Click(object sender, RoutedEventArgs e)
|
|
842
|
+ public class ToolbarMenuTwo : NotifyModel
|
|
843
|
+ {
|
|
844
|
+ internal string _resourceName;
|
|
845
|
+
|
|
846
|
+ public string ResourceName
|
78
|
847
|
{
|
|
848
|
+ get => _resourceName;
|
|
849
|
+ set { _resourceName = value; OnPropertyChanged("ResourceName"); }
|
|
850
|
+ }
|
|
851
|
+
|
|
852
|
+ internal string _times;
|
79
|
853
|
|
|
854
|
+ public string Times
|
|
855
|
+ {
|
|
856
|
+ get => _times;
|
|
857
|
+ set { _times = value; OnPropertyChanged("Times"); }
|
80
|
858
|
}
|
81
|
859
|
|
82
|
|
- private void zhangjieClick(object sender, RoutedEventArgs e)
|
|
860
|
+ internal string _Pic;
|
|
861
|
+
|
|
862
|
+ public string Pic
|
83
|
863
|
{
|
|
864
|
+ get => _Pic;
|
|
865
|
+ set { _Pic = value; OnPropertyChanged("Pic"); }
|
|
866
|
+ }
|
84
|
867
|
|
|
868
|
+ /// <summary>
|
|
869
|
+ /// 视频时长秒
|
|
870
|
+ /// </summary>
|
|
871
|
+ public string Duration { get; set; }
|
|
872
|
+
|
|
873
|
+ /// <summary>
|
|
874
|
+ /// 视频时长是否显示
|
|
875
|
+ /// </summary>
|
|
876
|
+ public string VisDuration { get; set; }
|
|
877
|
+
|
|
878
|
+ /// <summary>
|
|
879
|
+ /// 文件大小
|
|
880
|
+ /// </summary>
|
|
881
|
+ public string Resourcesize { get; set; }
|
|
882
|
+
|
|
883
|
+ internal string _VisButton;
|
|
884
|
+
|
|
885
|
+ /// <summary>
|
|
886
|
+ /// 打开按钮是否显示
|
|
887
|
+ /// </summary>
|
|
888
|
+ public string VisButton
|
|
889
|
+ {
|
|
890
|
+ get => _VisButton;
|
|
891
|
+ set { _VisButton = value; OnPropertyChanged("VisButton"); }
|
85
|
892
|
}
|
86
|
893
|
|
87
|
|
- private void btnDownload_Click(object sender, RoutedEventArgs e)
|
|
894
|
+ internal string _VisDownload;
|
|
895
|
+
|
|
896
|
+ /// <summary>
|
|
897
|
+ /// 下载按钮是否显示
|
|
898
|
+ /// </summary>
|
|
899
|
+ public string VisDownload
|
88
|
900
|
{
|
|
901
|
+ get => _VisDownload;
|
|
902
|
+ set { _VisDownload = value; OnPropertyChanged("VisDownload"); }
|
|
903
|
+ }
|
89
|
904
|
|
|
905
|
+ internal int _Resourceid;
|
|
906
|
+
|
|
907
|
+ /// <summary>
|
|
908
|
+ /// 资源id
|
|
909
|
+ /// </summary>
|
|
910
|
+ public int Resourceid
|
|
911
|
+ {
|
|
912
|
+ get => _Resourceid;
|
|
913
|
+ set { _Resourceid = value; OnPropertyChanged("Resourceid"); }
|
90
|
914
|
}
|
|
915
|
+ }
|
91
|
916
|
|
92
|
|
- private void btnAll_Click(object sender, RoutedEventArgs e)
|
|
917
|
+ public class UserCenterPageData : NotifyModel
|
|
918
|
+ {
|
|
919
|
+ public ObservableCollection<ComboBoxBeanModel> bookList { get; set; }
|
|
920
|
+
|
|
921
|
+ public ObservableCollection<ChapterModel> zhangjieList { get; set; }
|
|
922
|
+ public ObservableCollection<ToolbarMenuTwo> menuList { get; set; }
|
|
923
|
+
|
|
924
|
+ public UserCenterPageData()
|
93
|
925
|
{
|
|
926
|
+ bookList = new ObservableCollection<ComboBoxBeanModel>();
|
|
927
|
+ zhangjieList = new ObservableCollection<ChapterModel>();
|
|
928
|
+ menuList = new ObservableCollection<ToolbarMenuTwo>();
|
|
929
|
+ }
|
|
930
|
+ }
|
|
931
|
+
|
|
932
|
+ public class ChapterModel : NotifyModel
|
|
933
|
+ {
|
|
934
|
+ public int directorid { get; set; }
|
|
935
|
+ public string directorname { get; set; }
|
|
936
|
+ public int level { get; set; }
|
94
|
937
|
|
|
938
|
+ private int _selected;
|
|
939
|
+
|
|
940
|
+ public int selected
|
|
941
|
+ {
|
|
942
|
+ get => _selected;
|
|
943
|
+ set
|
|
944
|
+ {
|
|
945
|
+ _selected = value;
|
|
946
|
+ OnPropertyChanged("selected");
|
|
947
|
+ }
|
95
|
948
|
}
|
96
|
949
|
}
|
97
|
950
|
}
|