using Common.system;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace XHWK.WKTool
{
///
/// 主页面
///
public partial class XHMicroLessonSystemWindow : Window
{
#region 字段
///
/// 文件目录窗口
///
//private CountdownWindow FileDirectoryWindows = null;
private FolderBrowserDialog Ofd;
private DialogResult Result;
#endregion
#region 初始化
///
/// 主页面
///
public XHMicroLessonSystemWindow()
{
InitializeComponent();
}
///
/// 初始化
///
public void Initialize()
{
}
#endregion
#region 事件
///
/// 窗体移动
///
///
///
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
DragMove();
}
///
/// 摄像头打开事件
///
///
///
private void RbnOpen_Click(object sender, RoutedEventArgs e)
{
//UCCamera win = new UCCamera();
////win.Topmost = true;
//win.ShowDialog();
gridCamera.Visibility = Visibility.Visible;
CameraHelper.IsDisplay = true;
CameraHelper.SourcePlayer = player;
CameraHelper.UpdateCameraDevices();
if (CameraHelper.CameraDevices.Count > 0)
{
CameraHelper.SetCameraDevice(0);
}
}
///
/// 摄像头关闭事件
///
///
///
private void RbnTurnOff_Click(object sender, RoutedEventArgs e)
{
gridCamera.Visibility = Visibility.Hidden;
CameraHelper.CloseDevice();
}
#endregion
///
/// 录屏事件
///
///
///
private void BtnScreenRecording_Click(object sender, RoutedEventArgs e)
{
CountdownWindow win = new CountdownWindow();
win.Topmost = true;
win.Show();
this.Close();
}
///
/// 上传事件
///
///
///
private void BtnUpload_Click(object sender, RoutedEventArgs e)
{
FileDirectoryWindow fileDirectoryWindow = new FileDirectoryWindow();
fileDirectoryWindow.Show();
}
///
/// 关闭事件
///
///
///
private void BtnDown_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
///
/// 设置 保存事件
///
///
///
private void BtnSave_Click(object sender, RoutedEventArgs e)
{
gridMain.Visibility = Visibility.Visible;
gridSetUp.Visibility = Visibility.Collapsed;
}
///
/// 设置事件
///
///
///
private void BtnSetUp_Click(object sender, RoutedEventArgs e)
{
gridMain.Visibility = Visibility.Collapsed;
gridSetUp.Visibility = Visibility.Visible;
}
///
/// 设置 浏览事件
///
///
///
private void btnBrowse_Click(object sender, RoutedEventArgs e)
{
string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
Ofd = new System.Windows.Forms.FolderBrowserDialog();
Result = Ofd.ShowDialog();
if (Result == System.Windows.Forms.DialogResult.OK)
{
if (Ofd.SelectedPath != "")
{
txbStoragePath.Text = Ofd.SelectedPath;
//string ApplicationData = ZConfig.dataPath + "fileStorageAddress.txt";
//string temp = ofd.SelectedPath;
//System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
}
}
}
}
}