星火微课系统客户端
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

FileDirectoryWindow.xaml.cs 5.1KB

4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
4年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. using Org.BouncyCastle.Asn1.Crmf;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  4. using System.Windows;
  5. using System.Windows.Input;
  6. using XHWK.Model;
  7. namespace XHWK.WKTool
  8. {
  9. /// <summary>
  10. /// 文件目录
  11. /// </summary>
  12. public partial class FileDirectoryWindow : Window
  13. {
  14. /// <summary>
  15. /// 视频模型
  16. /// </summary>
  17. List<Model_Video> model_VideoList =null;
  18. internal FileDirectoryData pageData = new FileDirectoryData();
  19. /// <summary>
  20. /// 文件目录
  21. /// </summary>
  22. public FileDirectoryWindow()
  23. {
  24. InitializeComponent();
  25. Initialize();
  26. }
  27. /// <summary>
  28. /// 初始化
  29. /// </summary>
  30. public void Initialize()
  31. {
  32. //加载视频列表
  33. LoadingVideoList();
  34. int i = 1;
  35. //显示视频
  36. foreach (Model_Video videoinfo in model_VideoList)
  37. {
  38. //是否已上传
  39. //videoinfo.IsUpload;
  40. //录制时间
  41. //videoinfo.RSTime;
  42. //文件大小
  43. //videoinfo.VideoSize;
  44. //文件缩略图路径
  45. //videoinfo.ThumbnailPath;
  46. //文件唯一标示 上传事件筛选需要上传的视频
  47. //videoinfo.FileGuid;
  48. //文件存储路径
  49. //videoinfo.VidePath;
  50. pageData.menuList.Add(new FileDirectoryModel()
  51. {
  52. SerialNumber = i,
  53. VideoName = Common.system.FileToolsCommon.GetIOFileName( videoinfo.VidePath),
  54. VideoDuration = 0,
  55. VideoSize = videoinfo.VideoSize,
  56. VideoTime = videoinfo.RSTime,
  57. });
  58. i++;
  59. }
  60. DataContext = pageData;
  61. }
  62. /// <summary>
  63. /// 加载视频列表
  64. /// </summary>
  65. public void LoadingVideoList()
  66. {
  67. model_VideoList = new List<Model_Video>();
  68. foreach(Model_WKData Vdata in APP.WKDataList)
  69. {
  70. if (Vdata.VideoList == null)
  71. continue;
  72. foreach(Model_Video videoinfo in Vdata.VideoList)
  73. {
  74. model_VideoList.Add(videoinfo);
  75. }
  76. }
  77. }
  78. /// <summary>
  79. /// 关闭
  80. /// </summary>
  81. /// <param name="sender"></param>
  82. /// <param name="e"></param>
  83. private void btnDown_Click(object sender, RoutedEventArgs e)
  84. {
  85. this.Hide();
  86. }
  87. /// <summary>
  88. /// 窗口移动
  89. /// </summary>
  90. /// <param name="sender"></param>
  91. /// <param name="e"></param>
  92. private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  93. {
  94. DragMove();
  95. }
  96. }
  97. public class FileDirectoryData : NotifyModel
  98. {
  99. public ObservableCollection<FileDirectoryModel> menuList { get; set; }
  100. public FileDirectoryData()
  101. {
  102. menuList = new ObservableCollection<FileDirectoryModel>();
  103. }
  104. }
  105. public class FileDirectoryModel : NotifyModel
  106. {
  107. private int _serialNumber;
  108. /// <summary>
  109. /// 序号
  110. /// </summary>
  111. public int SerialNumber
  112. {
  113. get => _serialNumber;
  114. set
  115. {
  116. _serialNumber = value;
  117. OnPropertyChanged("SerialNumber");
  118. }
  119. }
  120. private string _videoName;
  121. /// <summary>
  122. /// 视频名称
  123. /// </summary>
  124. public string VideoName
  125. {
  126. get => _videoName;
  127. set
  128. {
  129. _videoName = value;
  130. OnPropertyChanged("VideoName");
  131. }
  132. }
  133. private int _videoDuration;
  134. /// <summary>
  135. /// 视频时长
  136. /// </summary>
  137. public int VideoDuration
  138. {
  139. get => _videoDuration;
  140. set
  141. {
  142. _videoDuration = value;
  143. OnPropertyChanged("VideoDuration");
  144. }
  145. }
  146. private string _videoSize;
  147. /// <summary>
  148. /// 视频大小
  149. /// </summary>
  150. public string VideoSize
  151. {
  152. get => _videoSize;
  153. set
  154. {
  155. _videoSize = value;
  156. OnPropertyChanged("VideoSize");
  157. }
  158. }
  159. private string _videoTime;
  160. /// <summary>
  161. /// 日期
  162. /// </summary>
  163. public string VideoTime
  164. {
  165. get => _videoTime;
  166. set
  167. {
  168. _videoTime = value;
  169. OnPropertyChanged("VideoTime");
  170. }
  171. }
  172. private string _colour;
  173. /// <summary>
  174. /// 颜色
  175. /// </summary>
  176. public string Colour
  177. {
  178. get => _colour;
  179. set
  180. {
  181. _colour = value;
  182. OnPropertyChanged("Colour");
  183. }
  184. }
  185. }
  186. }