using Org.BouncyCastle.Asn1.Crmf;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Input;
using XHWK.Model;
namespace XHWK.WKTool
{
///
/// 文件目录
///
public partial class FileDirectoryWindow : Window
{
///
/// 视频模型
///
List model_VideoList =null;
internal FileDirectoryData pageData = new FileDirectoryData();
///
/// 文件目录
///
public FileDirectoryWindow()
{
InitializeComponent();
Initialize();
}
///
/// 初始化
///
public void Initialize()
{
//加载视频列表
LoadingVideoList();
int i = 1;
//显示视频
foreach (Model_Video videoinfo in model_VideoList)
{
//是否已上传
//videoinfo.IsUpload;
//录制时间
//videoinfo.RSTime;
//文件大小
//videoinfo.VideoSize;
//文件缩略图路径
//videoinfo.ThumbnailPath;
//文件唯一标示 上传事件筛选需要上传的视频
//videoinfo.FileGuid;
//文件存储路径
//videoinfo.VidePath;
pageData.menuList.Add(new FileDirectoryModel()
{
SerialNumber = i,
VideoName = Common.system.FileToolsCommon.GetIOFileName( videoinfo.VidePath),
VideoDuration = 0,
VideoSize = videoinfo.VideoSize,
VideoTime = videoinfo.RSTime,
});
i++;
}
DataContext = pageData;
}
///
/// 加载视频列表
///
public void LoadingVideoList()
{
model_VideoList = new List();
foreach(Model_WKData Vdata in APP.WKDataList)
{
if (Vdata.VideoList == null)
continue;
foreach(Model_Video videoinfo in Vdata.VideoList)
{
model_VideoList.Add(videoinfo);
}
}
}
///
/// 关闭
///
///
///
private void btnDown_Click(object sender, RoutedEventArgs e)
{
this.Hide();
}
///
/// 窗口移动
///
///
///
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
DragMove();
}
}
public class FileDirectoryData : NotifyModel
{
public ObservableCollection menuList { get; set; }
public FileDirectoryData()
{
menuList = new ObservableCollection();
}
}
public class FileDirectoryModel : NotifyModel
{
private int _serialNumber;
///
/// 序号
///
public int SerialNumber
{
get => _serialNumber;
set
{
_serialNumber = value;
OnPropertyChanged("SerialNumber");
}
}
private string _videoName;
///
/// 视频名称
///
public string VideoName
{
get => _videoName;
set
{
_videoName = value;
OnPropertyChanged("VideoName");
}
}
private int _videoDuration;
///
/// 视频时长
///
public int VideoDuration
{
get => _videoDuration;
set
{
_videoDuration = value;
OnPropertyChanged("VideoDuration");
}
}
private string _videoSize;
///
/// 视频大小
///
public string VideoSize
{
get => _videoSize;
set
{
_videoSize = value;
OnPropertyChanged("VideoSize");
}
}
private string _videoTime;
///
/// 日期
///
public string VideoTime
{
get => _videoTime;
set
{
_videoTime = value;
OnPropertyChanged("VideoTime");
}
}
private string _colour;
///
/// 颜色
///
public string Colour
{
get => _colour;
set
{
_colour = value;
OnPropertyChanged("Colour");
}
}
}
}