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

XHMicroLessonSystemWindow.xaml.cs 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. using Common.system;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Forms;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Shapes;
  16. namespace XHWK.WKTool
  17. {
  18. /// <summary>
  19. /// 主页面
  20. /// </summary>
  21. public partial class XHMicroLessonSystemWindow : Window
  22. {
  23. #region 字段
  24. /// <summary>
  25. /// 文件目录窗口
  26. /// </summary>
  27. //private CountdownWindow FileDirectoryWindows = null;
  28. private FolderBrowserDialog Ofd;
  29. private DialogResult Result;
  30. #endregion
  31. #region 初始化
  32. /// <summary>
  33. /// 主页面
  34. /// </summary>
  35. public XHMicroLessonSystemWindow()
  36. {
  37. InitializeComponent();
  38. }
  39. /// <summary>
  40. /// 初始化
  41. /// </summary>
  42. public void Initialize()
  43. {
  44. }
  45. #endregion
  46. #region 事件
  47. /// <summary>
  48. /// 窗体移动
  49. /// </summary>
  50. /// <param name="sender"></param>
  51. /// <param name="e"></param>
  52. private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  53. {
  54. DragMove();
  55. }
  56. /// <summary>
  57. /// 摄像头打开事件
  58. /// </summary>
  59. /// <param name="sender"></param>
  60. /// <param name="e"></param>
  61. private void RbnOpen_Click(object sender, RoutedEventArgs e)
  62. {
  63. //UCCamera win = new UCCamera();
  64. ////win.Topmost = true;
  65. //win.ShowDialog();
  66. gridCamera.Visibility = Visibility.Visible;
  67. CameraHelper.IsDisplay = true;
  68. CameraHelper.SourcePlayer = player;
  69. CameraHelper.UpdateCameraDevices();
  70. if (CameraHelper.CameraDevices.Count > 0)
  71. {
  72. CameraHelper.SetCameraDevice(0);
  73. }
  74. }
  75. /// <summary>
  76. /// 摄像头关闭事件
  77. /// </summary>
  78. /// <param name="sender"></param>
  79. /// <param name="e"></param>
  80. private void RbnTurnOff_Click(object sender, RoutedEventArgs e)
  81. {
  82. gridCamera.Visibility = Visibility.Hidden;
  83. CameraHelper.CloseDevice();
  84. }
  85. #endregion
  86. /// <summary>
  87. /// 录屏事件
  88. /// </summary>
  89. /// <param name="sender"></param>
  90. /// <param name="e"></param>
  91. private void BtnScreenRecording_Click(object sender, RoutedEventArgs e)
  92. {
  93. CountdownWindow win = new CountdownWindow();
  94. win.Topmost = true;
  95. win.Show();
  96. this.Close();
  97. }
  98. /// <summary>
  99. /// 上传事件
  100. /// </summary>
  101. /// <param name="sender"></param>
  102. /// <param name="e"></param>
  103. private void BtnUpload_Click(object sender, RoutedEventArgs e)
  104. {
  105. FileDirectoryWindow fileDirectoryWindow = new FileDirectoryWindow();
  106. fileDirectoryWindow.Show();
  107. }
  108. /// <summary>
  109. /// 关闭事件
  110. /// </summary>
  111. /// <param name="sender"></param>
  112. /// <param name="e"></param>
  113. private void BtnDown_Click(object sender, RoutedEventArgs e)
  114. {
  115. this.Close();
  116. }
  117. /// <summary>
  118. /// 设置 保存事件
  119. /// </summary>
  120. /// <param name="sender"></param>
  121. /// <param name="e"></param>
  122. private void BtnSave_Click(object sender, RoutedEventArgs e)
  123. {
  124. gridMain.Visibility = Visibility.Visible;
  125. gridSetUp.Visibility = Visibility.Collapsed;
  126. }
  127. /// <summary>
  128. /// 设置事件
  129. /// </summary>
  130. /// <param name="sender"></param>
  131. /// <param name="e"></param>
  132. private void BtnSetUp_Click(object sender, RoutedEventArgs e)
  133. {
  134. gridMain.Visibility = Visibility.Collapsed;
  135. gridSetUp.Visibility = Visibility.Visible;
  136. }
  137. /// <summary>
  138. /// 设置 浏览事件
  139. /// </summary>
  140. /// <param name="sender"></param>
  141. /// <param name="e"></param>
  142. private void btnBrowse_Click(object sender, RoutedEventArgs e)
  143. {
  144. string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
  145. Ofd = new System.Windows.Forms.FolderBrowserDialog();
  146. Result = Ofd.ShowDialog();
  147. if (Result == System.Windows.Forms.DialogResult.OK)
  148. {
  149. if (Ofd.SelectedPath != "")
  150. {
  151. txbStoragePath.Text = Ofd.SelectedPath;
  152. //string ApplicationData = ZConfig.dataPath + "fileStorageAddress.txt";
  153. //string temp = ofd.SelectedPath;
  154. //System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
  155. }
  156. }
  157. }
  158. }
  159. }