|
@@ -24,6 +24,7 @@ using System.Text;
|
24
|
24
|
using System.Collections.Specialized;
|
25
|
25
|
using XHWK.WKTool.Config;
|
26
|
26
|
using System.Windows.Threading;
|
|
27
|
+using System.Diagnostics;
|
27
|
28
|
|
28
|
29
|
namespace XHWK.WKTool
|
29
|
30
|
{
|
|
@@ -79,6 +80,24 @@ namespace XHWK.WKTool
|
79
|
80
|
/// 计时用
|
80
|
81
|
/// </summary>
|
81
|
82
|
private TimeSpan _timeSpan = new TimeSpan(0, 0, 0, 0, 0);
|
|
83
|
+ #region 上传
|
|
84
|
+ /// <summary>
|
|
85
|
+ /// 视频模型
|
|
86
|
+ /// </summary>
|
|
87
|
+ List<Model_Video> model_VideoList = null;
|
|
88
|
+ /// <summary>
|
|
89
|
+ /// 数据列表
|
|
90
|
+ /// </summary>
|
|
91
|
+ internal FileDirectoryData pageData = new FileDirectoryData();
|
|
92
|
+ /// <summary>
|
|
93
|
+ /// 下标
|
|
94
|
+ /// </summary>
|
|
95
|
+ private int Subscript = 0;
|
|
96
|
+ /// <summary>
|
|
97
|
+ /// 是否是修改状态
|
|
98
|
+ /// </summary>
|
|
99
|
+ private bool IsModify = false;
|
|
100
|
+ #endregion
|
82
|
101
|
#endregion
|
83
|
102
|
|
84
|
103
|
#region 初始化
|
|
@@ -440,17 +459,17 @@ namespace XHWK.WKTool
|
440
|
459
|
Login();
|
441
|
460
|
return;
|
442
|
461
|
}
|
443
|
|
- if (APP.fileDirectoryWindow == null)
|
|
462
|
+ if(gridUpload.Visibility == Visibility.Visible)
|
444
|
463
|
{
|
445
|
|
- APP.fileDirectoryWindow = new FileDirectoryWindow();
|
446
|
|
- //APP.fileDirectoryWindow.Topmost = true;
|
447
|
|
- APP.fileDirectoryWindow.Owner = this;
|
|
464
|
+ gridUpload.Visibility = Visibility.Collapsed;
|
|
465
|
+ GridMain.Visibility = Visibility.Visible;
|
448
|
466
|
}
|
449
|
467
|
else
|
450
|
468
|
{
|
451
|
|
- APP.fileDirectoryWindow.Initialize();
|
|
469
|
+ gridUpload.Visibility = Visibility.Visible;
|
|
470
|
+ GridMain.Visibility = Visibility.Collapsed;
|
|
471
|
+ InitializeUpload();
|
452
|
472
|
}
|
453
|
|
- APP.fileDirectoryWindow.ShowDialog();
|
454
|
473
|
}
|
455
|
474
|
/// <summary>
|
456
|
475
|
/// 关闭事件
|
|
@@ -572,6 +591,12 @@ namespace XHWK.WKTool
|
572
|
591
|
imgPlayerLeft.Visibility = Visibility.Collapsed;
|
573
|
592
|
imgPlayerRightUnder.Visibility = Visibility.Collapsed;
|
574
|
593
|
imgPlayerLeftUnder.Visibility = Visibility.Collapsed;
|
|
594
|
+ if(!txbStoragePath.Content.ToString().Equals(APP.WKData.WkPath))
|
|
595
|
+ {
|
|
596
|
+ //存储文件
|
|
597
|
+ FileToolsCommon.SetConfigValue("VideoSavePath", txbStoragePath.Content.ToString());
|
|
598
|
+ System.Windows.MessageBox.Show("路径已变更,下次创建微课时自动生效!!!");
|
|
599
|
+ }
|
575
|
600
|
}
|
576
|
601
|
/// <summary>
|
577
|
602
|
/// 设置事件
|
|
@@ -614,23 +639,23 @@ namespace XHWK.WKTool
|
614
|
639
|
/// <param name="e"></param>
|
615
|
640
|
private void BtnBrowse_Click(object sender, RoutedEventArgs e)
|
616
|
641
|
{
|
617
|
|
- System.Diagnostics.Process.Start(APP.WKData.WkPath);
|
618
|
|
- //string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
|
619
|
|
- //Ofd = new System.Windows.Forms.FolderBrowserDialog();
|
|
642
|
+ //System.Diagnostics.Process.Start(APP.WKData.WkPath);
|
|
643
|
+ string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
|
|
644
|
+ Ofd = new System.Windows.Forms.FolderBrowserDialog();
|
620
|
645
|
|
621
|
|
- //Result = Ofd.ShowDialog();
|
622
|
|
- //if (Result == System.Windows.Forms.DialogResult.OK)
|
623
|
|
- //{
|
624
|
|
- // if (Ofd.SelectedPath != "")
|
625
|
|
- // {
|
|
646
|
+ Result = Ofd.ShowDialog();
|
|
647
|
+ if (Result == System.Windows.Forms.DialogResult.OK)
|
|
648
|
+ {
|
|
649
|
+ if (Ofd.SelectedPath != "")
|
|
650
|
+ {
|
626
|
651
|
|
627
|
652
|
|
628
|
|
- // //txbStoragePath.Text = Ofd.SelectedPath;
|
629
|
|
- // //string ApplicationData = ZConfig.dataPath + "fileStorageAddress.txt";
|
630
|
|
- // //string temp = ofd.SelectedPath;
|
631
|
|
- // //System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
|
632
|
|
- // }
|
633
|
|
- //}
|
|
653
|
+ txbStoragePath.Content = Ofd.SelectedPath;
|
|
654
|
+ //string ApplicationData = ZConfig.dataPath + "fileStorageAddress.txt";
|
|
655
|
+ //string temp = ofd.SelectedPath;
|
|
656
|
+ //System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
|
|
657
|
+ }
|
|
658
|
+ }
|
634
|
659
|
}
|
635
|
660
|
/// <summary>
|
636
|
661
|
/// 画笔颜色事件 白色
|
|
@@ -2630,15 +2655,481 @@ namespace XHWK.WKTool
|
2630
|
2655
|
imgCanvas.Source = null;
|
2631
|
2656
|
}
|
2632
|
2657
|
|
2633
|
|
- private void Button_Click(object sender, RoutedEventArgs e)
|
|
2658
|
+ #region 上传
|
|
2659
|
+ /// <summary>
|
|
2660
|
+ /// 初始化上传
|
|
2661
|
+ /// </summary>
|
|
2662
|
+ public void InitializeUpload()
|
2634
|
2663
|
{
|
2635
|
|
- //System.Windows.SplashScreen(LoadDialog);
|
2636
|
|
- //Common.system.SplashScreen.Show(typeof(LoadDialog));
|
2637
|
|
- //Thread.Sleep(5000);
|
2638
|
|
- //Common.system.SplashScreen.Close();
|
2639
|
2664
|
APP.myloading.Show();
|
2640
|
|
- Thread.Sleep(1000);
|
|
2665
|
+ MouseNumber = 0;
|
|
2666
|
+ IsModify = false;
|
|
2667
|
+ //加载视频列表
|
|
2668
|
+ LoadingVideoList();
|
|
2669
|
+ int i = 1;
|
|
2670
|
+ bool isColour = true;
|
|
2671
|
+ pageData.menuList.Clear();
|
|
2672
|
+ //显示视频
|
|
2673
|
+ foreach (Model_Video videoinfo in model_VideoList)
|
|
2674
|
+ {
|
|
2675
|
+ //是否已上传
|
|
2676
|
+ //videoinfo.IsUpload;
|
|
2677
|
+ //录制时间
|
|
2678
|
+ //videoinfo.RSTime;
|
|
2679
|
+ //文件大小
|
|
2680
|
+ //videoinfo.VideoSize;
|
|
2681
|
+ //文件缩略图路径
|
|
2682
|
+ //videoinfo.ThumbnailPath;
|
|
2683
|
+ //文件唯一标示 上传事件筛选需要上传的视频
|
|
2684
|
+ //videoinfo.FileGuid;
|
|
2685
|
+ //文件存储路径
|
|
2686
|
+ //videoinfo.VidePath;
|
|
2687
|
+
|
|
2688
|
+ string colour = "#FFFFFF";
|
|
2689
|
+ if (isColour == true)
|
|
2690
|
+ {
|
|
2691
|
+ colour = "#FFFFFF";
|
|
2692
|
+ isColour = false;
|
|
2693
|
+ }
|
|
2694
|
+ else
|
|
2695
|
+ {
|
|
2696
|
+ colour = "#E6F1FF";
|
|
2697
|
+ isColour = true;
|
|
2698
|
+ }
|
|
2699
|
+ string vis = "Visible";
|
|
2700
|
+ string cos = "Collapsed";
|
|
2701
|
+ if (!videoinfo.IsUpload)
|
|
2702
|
+ {
|
|
2703
|
+ vis = "Collapsed";
|
|
2704
|
+ cos = "Visible";
|
|
2705
|
+ }
|
|
2706
|
+ if (i <= 16)
|
|
2707
|
+ {
|
|
2708
|
+ pageData.menuList.Add(new FileDirectoryModel()
|
|
2709
|
+ {
|
|
2710
|
+ SerialNumber = i,
|
|
2711
|
+ VideoName = Common.system.FileToolsCommon.GetIOFileName(videoinfo.VideoPath).Replace(".MP4", "").Replace(".FLV", "").Replace(".AVI", "").Trim(),
|
|
2712
|
+ Name = Common.system.FileToolsCommon.GetIOFileName(videoinfo.VideoPath).Replace(".MP4", "").Replace(".FLV", "").Replace(".AVI", "").Trim(),
|
|
2713
|
+ FilePath = videoinfo.VideoPath.Replace(FileToolsCommon.GetIOFileName(videoinfo.VideoPath), "").Trim(),
|
|
2714
|
+ VideoDuration = 0,
|
|
2715
|
+ VideoSize = videoinfo.VideoSize,
|
|
2716
|
+ VideoTime = videoinfo.RSTime,
|
|
2717
|
+ IsEnabled = false,
|
|
2718
|
+ Path = videoinfo.VideoPath,
|
|
2719
|
+ Colour = colour,
|
|
2720
|
+ Visi = vis,
|
|
2721
|
+ Coll = cos,
|
|
2722
|
+ FileGuid = videoinfo.FileGuid,
|
|
2723
|
+ VideoType = videoinfo.VideoType.ToString()
|
|
2724
|
+ }); ;
|
|
2725
|
+ }
|
|
2726
|
+ i++;
|
|
2727
|
+ }
|
|
2728
|
+ Currpage = 0;
|
|
2729
|
+ PageNum = 0;
|
|
2730
|
+ if (pageData.menuList.Count>0)
|
|
2731
|
+ {
|
|
2732
|
+ Currpage = 1;
|
|
2733
|
+ txbCurrpageTwo.Text = Currpage.ToString();
|
|
2734
|
+ stpUp.Visibility = Visibility.Visible;
|
|
2735
|
+ }
|
|
2736
|
+ else
|
|
2737
|
+ {
|
|
2738
|
+ stpUp.Visibility = Visibility.Hidden;
|
|
2739
|
+ }
|
|
2740
|
+ PageNum = model_VideoList.Count;
|
|
2741
|
+ if (PageNum > 0)
|
|
2742
|
+ {
|
|
2743
|
+ int t = 1;
|
|
2744
|
+ while (PageNum > 16 * t)
|
|
2745
|
+ {
|
|
2746
|
+ t++;
|
|
2747
|
+ }
|
|
2748
|
+ PageNum = t;
|
|
2749
|
+ }
|
|
2750
|
+ else
|
|
2751
|
+ {
|
|
2752
|
+ PageNum = 0;
|
|
2753
|
+ }
|
|
2754
|
+ txbPageNumTwo.Text = PageNum.ToString();
|
2641
|
2755
|
APP.myloading.Hide();
|
|
2756
|
+ DataContext = pageData;
|
|
2757
|
+ }
|
|
2758
|
+ /// <summary>
|
|
2759
|
+ /// 当前页
|
|
2760
|
+ /// </summary>
|
|
2761
|
+ int Currpage = 0;
|
|
2762
|
+ /// <summary>
|
|
2763
|
+ /// 总页码
|
|
2764
|
+ /// </summary>
|
|
2765
|
+ int PageNum = 0;
|
|
2766
|
+ /// <summary>
|
|
2767
|
+ /// 加载视频列表
|
|
2768
|
+ /// </summary>
|
|
2769
|
+ public void LoadingVideoList()
|
|
2770
|
+ {
|
|
2771
|
+ try
|
|
2772
|
+ {
|
|
2773
|
+ model_VideoList = new List<Model_Video>();
|
|
2774
|
+ foreach (Model_WKData Vdata in APP.WKDataList)
|
|
2775
|
+ {
|
|
2776
|
+ if (Vdata.VideoList == null)
|
|
2777
|
+ continue;
|
|
2778
|
+ foreach (Model_Video videoinfo in Vdata.VideoList)
|
|
2779
|
+ {
|
|
2780
|
+ try
|
|
2781
|
+ {
|
|
2782
|
+ if (string.IsNullOrWhiteSpace(videoinfo.VideoPath))
|
|
2783
|
+ {
|
|
2784
|
+ continue;
|
|
2785
|
+ }
|
|
2786
|
+ if (string.IsNullOrWhiteSpace(videoinfo.VideoSize) || videoinfo.VideoSize == "0 MB")
|
|
2787
|
+ {
|
|
2788
|
+ videoinfo.VideoSize = FileToolsCommon.GetFileSizeByMB(videoinfo.VideoPath).ToString() + " MB";
|
|
2789
|
+ }
|
|
2790
|
+ model_VideoList.Add(videoinfo);
|
|
2791
|
+ }
|
|
2792
|
+ catch (Exception ex)
|
|
2793
|
+ {
|
|
2794
|
+ LogHelper.WriteErrLog("【加载视频列表】(LoadingVideoList)" + ex.Message, ex);
|
|
2795
|
+ }
|
|
2796
|
+ }
|
|
2797
|
+ }
|
|
2798
|
+ }
|
|
2799
|
+ catch (Exception ex)
|
|
2800
|
+ {
|
|
2801
|
+ LogHelper.WriteErrLog("【加载视频列表】(LoadingVideoList)" + ex.Message, ex);
|
|
2802
|
+ }
|
|
2803
|
+ }
|
|
2804
|
+ /// <summary>
|
|
2805
|
+ /// 上传
|
|
2806
|
+ /// </summary>
|
|
2807
|
+ /// <param name="sender"></param>
|
|
2808
|
+ /// <param name="e"></param>
|
|
2809
|
+ private void BtnUploads_Click(object sender, RoutedEventArgs e)
|
|
2810
|
+ {
|
|
2811
|
+ pageData.menuList[Subscript].IsEnabled = false;
|
|
2812
|
+ List<System.Windows.Controls.Button> buttons = FindChilds<System.Windows.Controls.Button>(listView1, "btnUpload");
|
|
2813
|
+ for (int i = 0; i < buttons.Count; i++)
|
|
2814
|
+ {
|
|
2815
|
+ if (buttons[i] == sender)
|
|
2816
|
+ {
|
|
2817
|
+ DAL_Upload dAL_Upload = new DAL_Upload();
|
|
2818
|
+
|
|
2819
|
+ if (dAL_Upload.UploadVideo(pageData.menuList[i].FileGuid, out string ErrMessage))
|
|
2820
|
+ {
|
|
2821
|
+ pageData.menuList[i].Visi = "Visible";
|
|
2822
|
+ pageData.menuList[i].Coll = "Collapsed";
|
|
2823
|
+
|
|
2824
|
+ DataContext = pageData;
|
|
2825
|
+
|
|
2826
|
+ System.Windows.MessageBox.Show("视频上传成功!");
|
|
2827
|
+ }
|
|
2828
|
+ else
|
|
2829
|
+ {
|
|
2830
|
+ System.Windows.MessageBox.Show(ErrMessage);
|
|
2831
|
+ }
|
|
2832
|
+
|
|
2833
|
+
|
|
2834
|
+ }
|
|
2835
|
+ }
|
|
2836
|
+ }
|
|
2837
|
+ /// <summary>
|
|
2838
|
+ /// 删除
|
|
2839
|
+ /// </summary>
|
|
2840
|
+ /// <param name="sender"></param>
|
|
2841
|
+ /// <param name="e"></param>
|
|
2842
|
+ private void BtnDelete_Click(object sender, RoutedEventArgs e)
|
|
2843
|
+ {
|
|
2844
|
+
|
|
2845
|
+ pageData.menuList[Subscript].IsEnabled = false;
|
|
2846
|
+ List<System.Windows.Controls.Button> buttons = FindChilds<System.Windows.Controls.Button>(listView1, "btnDelete");
|
|
2847
|
+ for (int i = 0; i < buttons.Count; i++)
|
|
2848
|
+ {
|
|
2849
|
+ if (buttons[i] == sender)
|
|
2850
|
+ {
|
|
2851
|
+
|
|
2852
|
+ //if (APP.W_PromptWindow == null)
|
|
2853
|
+ //{
|
|
2854
|
+ // APP.W_PromptWindow = new PromptWindow();
|
|
2855
|
+ // APP.W_PromptWindow.Owner = this;
|
|
2856
|
+ //}
|
|
2857
|
+ //APP.W_PromptWindow.Initialize(pageData.menuList[i].VideoName);
|
|
2858
|
+ //APP.W_PromptWindow.ShowDialog();
|
|
2859
|
+
|
|
2860
|
+ foreach (Model_WKData wKData in APP.WKDataList)
|
|
2861
|
+ {
|
|
2862
|
+ if (wKData.VideoList == null)
|
|
2863
|
+ continue;
|
|
2864
|
+ if (wKData.VideoList.Exists(x => x.FileGuid == pageData.menuList[i].FileGuid))
|
|
2865
|
+ {
|
|
2866
|
+ try
|
|
2867
|
+ {
|
|
2868
|
+ FileToolsCommon.DeleteFile(wKData.VideoList.Find(x => x.FileGuid == pageData.menuList[i].FileGuid).VideoPath);
|
|
2869
|
+ FileToolsCommon.DeleteFile(wKData.VideoList.Find(x => x.FileGuid == pageData.menuList[i].FileGuid).ThumbnailPath);
|
|
2870
|
+ wKData.VideoList.Remove(wKData.VideoList.Find(x => x.FileGuid == pageData.menuList[i].FileGuid));
|
|
2871
|
+ InitializeUpload();
|
|
2872
|
+ return;
|
|
2873
|
+ }
|
|
2874
|
+ catch (Exception ex)
|
|
2875
|
+ {
|
|
2876
|
+ System.Windows.MessageBox.Show("无法删除视频!" + ex.Message);
|
|
2877
|
+ return;
|
|
2878
|
+ }
|
|
2879
|
+ }
|
|
2880
|
+ }
|
|
2881
|
+ }
|
|
2882
|
+ }
|
|
2883
|
+ }
|
|
2884
|
+ /// <summary>
|
|
2885
|
+ /// 播放
|
|
2886
|
+ /// </summary>
|
|
2887
|
+ /// <param name="sender"></param>
|
|
2888
|
+ /// <param name="e"></param>
|
|
2889
|
+ private void BtnPlay_Click(object sender, RoutedEventArgs e)
|
|
2890
|
+ {
|
|
2891
|
+ pageData.menuList[Subscript].IsEnabled = false;
|
|
2892
|
+ List<System.Windows.Controls.Button> buttons = FindChilds<System.Windows.Controls.Button>(listView1, "btnPlay");
|
|
2893
|
+ for (int i = 0; i < buttons.Count; i++)
|
|
2894
|
+ {
|
|
2895
|
+ if (buttons[i] == sender)
|
|
2896
|
+ {
|
|
2897
|
+ try
|
|
2898
|
+ {
|
|
2899
|
+ ProcessStartInfo psi = new ProcessStartInfo(pageData.menuList[i].Path);
|
|
2900
|
+ Process pro = new Process
|
|
2901
|
+ {
|
|
2902
|
+ StartInfo = psi
|
|
2903
|
+ };
|
|
2904
|
+ pro.Start();
|
|
2905
|
+ }
|
|
2906
|
+ catch (Exception ex)
|
|
2907
|
+ {
|
|
2908
|
+ LogHelper.WriteErrLog("FileDirectoryWindow【BtnPlay_Click】" + ex.Message, ex);
|
|
2909
|
+ System.Windows.MessageBox.Show(ex.Message);
|
|
2910
|
+ return;
|
|
2911
|
+ }
|
|
2912
|
+ }
|
|
2913
|
+ }
|
|
2914
|
+ }
|
|
2915
|
+ /// <summary>
|
|
2916
|
+ /// 搜索集合匹配的索引
|
|
2917
|
+ /// </summary>
|
|
2918
|
+ /// <typeparam name="T"></typeparam>
|
|
2919
|
+ /// <param name="parent"></param>
|
|
2920
|
+ /// <param name="childName"></param>
|
|
2921
|
+ /// <returns></returns>
|
|
2922
|
+ public static List<T> FindChilds<T>(DependencyObject parent, string childName)
|
|
2923
|
+ where T : DependencyObject
|
|
2924
|
+ {
|
|
2925
|
+ List<T> list = new List<T>();
|
|
2926
|
+ if (parent == null)
|
|
2927
|
+ {
|
|
2928
|
+ return list;
|
|
2929
|
+ }
|
|
2930
|
+
|
|
2931
|
+ int childrenCount = VisualTreeHelper.GetChildrenCount(parent);
|
|
2932
|
+ for (int i = 0; i < childrenCount; i++)
|
|
2933
|
+ {
|
|
2934
|
+ DependencyObject child = VisualTreeHelper.GetChild(parent, i);
|
|
2935
|
+ // 如果子控件不是需查找的控件类型
|
|
2936
|
+ T childType = child as T;
|
|
2937
|
+ if (childType == null)
|
|
2938
|
+ {
|
|
2939
|
+ // 在下一级控件中递归查找
|
|
2940
|
+ List<T> findChildList = FindChilds<T>(child, childName);
|
|
2941
|
+ for (int j = 0; j < findChildList.Count; j++)
|
|
2942
|
+ {
|
|
2943
|
+ }
|
|
2944
|
+ list.AddRange(FindChilds<T>(child, childName));
|
|
2945
|
+ }
|
|
2946
|
+ else if (!string.IsNullOrEmpty(childName))
|
|
2947
|
+ {
|
|
2948
|
+ FrameworkElement frameworkElement = child as FrameworkElement;
|
|
2949
|
+ // 如果控件名称符合参数条件
|
|
2950
|
+ if (frameworkElement != null && frameworkElement.Name == childName)
|
|
2951
|
+ {
|
|
2952
|
+ list.Add((T)child);
|
|
2953
|
+ }
|
|
2954
|
+ }
|
|
2955
|
+ else
|
|
2956
|
+ {
|
|
2957
|
+ // 查找到了控件
|
|
2958
|
+ list.Add((T)child);
|
|
2959
|
+ }
|
|
2960
|
+ }
|
|
2961
|
+
|
|
2962
|
+ return list;
|
|
2963
|
+ }
|
|
2964
|
+ /// <summary>
|
|
2965
|
+ /// 修改
|
|
2966
|
+ /// </summary>
|
|
2967
|
+ /// <param name="sender"></param>
|
|
2968
|
+ /// <param name="e"></param>
|
|
2969
|
+ private void BtnModify_Click(object sender, RoutedEventArgs e)
|
|
2970
|
+ {
|
|
2971
|
+ if (IsModify)
|
|
2972
|
+ {
|
|
2973
|
+ pageData.menuList[Subscript].IsEnabled = false;
|
|
2974
|
+ }
|
|
2975
|
+ List<System.Windows.Controls.Button> buttons = FindChilds<System.Windows.Controls.Button>(listView1, "btnModify");
|
|
2976
|
+ for (int i = 0; i < buttons.Count; i++)
|
|
2977
|
+ {
|
|
2978
|
+ if (buttons[i] == sender)
|
|
2979
|
+ {
|
|
2980
|
+ pageData.menuList[i].IsEnabled = true;
|
|
2981
|
+ Subscript = i;
|
|
2982
|
+ IsModify = true;
|
|
2983
|
+ }
|
|
2984
|
+ }
|
2642
|
2985
|
}
|
|
2986
|
+ int MouseNumber = 0;
|
|
2987
|
+ /// <summary>
|
|
2988
|
+ /// 上传 上页
|
|
2989
|
+ /// </summary>
|
|
2990
|
+ /// <param name="sender"></param>
|
|
2991
|
+ /// <param name="e"></param>
|
|
2992
|
+ private void BtnLastPage_Click(object sender, RoutedEventArgs e)
|
|
2993
|
+ {
|
|
2994
|
+ if (Currpage >1)
|
|
2995
|
+ {
|
|
2996
|
+ Currpage -= 1;
|
|
2997
|
+ txbCurrpageTwo.Text = Currpage.ToString();
|
|
2998
|
+ int i = 1;
|
|
2999
|
+ bool isColour = true;
|
|
3000
|
+ pageData.menuList.Clear();
|
|
3001
|
+ //显示视频
|
|
3002
|
+ foreach (Model_Video videoinfo in model_VideoList)
|
|
3003
|
+ {
|
|
3004
|
+ //是否已上传
|
|
3005
|
+ //videoinfo.IsUpload;
|
|
3006
|
+ //录制时间
|
|
3007
|
+ //videoinfo.RSTime;
|
|
3008
|
+ //文件大小
|
|
3009
|
+ //videoinfo.VideoSize;
|
|
3010
|
+ //文件缩略图路径
|
|
3011
|
+ //videoinfo.ThumbnailPath;
|
|
3012
|
+ //文件唯一标示 上传事件筛选需要上传的视频
|
|
3013
|
+ //videoinfo.FileGuid;
|
|
3014
|
+ //文件存储路径
|
|
3015
|
+ //videoinfo.VidePath;
|
|
3016
|
+
|
|
3017
|
+ string colour = "#FFFFFF";
|
|
3018
|
+ if (isColour == true)
|
|
3019
|
+ {
|
|
3020
|
+ colour = "#FFFFFF";
|
|
3021
|
+ isColour = false;
|
|
3022
|
+ }
|
|
3023
|
+ else
|
|
3024
|
+ {
|
|
3025
|
+ colour = "#E6F1FF";
|
|
3026
|
+ isColour = true;
|
|
3027
|
+ }
|
|
3028
|
+ string vis = "Visible";
|
|
3029
|
+ string cos = "Collapsed";
|
|
3030
|
+ if (!videoinfo.IsUpload)
|
|
3031
|
+ {
|
|
3032
|
+ vis = "Collapsed";
|
|
3033
|
+ cos = "Visible";
|
|
3034
|
+ }
|
|
3035
|
+ if (i <= Currpage * 16 && i >= (Currpage - 1) * 16)
|
|
3036
|
+ {
|
|
3037
|
+ pageData.menuList.Add(new FileDirectoryModel()
|
|
3038
|
+ {
|
|
3039
|
+ SerialNumber = i,
|
|
3040
|
+ VideoName = Common.system.FileToolsCommon.GetIOFileName(videoinfo.VideoPath).Replace(".MP4", "").Replace(".FLV", "").Replace(".AVI", "").Trim(),
|
|
3041
|
+ Name = Common.system.FileToolsCommon.GetIOFileName(videoinfo.VideoPath).Replace(".MP4", "").Replace(".FLV", "").Replace(".AVI", "").Trim(),
|
|
3042
|
+ FilePath = videoinfo.VideoPath.Replace(FileToolsCommon.GetIOFileName(videoinfo.VideoPath), "").Trim(),
|
|
3043
|
+ VideoDuration = 0,
|
|
3044
|
+ VideoSize = videoinfo.VideoSize,
|
|
3045
|
+ VideoTime = videoinfo.RSTime,
|
|
3046
|
+ IsEnabled = false,
|
|
3047
|
+ Path = videoinfo.VideoPath,
|
|
3048
|
+ Colour = colour,
|
|
3049
|
+ Visi = vis,
|
|
3050
|
+ Coll = cos,
|
|
3051
|
+ FileGuid = videoinfo.FileGuid,
|
|
3052
|
+ VideoType = videoinfo.VideoType.ToString()
|
|
3053
|
+ }); ;
|
|
3054
|
+ }
|
|
3055
|
+ i++;
|
|
3056
|
+ }
|
|
3057
|
+ APP.myloading.Hide();
|
|
3058
|
+ }
|
|
3059
|
+ }
|
|
3060
|
+ /// <summary>
|
|
3061
|
+ /// 上传 下页
|
|
3062
|
+ /// </summary>
|
|
3063
|
+ /// <param name="sender"></param>
|
|
3064
|
+ /// <param name="e"></param>
|
|
3065
|
+ private void BtnNextPage_Click(object sender, RoutedEventArgs e)
|
|
3066
|
+ {
|
|
3067
|
+ if(Currpage< PageNum)
|
|
3068
|
+ {
|
|
3069
|
+ Currpage += 1;
|
|
3070
|
+ txbCurrpageTwo.Text = Currpage.ToString();
|
|
3071
|
+ int i = 1;
|
|
3072
|
+ bool isColour = true;
|
|
3073
|
+ pageData.menuList.Clear();
|
|
3074
|
+ //显示视频
|
|
3075
|
+ foreach (Model_Video videoinfo in model_VideoList)
|
|
3076
|
+ {
|
|
3077
|
+ //是否已上传
|
|
3078
|
+ //videoinfo.IsUpload;
|
|
3079
|
+ //录制时间
|
|
3080
|
+ //videoinfo.RSTime;
|
|
3081
|
+ //文件大小
|
|
3082
|
+ //videoinfo.VideoSize;
|
|
3083
|
+ //文件缩略图路径
|
|
3084
|
+ //videoinfo.ThumbnailPath;
|
|
3085
|
+ //文件唯一标示 上传事件筛选需要上传的视频
|
|
3086
|
+ //videoinfo.FileGuid;
|
|
3087
|
+ //文件存储路径
|
|
3088
|
+ //videoinfo.VidePath;
|
|
3089
|
+
|
|
3090
|
+ string colour = "#FFFFFF";
|
|
3091
|
+ if (isColour == true)
|
|
3092
|
+ {
|
|
3093
|
+ colour = "#FFFFFF";
|
|
3094
|
+ isColour = false;
|
|
3095
|
+ }
|
|
3096
|
+ else
|
|
3097
|
+ {
|
|
3098
|
+ colour = "#E6F1FF";
|
|
3099
|
+ isColour = true;
|
|
3100
|
+ }
|
|
3101
|
+ string vis = "Visible";
|
|
3102
|
+ string cos = "Collapsed";
|
|
3103
|
+ if (!videoinfo.IsUpload)
|
|
3104
|
+ {
|
|
3105
|
+ vis = "Collapsed";
|
|
3106
|
+ cos = "Visible";
|
|
3107
|
+ }
|
|
3108
|
+ if (i <= Currpage*16&&i>(Currpage-1)*16)
|
|
3109
|
+ {
|
|
3110
|
+ pageData.menuList.Add(new FileDirectoryModel()
|
|
3111
|
+ {
|
|
3112
|
+ SerialNumber = i,
|
|
3113
|
+ VideoName = Common.system.FileToolsCommon.GetIOFileName(videoinfo.VideoPath).Replace(".MP4", "").Replace(".FLV", "").Replace(".AVI", "").Trim(),
|
|
3114
|
+ Name = Common.system.FileToolsCommon.GetIOFileName(videoinfo.VideoPath).Replace(".MP4", "").Replace(".FLV", "").Replace(".AVI", "").Trim(),
|
|
3115
|
+ FilePath = videoinfo.VideoPath.Replace(FileToolsCommon.GetIOFileName(videoinfo.VideoPath), "").Trim(),
|
|
3116
|
+ VideoDuration = 0,
|
|
3117
|
+ VideoSize = videoinfo.VideoSize,
|
|
3118
|
+ VideoTime = videoinfo.RSTime,
|
|
3119
|
+ IsEnabled = false,
|
|
3120
|
+ Path = videoinfo.VideoPath,
|
|
3121
|
+ Colour = colour,
|
|
3122
|
+ Visi = vis,
|
|
3123
|
+ Coll = cos,
|
|
3124
|
+ FileGuid = videoinfo.FileGuid,
|
|
3125
|
+ VideoType = videoinfo.VideoType.ToString()
|
|
3126
|
+ }); ;
|
|
3127
|
+ }
|
|
3128
|
+ i++;
|
|
3129
|
+ }
|
|
3130
|
+ APP.myloading.Hide();
|
|
3131
|
+ }
|
|
3132
|
+ }
|
|
3133
|
+ #endregion
|
2643
|
3134
|
}
|
2644
|
3135
|
}
|