ソースを参照

Merge remote-tracking branch 'origin/zhangxueyang' into zyy

tags/录制修改前
耀 4年前
コミット
537d4a064c

+ 1
- 1
XHWK.WKTool/PracticeWindow.xaml ファイルの表示

@@ -14,6 +14,6 @@
14 14
     WindowStyle="None">
15 15
     <Grid>
16 16
         <Image x:Name="imgCanvas"/>
17
-        <InkCanvas Grid.Row="0" x:Name="blackboard_canvas" Background="Transparent" Visibility="Visible" Grid.ColumnSpan="2" MouseDown="blackboard_canvas_MouseDown" MouseMove="blackboard_canvas_MouseMove" Width="{Binding ElementName=imgMeasure, Path=ActualWidth}" Height="{Binding ElementName=imgMeasure, Path=ActualHeight}" EditingMode="None" Strokes="{Binding InkStrokes, Mode=TwoWay}" PreviewMouseLeftButtonUp="blackboard_canvas_PreviewMouseLeftButtonUp" />
17
+        <InkCanvas Grid.Row="0" x:Name="blackboard_canvas" PreviewMouseRightButtonDown="blackboard_canvas_PreviewMouseRightButtonDown" Background="Transparent" Visibility="Visible" Grid.ColumnSpan="2"/>
18 18
     </Grid>
19 19
 </Window>

+ 43
- 0
XHWK.WKTool/PracticeWindow.xaml.cs ファイルの表示

@@ -347,6 +347,49 @@ namespace XHWK.WKTool
347 347
             StrokeRound = null;
348 348
             StrokeRectangle = null;
349 349
         }
350
+        /// <summary>
351
+        /// 鼠标右键
352
+        /// </summary>
353
+        /// <param name="sender"></param>
354
+        /// <param name="e"></param>
355
+        private void Window_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
356
+        {
357
+            if (APP.W_ScreenRecordingToolbarWindow.flg==10)
358
+            {
359
+                APP.W_ScreenRecordingToolbarWindow.flg = 0;
360
+            }
361
+            else
362
+            {
363
+                APP.W_ScreenRecordingToolbarWindow.flg = 1;
364
+            }
365
+            this.Hide();
366
+        }
367
+
368
+        private void blackboard_canvas_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
369
+        {
370
+            if (APP.W_ScreenRecordingToolbarWindow.flg == 10)
371
+            {
372
+                APP.W_ScreenRecordingToolbarWindow.flg = 0;
373
+            }
374
+            else
375
+            {
376
+                APP.W_ScreenRecordingToolbarWindow.flg = 1;
377
+            }
378
+            this.Hide();
379
+        }
380
+
381
+        private void blackboard_canvas_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
382
+        {
383
+            if (APP.W_ScreenRecordingToolbarWindow.flg == 10)
384
+            {
385
+                APP.W_ScreenRecordingToolbarWindow.flg = 0;
386
+            }
387
+            else
388
+            {
389
+                APP.W_ScreenRecordingToolbarWindow.flg = 1;
390
+            }
391
+            this.Hide();
392
+        }
350 393
     }
351 394
 }
352 395
 

+ 9
- 9
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml ファイルの表示

@@ -74,24 +74,24 @@
74 74
 
75 75
             <Image Grid.Row="1"  Source="./Images/Toobar0.png"/>
76 76
             <Button Grid.Row="1" x:Name="BtnRecordingScreen" HorizontalAlignment="Left"  Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="46,0,15,0" Click="BtnRecordingScreen_Click">
77
-                <Image x:Name="ImgRecordingScreen" Source="./Images/Toobar25.png"/>
77
+                <Image x:Name="ImgRecordingScreen" Source="./Images/Toobar26.png"/>
78 78
             </Button>
79
-            <TextBlock Grid.Row="1" x:Name="txbTime" Text="00:00" FontSize="20" Foreground="#FFFFFF" Margin="39,80,0,0" Visibility="Hidden"/>
79
+            <TextBlock Grid.Row="1" x:Name="txbTime" Text="00:00" FontSize="20" Foreground="#FFFFFF" Margin="43,80,0,0" Visibility="Hidden"/>
80 80
             <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,15,0">
81 81
                 <!--<Button x:Name="BtnRecordingScreen"  Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,15,0" Click="BtnRecordingScreen_Click">
82 82
                     <Image x:Name="ImgRecordingScreen" Source="./Images/Toobar25.png"/>
83 83
                 </Button>-->
84 84
                 <Button x:Name="BtnStopRecordingScreen" Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,20,0" Click="BtnStopRecordingScreen_Click">
85
-                    <Image x:Name="ImgEndRecordingScreen" Source="./Images/Toobar14.png"/>
85
+                    <Image x:Name="ImgEndRecordingScreen" Source="./Images/Toobar15.png"/>
86 86
                 </Button>
87
-                <Button  Cursor="Hand" x:Name="btnBlackPenOne" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,20,0" Click="BtnBlackPen_Click">
88
-                    <Image Source="./Images/Toobar27.png"/>
87
+                <Button  Cursor="Hand" x:Name="btnBlackPenOne" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,20,0" Click="BtnBrush_Click">
88
+                    <Image x:Name="imgBlackPenOne" Source="./Images/31.png"/>
89 89
                 </Button>
90
-                <Button  Cursor="Hand" x:Name="btnBlackPenTwo" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,20,0" Click="BtnBlackPen_Click">
91
-                    <Image Source="./Images/Toobar28.png"/>
90
+                <Button  Cursor="Hand" x:Name="btnBlackPenTwo" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,20,0" Click="BtnBlackPenTwo_Click">
91
+                    <Image x:Name="imgBlackPenTwo" Source="./Images/31.png"/>
92 92
                 </Button>
93
-                <Button  Cursor="Hand" x:Name="btnBlackPen" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,20,0" Click="BtnBlackPen_Click">
94
-                    <Image Source="./Images/Toobar29.png"/>
93
+                <Button  Cursor="Hand" x:Name="btnReturn" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="0,0,20,0" Click="BtnReturn_Click">
94
+                    <Image x:Name="imgReturn" Source="./Images/Toobar29.png"/>
95 95
                 </Button>
96 96
             </StackPanel>
97 97
         </Grid>

+ 181
- 21
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs ファイルの表示

@@ -58,6 +58,10 @@ namespace XHWK.WKTool
58 58
         private TimeSpan _timeSpan = new TimeSpan(0, 0, 0, 0, 0);
59 59
 
60 60
         KeyboardHookCommon k_hook;
61
+        /// <summary>
62
+        /// 🖊状态 0红色 1蓝色 10红色批注内 11蓝色批注内
63
+        /// </summary>
64
+       public int flg = 0;
61 65
         #endregion
62 66
 
63 67
         #region 初始化
@@ -87,7 +91,17 @@ namespace XHWK.WKTool
87 91
             gridToolbar.Visibility = Visibility.Hidden;
88 92
             gridColour.Visibility = Visibility.Hidden;
89 93
             gridThickness.Visibility = Visibility.Hidden;
90
-            ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar26.png"));
94
+
95
+            ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar26.png"));//大圆圈三角形
96
+            ImgEndRecordingScreen.Source= new BitmapImage(new Uri("pack://application:,,,/Images/Toobar15.png"));
97
+            BtnStopRecordingScreen.IsEnabled = false; //停止录制按钮不点击
98
+            imgBlackPenOne.Source = new BitmapImage(new Uri("pack://application:,,,/Images/31.png"));
99
+            btnBlackPenOne.IsEnabled = false;//蓝笔不可点击
100
+            imgBlackPenTwo.Source = new BitmapImage(new Uri("pack://application:,,,/Images/31.png"));
101
+            btnBlackPenTwo.IsEnabled = false;//红笔不可点击
102
+            imgReturn.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar29.png"));
103
+            btnReturn.IsEnabled = true;//返回主界面可点击
104
+            txbTime.Visibility = Visibility.Hidden;//时间不显示
91 105
             if (t == null)
92 106
             {
93 107
                 t = new DispatcherTimer();
@@ -114,6 +128,7 @@ namespace XHWK.WKTool
114 128
                 //结束
115 129
                 BtnStopRecordingScreen_Click(null, null);
116 130
             }
131
+
117 132
         }
118 133
         #endregion
119 134
 
@@ -186,9 +201,9 @@ namespace XHWK.WKTool
186 201
             FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "tempsr/");
187 202
             VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录屏." + ((Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"))).ToString();
188 203
             int num = 1;
189
-            while(FileToolsCommon.IsExistFile(VideoSavePathName))
204
+            while (FileToolsCommon.IsExistFile(VideoSavePathName))
190 205
             {
191
-                VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录屏_"+ num + "." + ((Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"))).ToString();
206
+                VideoSavePathName = APP.WKData.WkPath + APP.WKData.WkName + "_录屏_" + num + "." + ((Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"))).ToString();
192 207
                 num++;
193 208
             }
194 209
         }
@@ -226,8 +241,17 @@ namespace XHWK.WKTool
226 241
                 //APP.W_CountdownWindow.Show();
227 242
                 //#endregion
228 243
 
229
-                ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar25.png"));
230
-                txbTime.Visibility = Visibility.Visible;
244
+
245
+                ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar25.png"));//播放状态
246
+                ImgEndRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar14.png"));
247
+                BtnStopRecordingScreen.IsEnabled = true; //停止录制按钮可点击
248
+                imgBlackPenOne.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar27.png"));
249
+                btnBlackPenOne.IsEnabled = true;//蓝笔可点击
250
+                imgBlackPenTwo.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar28.png"));
251
+                btnBlackPenTwo.IsEnabled = true;//红笔可点击
252
+                imgReturn.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar30.png"));
253
+                btnReturn.IsEnabled = false;//返回主界面不可点击
254
+                txbTime.Visibility = Visibility.Visible;//时间显示
231 255
                 try
232 256
                 {
233 257
                     if (APP.W_CountdownWindow == null)
@@ -263,7 +287,14 @@ namespace XHWK.WKTool
263 287
             {
264 288
                 TimeOut();
265 289
                 IsSuspend = true;
266
-                ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/microLessonSystem_14.png"));
290
+                ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar26.png"));//大圆圈三角形
291
+                ImgEndRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar15.png"));
292
+                BtnStopRecordingScreen.IsEnabled = false; //停止录制按钮不点击
293
+                imgBlackPenOne.Source = new BitmapImage(new Uri("pack://application:,,,/Images/31.png"));
294
+                btnBlackPenOne.IsEnabled = false;//蓝笔不可点击
295
+                imgBlackPenTwo.Source = new BitmapImage(new Uri("pack://application:,,,/Images/31.png"));
296
+                btnBlackPenTwo.IsEnabled = false;//红笔不可点击
297
+                txbTime.Visibility = Visibility.Hidden;//时间不显示
267 298
                 #region 2秒内不可点击
268 299
                 new Thread(new ThreadStart(new Action(() =>
269 300
                 {
@@ -275,6 +306,7 @@ namespace XHWK.WKTool
275 306
                     Thread.Sleep(2000);
276 307
                     Dispatcher.Invoke(() =>
277 308
                     {
309
+                        ImgEndRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar14.png"));
278 310
                         BtnRecordingScreen.IsEnabled = true;
279 311
                         BtnStopRecordingScreen.IsEnabled = true;
280 312
                     });
@@ -300,9 +332,9 @@ namespace XHWK.WKTool
300 332
             k_hook.Stop();
301 333
             IsSuspend = true;
302 334
             txbTime.Text = "00:00";
335
+            txbTime.Visibility = Visibility.Hidden;
303 336
             End();
304
-            ImgRecordingScreen.Source = new BitmapImage(new Uri("pack://application:,,,/Images/Toobar25.png"));
305
-            if (gridToolbar.Visibility==Visibility.Visible)
337
+            if (gridToolbar.Visibility == Visibility.Visible)
306 338
             {
307 339
                 gridToolbar.Visibility = Visibility.Hidden;
308 340
                 gridColour.Visibility = Visibility.Hidden;
@@ -390,15 +422,21 @@ namespace XHWK.WKTool
390 422
                 Directory.CreateDirectory(tempPath);
391 423
             }
392 424
             string imagePath = Path.Combine(tempPath, time + ".jpg");
393
-            //ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), imagePath);
394
-            if (gridToolbar.Visibility == Visibility.Visible)
395
-            {
396
-                gridToolbar.Visibility = Visibility.Hidden;
397
-            }
398
-            else
425
+            ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), imagePath, true, out BitmapImage bitmap);
426
+
427
+            try
399 428
             {
400
-                gridToolbar.Visibility = Visibility.Visible;
401
-                try
429
+                if (flg == 11)
430
+                {
431
+                    flg = 1;
432
+                    APP.W_PracticeWindow.Hide();
433
+                }
434
+                else if(flg==10)
435
+                {
436
+                    APP.W_PracticeWindow.Blue();
437
+                    flg = 11;
438
+                }
439
+                else
402 440
                 {
403 441
                     if (APP.W_PracticeWindow == null)
404 442
                     {
@@ -411,15 +449,18 @@ namespace XHWK.WKTool
411 449
                         //practiceWin.Owner = this;
412 450
                     }
413 451
                     APP.W_PracticeWindow.Initialize(imagePath);
452
+                    flg = 11;
453
+                    APP.W_PracticeWindow.Blue();
414 454
                     APP.W_PracticeWindow.Show();
415 455
                 }
416
-                catch (Exception ex)
417
-                {
418
-                    LogHelper.WriteErrLog("【批注(PracticeWindow)" + ex.Message, ex);
419
-                }
420 456
             }
457
+            catch (Exception ex)
458
+            {
459
+                LogHelper.WriteErrLog("【批注(PracticeWindow)" + ex.Message, ex);
460
+            }
461
+
421 462
             //imgCanvas.Source = new BitmapImage(new Uri(imagePath));
422
-         
463
+
423 464
         }
424 465
         /// <summary>
425 466
         /// 屏幕宽
@@ -627,5 +668,124 @@ namespace XHWK.WKTool
627 668
         {
628 669
             DragMove();
629 670
         }
671
+        /// <summary>
672
+        /// 红笔
673
+        /// </summary>
674
+        /// <param name="sender"></param> 
675
+        /// <param name="e"></param>
676
+        private void BtnBlackPenTwo_Click(object sender, RoutedEventArgs e)
677
+        {
678
+            string time = GetTimeStamp();
679
+            string tempPath = AppDomain.CurrentDomain.BaseDirectory + "temp\\";
680
+            if (!Directory.Exists(tempPath))
681
+            {
682
+                Directory.CreateDirectory(tempPath);
683
+            }
684
+            string imagePath = Path.Combine(tempPath, time + ".jpg");
685
+            ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), imagePath, true, out BitmapImage bitmap);
686
+
687
+            try
688
+            {
689
+                if (flg == 10)
690
+                {
691
+                    flg = 0;
692
+                    APP.W_PracticeWindow.Hide();
693
+                }
694
+                else if(flg==11)
695
+                {
696
+                    flg = 10;
697
+                    APP.W_PracticeWindow.Red();
698
+                }
699
+                else
700
+                {
701
+                    if (APP.W_PracticeWindow == null)
702
+                    {
703
+                        APP.W_PracticeWindow = new PracticeWindow();
704
+                        //APP.W_PracticeWindow.Topmost = true;
705
+                        APP.W_PracticeWindow.Width = pwidth;
706
+                        APP.W_PracticeWindow.Height = pHeight;
707
+                        APP.W_PracticeWindow.Left = 0;
708
+                        APP.W_PracticeWindow.Top = 0;
709
+                        //practiceWin.Owner = this;
710
+                    }
711
+                    APP.W_PracticeWindow.Initialize(imagePath);
712
+                    flg = 10;
713
+                    APP.W_PracticeWindow.Red();
714
+                    APP.W_PracticeWindow.Show();
715
+                }
716
+            }
717
+            catch (Exception ex)
718
+            {
719
+                LogHelper.WriteErrLog("【批注(PracticeWindow)" + ex.Message, ex);
720
+            }
721
+        }
722
+        /// <summary>
723
+        /// 鼠标右键按下事件
724
+        /// </summary>
725
+        /// <param name="sender"></param>
726
+        /// <param name="e"></param>
727
+        private void RightButtonDown()
728
+        {
729
+            if (flg > 9)
730
+            {
731
+                APP.W_PracticeWindow.Hide();
732
+            }
733
+            else
734
+            {
735
+                string time = GetTimeStamp();
736
+                string tempPath = AppDomain.CurrentDomain.BaseDirectory + "temp\\";
737
+                if (!Directory.Exists(tempPath))
738
+                {
739
+                    Directory.CreateDirectory(tempPath);
740
+                }
741
+                string imagePath = Path.Combine(tempPath, time + ".jpg");
742
+                ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), imagePath, true, out BitmapImage bitmap);
743
+
744
+                try
745
+                {
746
+                    if (APP.W_PracticeWindow == null)
747
+                    {
748
+                        APP.W_PracticeWindow = new PracticeWindow();
749
+                        //APP.W_PracticeWindow.Topmost = true;
750
+                        APP.W_PracticeWindow.Width = pwidth;
751
+                        APP.W_PracticeWindow.Height = pHeight;
752
+                        APP.W_PracticeWindow.Left = 0;
753
+                        APP.W_PracticeWindow.Top = 0;
754
+                        //practiceWin.Owner = this;
755
+                    }
756
+                    APP.W_PracticeWindow.Initialize(imagePath);
757
+
758
+                    if (flg == 0)
759
+                    {
760
+                        flg = 10;
761
+                        APP.W_PracticeWindow.Red();
762
+                    }
763
+                    else
764
+                    {
765
+                        flg = 11;
766
+                        APP.W_PracticeWindow.Blue();
767
+                    }
768
+                    APP.W_PracticeWindow.Show();
769
+                }
770
+                catch (Exception ex)
771
+                {
772
+                    LogHelper.WriteErrLog("【批注(PracticeWindow)" + ex.Message, ex);
773
+                }
774
+            }
775
+        }
776
+        /// <summary>
777
+        /// 返回主界面
778
+        /// </summary>
779
+        /// <param name="sender"></param>
780
+        /// <param name="e"></param>
781
+        private void BtnReturn_Click(object sender, RoutedEventArgs e)
782
+        {
783
+            if (APP.W_XHMicroLessonSystemWindow == null)
784
+            {
785
+                APP.W_XHMicroLessonSystemWindow = new XHMicroLessonSystemWindow();
786
+            }
787
+            APP.W_XHMicroLessonSystemWindow.Show();
788
+            this.Hide();
789
+        }
630 790
     }
631 791
 }

+ 216
- 6
XHWK.WKTool/XHMicroLessonSystemWindow.xaml ファイルの表示

@@ -22,6 +22,114 @@
22 22
             </Border.Effect>
23 23
         </Border>
24 24
     </Grid>-->
25
+    <Window.Resources>
26
+        <!--  ListBox容器样式  -->
27
+        <Style x:Key="ListBoxItemContainerStyle" TargetType="{x:Type ListBoxItem}">
28
+            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
29
+            <Setter Property="HorizontalAlignment" Value="Stretch" />
30
+            <Setter Property="Template">
31
+                <Setter.Value>
32
+                    <ControlTemplate TargetType="{x:Type ListBoxItem}">
33
+                        <Border
34
+                            x:Name="itemBox"
35
+                            Background="Transparent"
36
+                            BorderBrush="Transparent"
37
+                            BorderThickness="0">
38
+                            <ContentPresenter />
39
+                        </Border>
40
+                        <ControlTemplate.Triggers />
41
+                    </ControlTemplate>
42
+                </Setter.Value>
43
+            </Setter>
44
+        </Style>
45
+        <DataTemplate x:Key="TongjiItem">
46
+            <UniformGrid
47
+                Height="50"
48
+                Margin="0,0,0,0"
49
+                Background="{Binding Colour}"
50
+                Columns="5"
51
+                Rows="1">
52
+                <!--题号-->
53
+                <TextBlock 
54
+                    HorizontalAlignment="Center"
55
+                    VerticalAlignment="Center"
56
+                    FontSize="16"
57
+                    Text="{Binding SerialNumber}" />
58
+                <Grid>
59
+                    <StackPanel Orientation="Horizontal"   HorizontalAlignment="Center"
60
+                    VerticalAlignment="Center">
61
+                        <TextBox IsEnabled="{Binding IsEnabled}"
62
+                    HorizontalAlignment="Center"
63
+                    VerticalAlignment="Center"
64
+                    FontSize="16" Height="30" Padding="0,5,0,0"
65
+                    Text="{Binding VideoName,Mode=TwoWay}" Width="150"/>
66
+                        <Button x:Name="btnModify" Background="Transparent"
67
+                                Cursor="Hand"
68
+                        BorderThickness="0" Click="BtnModify_Click">
69
+                            <Grid>
70
+                                <Image Source="./Images/fileDirectory3.png" Margin="6,6,6,6" Height="20" Visibility="{Binding vis}"/>
71
+                                <Image Source="./Images/fileDirectory4.png" Margin="6,6,6,6" Height="20" Visibility="{Binding cos}"/>
72
+                            </Grid>
73
+                        </Button>
74
+                    </StackPanel>
75
+                </Grid>
76
+
77
+
78
+                <!--分值-->
79
+                <!--
80
+                <TextBlock
81
+                    HorizontalAlignment="Center"
82
+                    VerticalAlignment="Center"
83
+                    FontSize="15"
84
+                    Text="{Binding VideoDuration}" />-->
85
+
86
+                <!--平均时长-->
87
+                <TextBlock
88
+                    HorizontalAlignment="Center"
89
+                    VerticalAlignment="Center"
90
+                    FontSize="16"
91
+                    Text="{Binding VideoSize}" />
92
+                <!--最短时长-->
93
+                <TextBlock
94
+                    HorizontalAlignment="Center"
95
+                    VerticalAlignment="Center"
96
+                    FontSize="16"
97
+                    Text="{Binding VideoTime}" />
98
+
99
+                <Grid>
100
+                    <StackPanel Orientation="Horizontal"   HorizontalAlignment="Center"
101
+                    VerticalAlignment="Center">
102
+                        <Button x:Name="btnPlay" Background="Transparent" 
103
+                                Cursor="Hand"
104
+                        BorderThickness="0" Click="BtnPlay_Click">
105
+                            <Grid>
106
+                                <Image Source="./Images/fileDirectory1.png" Margin="10" Height="20" Visibility="{Binding vis}"/>
107
+                                <Image Source="./Images/fileDirectory2.png" Margin="10"  Height="20" Visibility="{Binding cos}"/>
108
+                            </Grid>
109
+                        </Button>
110
+                        <Button x:Name="btnUpload" Background="Transparent"
111
+                                Cursor="Hand"
112
+                        BorderThickness="0" Click="BtnUploads_Click">
113
+                            <Grid>
114
+                                <Image Source="./Images/fileDirectory7.png" Margin="6,6,6,6" Height="20" Visibility="{Binding vis}"/>
115
+                                <Image Source="./Images/fileDirectory8.png" Margin="6,6,6,6" Height="20" Visibility="{Binding cos}"/>
116
+                            </Grid>
117
+                        </Button>
118
+                        <Button x:Name="btnDelete" Background="Transparent"
119
+                                Cursor="Hand"
120
+                        BorderThickness="0" Click="BtnDelete_Click">
121
+                            <Grid>
122
+                                <Image Source="./Images/fileDirectory5.png" Margin="6,6,6,6" Height="20" Visibility="{Binding vis}"/>
123
+                                <Image Source="./Images/fileDirectory6.png" Margin="6,6,6,6" Height="20" Visibility="{Binding cos}"/>
124
+                            </Grid>
125
+                        </Button>
126
+                    </StackPanel>
127
+                </Grid>
128
+
129
+
130
+            </UniformGrid>
131
+        </DataTemplate>
132
+    </Window.Resources>
25 133
     <Window.BorderBrush>
26 134
         <RadialGradientBrush>
27 135
             <GradientStop Offset="0.997" Color="#001B1919"/>
@@ -145,7 +253,7 @@
145 253
                 </StackPanel>
146 254
             </Grid>
147 255
             <!--主内容-->
148
-                <Grid Grid.Row="1" x:Name="GridMain" Width="1276" >
256
+                <Grid Grid.Row="1" x:Name="GridMain" Width="1276" Visibility="Visible">
149 257
                     <ScrollViewer x:Name="scroMain" VerticalScrollBarVisibility="Visible">
150 258
                         <Grid x:Name="gridM"  Margin="0,0,0,0" Background="#FFFFFF" Visibility="Visible" Height="1780">
151 259
                             <Grid>
@@ -164,7 +272,7 @@
164 272
                              MouseLeftButtonUp="IMG1_MouseLeftButtonUp"
165 273
                              MouseMove="IMG1_MouseMove"
166 274
                              MouseWheel="IMG1_MouseWheel" >
167
-                                                <Image Name="imgCanvas" Width="635" Height="auto" VerticalAlignment="Top" HorizontalAlignment="Left" Stretch="Uniform" MouseDown="PicEMap_MouseDown" RenderTransform="{StaticResource Imageview}" MouseRightButtonDown="imgCanvas_MouseRightButtonDown" Visibility="Collapsed">
275
+                                                <Image Name="imgCanvas" Width="635" Height="auto" VerticalAlignment="Top" HorizontalAlignment="Left" Stretch="Uniform" MouseDown="PicEMap_MouseDown" RenderTransform="{StaticResource Imageview}" MouseRightButtonDown="imgCanvas_MouseRightButtonDown">
168 276
                                                 </Image>
169 277
                                             </ContentControl>
170 278
                                         </ScrollViewer>
@@ -172,7 +280,7 @@
172 280
                                 </Border>
173 281
                             </Grid>
174 282
                             <!--导入图片-->
175
-                            <Image x:Name="imgDocumentation" Visibility="Collapsed"/>
283
+                            <Image x:Name="imgDocumentation" Visibility="Visible"/>
176 284
                             <!--<Button Cursor="Hand" x:Name="btnOk" Height="50" Width="50" Content="√" FontSize="26" Background="#2E8CF0" Foreground="#FFFFFF" Click="btnOk_Click" Visibility="Collapsed"/>-->
177 285
                             <InkCanvas Grid.Row="0" x:Name="blackboard_canvas"  Background="Transparent" Visibility="Collapsed" Grid.ColumnSpan="2" />
178 286
                             <!--摄像头-->
@@ -271,17 +379,17 @@
271 379
                     <TextBlock x:Name="txbFilePath" Text="文件路径" FontSize="16" Width="80"  Foreground="#2D8CF0" Padding="2,26,10,0"/>
272 380
                     <!--输入框-->
273 381
                     <Border Background="#CDD6E0" Width="525" Height="43" CornerRadius="3">
274
-                        <Label x:Name="txbStoragePath" Content="D:\" FontSize="16" Foreground="#333333" Padding="5,12,2,2" Width="523" Height="42" BorderBrush="{x:Null}" BorderThickness="0"/>
382
+                        <Label x:Name="txbStoragePath" Background="#FFFFFF" Content="D:\" FontSize="16" Foreground="#333333" Padding="5,12,2,2" Width="523" Height="42" BorderBrush="{x:Null}" BorderThickness="0"/>
275 383
                     </Border>
276 384
                     <!--浏览按钮-->
277
-                    <Button Cursor="Hand" x:Name="btnBrowse" Content="打开" FontSize="18" Width="80" Height="43" Margin="18,0,0,0" Click="BtnBrowse_Click">
385
+                    <Button Cursor="Hand" x:Name="btnBrowse" Content="浏览" FontSize="18" Width="80" Height="43" Margin="18,0,0,0" Click="BtnBrowse_Click">
278 386
                         <Button.Template>
279 387
                             <ControlTemplate TargetType="{x:Type Button}">
280 388
                                 <Border
281 389
                                 BorderBrush="{TemplateBinding Control.BorderBrush}"
282 390
                                 BorderThickness="1"
283 391
                                 CornerRadius="2">
284
-                                    <Border.Background>#CDD6E0</Border.Background>
392
+                                        <Border.Background>#EBEFF3</Border.Background>
285 393
                                     <ContentPresenter
286 394
                                     HorizontalAlignment="Center"
287 395
                                     VerticalAlignment="Center"
@@ -317,6 +425,108 @@
317 425
                     </Button.Template>
318 426
                 </Button>
319 427
             </Grid>
428
+                <!--上传-->
429
+                <Grid Grid.Row="1" x:Name="gridUpload" Visibility="Collapsed">
430
+                    <Border Width="1276" Background="#EFF1F8">
431
+                        <Grid  Width="1236" Background="#FFFFFF" Margin="0,0,0,0">
432
+                        <!--分4行-->
433
+                        <Grid.RowDefinitions>
434
+                            <RowDefinition Height="*"/>
435
+                                <RowDefinition Height="30"/>
436
+                            </Grid.RowDefinitions>
437
+                        <!--第二行 内容-->
438
+                        <Grid Grid.Row="0" Margin="0,0,0,0">
439
+                            <Grid.RowDefinitions>
440
+                                <RowDefinition Height="45"/>
441
+                                <RowDefinition Height="*"/>
442
+                            </Grid.RowDefinitions>
443
+                            <UniformGrid x:Name="uniStatisticsByTitle"
444
+                Grid.Row="0"
445
+                Margin="0,0,0,0"
446
+                Background="#E6F0FF"
447
+                Columns="5"
448
+                Rows="1">
449
+                                <TextBlock
450
+                    HorizontalAlignment="Center"
451
+                    VerticalAlignment="Center"
452
+                    FontSize="16"
453
+                    Text="序号"  />
454
+                                <TextBlock
455
+                    HorizontalAlignment="Center"
456
+                    VerticalAlignment="Center"
457
+                    FontSize="16"
458
+                    Text="视频名称"/>
459
+                                <!--<TextBlock
460
+                    HorizontalAlignment="Center"
461
+                    VerticalAlignment="Center"
462
+                    FontSize="15"
463
+                    Text="视频时长" Foreground="White" />-->
464
+                                <TextBlock
465
+                    HorizontalAlignment="Center"
466
+                    VerticalAlignment="Center"
467
+                    FontSize="16"
468
+                    Text="视频大小"/>
469
+                                <TextBlock
470
+                    HorizontalAlignment="Center"
471
+                    VerticalAlignment="Center"
472
+                    FontSize="16"
473
+                    Text="日期"/>
474
+                                <TextBlock
475
+                    HorizontalAlignment="Center"
476
+                    VerticalAlignment="Center"
477
+                    FontSize="16"
478
+                    Text="操作"/>
479
+                            </UniformGrid>
480
+                            <ListBox Grid.Row="1" Margin="0,0,0,0"
481
+                    x:Name="listView1"
482
+                    BorderThickness="0"
483
+                    FontSize="20"
484
+                    ItemContainerStyle="{StaticResource ListBoxItemContainerStyle}"
485
+                    ItemTemplate="{StaticResource TongjiItem}"
486
+                    ItemsSource="{Binding menuList}" 
487
+                           ScrollViewer.HorizontalScrollBarVisibility="Disabled"
488
+                                ScrollViewer.VerticalScrollBarVisibility="Disabled"/>
489
+                        </Grid>
490
+                        <StackPanel Grid.Row="3" x:Name="stpUp" Orientation="Horizontal" Background="Transparent" Width="180" HorizontalAlignment="Center"
491
+            Height="30" Margin="0,0,0,0" Grid.Column="1" VerticalAlignment="Bottom">
492
+                            <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
493
+                    x:Name="btnLastPage"
494
+                    Width="60" Height="20"
495
+                    Click="BtnLastPage_Click">
496
+                                <Button.Content>
497
+                                    <StackPanel>
498
+                                        <Image Width="16" Height="12" Source=".\Images\class_p1.png" />
499
+                                    </StackPanel>
500
+                                </Button.Content>
501
+                            </Button>
502
+                            <Grid Width="60"  Background="Transparent">
503
+                                <Grid.RowDefinitions>
504
+                                    <RowDefinition Height="311*"/>
505
+                                    <RowDefinition Height="483*"/>
506
+                                </Grid.RowDefinitions>
507
+                                <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-12,0,0" Grid.Row="1"  Background="Transparent">
508
+                                    <StackPanel HorizontalAlignment="Center" Orientation="Horizontal"  Background="Transparent">
509
+                                        <TextBlock x:Name="txbCurrpageTwo" TextAlignment="Center" FontSize="15"/>
510
+                                        <TextBlock Text="/" TextAlignment="Center" FontSize="15"/>
511
+                                        <TextBlock x:Name="txbPageNumTwo" TextAlignment="Center" FontSize="15"/>
512
+                                    </StackPanel>
513
+                                </StackPanel>
514
+                            </Grid>
515
+                            <Button Cursor="Hand" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
516
+                    x:Name="btnNextPage"  Background="Transparent"
517
+                    Width="60" Height="20"
518
+                    Click="BtnNextPage_Click">
519
+                                <Button.Content>
520
+                                    <StackPanel>
521
+                                        <Image Width="16" Height="12" Source=".\Images\class_p2.png" />
522
+                                    </StackPanel>
523
+                                </Button.Content>
524
+                            </Button>
525
+                        </StackPanel>
526
+
527
+                    </Grid>
528
+                    </Border>
529
+                </Grid>
320 530
             <Grid Grid.Row="2" Background="#EFF1F8" Margin="0,0,0,0">
321 531
                 <StackPanel Orientation="Horizontal" Margin="0,0,0,0">
322 532
                     <TextBlock Text="颜色:" FontSize="14" Padding="10,10,0,0"/>

+ 522
- 27
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs ファイルの表示

@@ -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 初始化
@@ -446,17 +465,17 @@ namespace XHWK.WKTool
446 465
                 Login();
447 466
                 return;
448 467
             }
449
-            if (APP.fileDirectoryWindow == null)
468
+            if(gridUpload.Visibility == Visibility.Visible)
450 469
             {
451
-                APP.fileDirectoryWindow = new FileDirectoryWindow();
452
-                //APP.fileDirectoryWindow.Topmost = true;
453
-                APP.fileDirectoryWindow.Owner = this;
470
+                gridUpload.Visibility = Visibility.Collapsed;
471
+                GridMain.Visibility = Visibility.Visible;
454 472
             }
455 473
             else
456 474
             {
457
-                APP.fileDirectoryWindow.Initialize();
475
+                gridUpload.Visibility = Visibility.Visible;
476
+                GridMain.Visibility = Visibility.Collapsed;
477
+                InitializeUpload();
458 478
             }
459
-            APP.fileDirectoryWindow.ShowDialog();
460 479
         }
461 480
         /// <summary>
462 481
         /// 关闭事件
@@ -578,6 +597,12 @@ namespace XHWK.WKTool
578 597
             imgPlayerLeft.Visibility = Visibility.Collapsed;
579 598
             imgPlayerRightUnder.Visibility = Visibility.Collapsed;
580 599
             imgPlayerLeftUnder.Visibility = Visibility.Collapsed;
600
+            if(!txbStoragePath.Content.ToString().Equals(APP.WKData.WkPath))
601
+            {
602
+                //存储文件
603
+                FileToolsCommon.SetConfigValue("VideoSavePath", txbStoragePath.Content.ToString());
604
+                System.Windows.MessageBox.Show("路径已变更,下次创建微课时自动生效!!!");
605
+            }
581 606
         }
582 607
         /// <summary>
583 608
         /// 设置事件
@@ -620,23 +645,23 @@ namespace XHWK.WKTool
620 645
         /// <param name="e"></param>
621 646
         private void BtnBrowse_Click(object sender, RoutedEventArgs e)
622 647
         {
623
-            System.Diagnostics.Process.Start(APP.WKData.WkPath);
624
-            //string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
625
-            //Ofd = new System.Windows.Forms.FolderBrowserDialog();
648
+            //System.Diagnostics.Process.Start(APP.WKData.WkPath);
649
+            string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
650
+            Ofd = new System.Windows.Forms.FolderBrowserDialog();
626 651
 
627
-            //Result = Ofd.ShowDialog();
628
-            //if (Result == System.Windows.Forms.DialogResult.OK)
629
-            //{
630
-            //    if (Ofd.SelectedPath != "")
631
-            //    {
652
+            Result = Ofd.ShowDialog();
653
+            if (Result == System.Windows.Forms.DialogResult.OK)
654
+            {
655
+                if (Ofd.SelectedPath != "")
656
+                {
632 657
 
633 658
 
634
-            //        //txbStoragePath.Text = Ofd.SelectedPath;
635
-            //        //string ApplicationData = ZConfig.dataPath + "fileStorageAddress.txt";
636
-            //        //string temp = ofd.SelectedPath;
637
-            //        //System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
638
-            //    }
639
-            //}
659
+                    txbStoragePath.Content = Ofd.SelectedPath;
660
+                    //string ApplicationData = ZConfig.dataPath + "fileStorageAddress.txt";
661
+                    //string temp = ofd.SelectedPath;
662
+                    //System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
663
+                }
664
+            }
640 665
         }
641 666
         /// <summary>
642 667
         /// 画笔颜色事件 白色
@@ -811,8 +836,10 @@ namespace XHWK.WKTool
811 836
         /// <param name="e"></param>
812 837
         private void BtnScreenshot_Click(object sender, RoutedEventArgs e)
813 838
         {
839
+            APP.ImgPath = string.Empty;
814 840
             string time = GetTimeStamp();
815 841
             string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + time + ".jpg";
842
+            APP.ImgPath = desktopPath;
816 843
             ImageHelper.GetScreenshot(new System.Drawing.Rectangle(0, 0, 0, 0), desktopPath,false,out BitmapImage bitmap);
817 844
             if (this.WindowState == WindowState.Normal)//截图隐藏窗口
818 845
             {
@@ -846,6 +873,7 @@ namespace XHWK.WKTool
846 873
             {
847 874
                 if (this.WindowState == WindowState.Minimized)//截图完恢复窗口
848 875
                 {
876
+                    this.Topmost = true;
849 877
                     this.WindowState = WindowState.Normal;
850 878
                 }
851 879
                 if (!string.IsNullOrWhiteSpace(APP.ImgPath) && File.Exists(APP.ImgPath))
@@ -878,6 +906,7 @@ namespace XHWK.WKTool
878 906
                         btnPrint.IsEnabled = true;
879 907
                     }
880 908
                 }
909
+                this.Topmost = false;
881 910
             }
882 911
         }
883 912
         /// <summary>
@@ -1035,11 +1064,11 @@ namespace XHWK.WKTool
1035 1064
                             }
1036 1065
                             if (APP.pageData.currpage > 0 && APP.pageData.currpage < APP.PageDrawList.Count)
1037 1066
                             {
1038
-                                imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));//给当前页面展示图片
1039 1067
                                 imgCanvas.Source = null;
1040 1068
                                 ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
1041 1069
                                 ImgScreenshotTwo.Visibility = Visibility.Visible;
1042 1070
                                 btnScreenshot.IsEnabled = false;
1071
+                                imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));//给当前页面展示图片
1043 1072
                             }
1044 1073
                             else
1045 1074
                             {
@@ -2640,15 +2669,481 @@ namespace XHWK.WKTool
2640 2669
             imgCanvas.Source = null;
2641 2670
         }
2642 2671
 
2643
-        private void Button_Click(object sender, RoutedEventArgs e)
2672
+        #region 上传
2673
+        /// <summary>
2674
+        /// 初始化上传
2675
+        /// </summary>
2676
+        public void InitializeUpload()
2644 2677
         {
2645
-            //System.Windows.SplashScreen(LoadDialog);
2646
-            //Common.system.SplashScreen.Show(typeof(LoadDialog));
2647
-            //Thread.Sleep(5000);
2648
-            //Common.system.SplashScreen.Close();
2649 2678
             APP.myloading.Show();
2650
-            Thread.Sleep(1000);
2679
+            MouseNumber = 0;
2680
+            IsModify = false;
2681
+            //加载视频列表
2682
+            LoadingVideoList();
2683
+            int i = 1;
2684
+            bool isColour = true;
2685
+            pageData.menuList.Clear();
2686
+            //显示视频
2687
+            foreach (Model_Video videoinfo in model_VideoList)
2688
+            {
2689
+                //是否已上传
2690
+                //videoinfo.IsUpload;
2691
+                //录制时间
2692
+                //videoinfo.RSTime;
2693
+                //文件大小
2694
+                //videoinfo.VideoSize;
2695
+                //文件缩略图路径
2696
+                //videoinfo.ThumbnailPath;
2697
+                //文件唯一标示 上传事件筛选需要上传的视频
2698
+                //videoinfo.FileGuid;
2699
+                //文件存储路径
2700
+                //videoinfo.VidePath;
2701
+
2702
+                string colour = "#FFFFFF";
2703
+                if (isColour == true)
2704
+                {
2705
+                    colour = "#FFFFFF";
2706
+                    isColour = false;
2707
+                }
2708
+                else
2709
+                {
2710
+                    colour = "#E6F1FF";
2711
+                    isColour = true;
2712
+                }
2713
+                string vis = "Visible";
2714
+                string cos = "Collapsed";
2715
+                if (!videoinfo.IsUpload)
2716
+                {
2717
+                    vis = "Collapsed";
2718
+                    cos = "Visible";
2719
+                }
2720
+                if (i <= 16)
2721
+                {
2722
+                    pageData.menuList.Add(new FileDirectoryModel()
2723
+                    {
2724
+                        SerialNumber = i,
2725
+                        VideoName = Common.system.FileToolsCommon.GetIOFileName(videoinfo.VideoPath).Replace(".MP4", "").Replace(".FLV", "").Replace(".AVI", "").Trim(),
2726
+                        Name = Common.system.FileToolsCommon.GetIOFileName(videoinfo.VideoPath).Replace(".MP4", "").Replace(".FLV", "").Replace(".AVI", "").Trim(),
2727
+                        FilePath = videoinfo.VideoPath.Replace(FileToolsCommon.GetIOFileName(videoinfo.VideoPath), "").Trim(),
2728
+                        VideoDuration = 0,
2729
+                        VideoSize = videoinfo.VideoSize,
2730
+                        VideoTime = videoinfo.RSTime,
2731
+                        IsEnabled = false,
2732
+                        Path = videoinfo.VideoPath,
2733
+                        Colour = colour,
2734
+                        Visi = vis,
2735
+                        Coll = cos,
2736
+                        FileGuid = videoinfo.FileGuid,
2737
+                        VideoType = videoinfo.VideoType.ToString()
2738
+                    }); ;
2739
+                }
2740
+                i++;
2741
+            }
2742
+            Currpage = 0;
2743
+            PageNum = 0;
2744
+            if (pageData.menuList.Count>0)
2745
+            {
2746
+                Currpage = 1;
2747
+                txbCurrpageTwo.Text = Currpage.ToString();
2748
+                stpUp.Visibility = Visibility.Visible;
2749
+            }
2750
+            else
2751
+            {
2752
+                stpUp.Visibility = Visibility.Hidden;
2753
+            }
2754
+            PageNum = model_VideoList.Count;
2755
+            if (PageNum > 0)
2756
+            {
2757
+                int t = 1;
2758
+                while (PageNum > 16 * t)
2759
+                {
2760
+                    t++;
2761
+                }
2762
+                PageNum = t;
2763
+            }
2764
+            else
2765
+            {
2766
+                PageNum = 0;
2767
+            }
2768
+            txbPageNumTwo.Text = PageNum.ToString();
2651 2769
             APP.myloading.Hide();
2770
+            DataContext = pageData;
2771
+        }
2772
+        /// <summary>
2773
+        /// 当前页
2774
+        /// </summary>
2775
+        int Currpage = 0;
2776
+        /// <summary>
2777
+        /// 总页码
2778
+        /// </summary>
2779
+        int PageNum = 0;
2780
+        /// <summary>
2781
+        /// 加载视频列表
2782
+        /// </summary>
2783
+        public void LoadingVideoList()
2784
+        {
2785
+            try
2786
+            {
2787
+                model_VideoList = new List<Model_Video>();
2788
+                foreach (Model_WKData Vdata in APP.WKDataList)
2789
+                {
2790
+                    if (Vdata.VideoList == null)
2791
+                        continue;
2792
+                    foreach (Model_Video videoinfo in Vdata.VideoList)
2793
+                    {
2794
+                        try
2795
+                        {
2796
+                            if (string.IsNullOrWhiteSpace(videoinfo.VideoPath))
2797
+                            {
2798
+                                continue;
2799
+                            }
2800
+                            if (string.IsNullOrWhiteSpace(videoinfo.VideoSize) || videoinfo.VideoSize == "0 MB")
2801
+                            {
2802
+                                videoinfo.VideoSize = FileToolsCommon.GetFileSizeByMB(videoinfo.VideoPath).ToString() + " MB";
2803
+                            }
2804
+                            model_VideoList.Add(videoinfo);
2805
+                        }
2806
+                        catch (Exception ex)
2807
+                        {
2808
+                            LogHelper.WriteErrLog("【加载视频列表】(LoadingVideoList)" + ex.Message, ex);
2809
+                        }
2810
+                    }
2811
+                }
2812
+            }
2813
+            catch (Exception ex)
2814
+            {
2815
+                LogHelper.WriteErrLog("【加载视频列表】(LoadingVideoList)" + ex.Message, ex);
2816
+            }
2817
+        }
2818
+        /// <summary>
2819
+        /// 上传
2820
+        /// </summary>
2821
+        /// <param name="sender"></param>
2822
+        /// <param name="e"></param>
2823
+        private void BtnUploads_Click(object sender, RoutedEventArgs e) 
2824
+        {
2825
+            pageData.menuList[Subscript].IsEnabled = false;
2826
+            List<System.Windows.Controls.Button> buttons = FindChilds<System.Windows.Controls.Button>(listView1, "btnUpload");
2827
+            for (int i = 0; i < buttons.Count; i++)
2828
+            {
2829
+                if (buttons[i] == sender)
2830
+                {
2831
+                    DAL_Upload dAL_Upload = new DAL_Upload();
2832
+
2833
+                    if (dAL_Upload.UploadVideo(pageData.menuList[i].FileGuid, out string ErrMessage))
2834
+                    {
2835
+                        pageData.menuList[i].Visi = "Visible";
2836
+                        pageData.menuList[i].Coll = "Collapsed";
2837
+
2838
+                        DataContext = pageData;
2839
+
2840
+                        System.Windows.MessageBox.Show("视频上传成功!");
2841
+                    }
2842
+                    else
2843
+                    {
2844
+                        System.Windows.MessageBox.Show(ErrMessage);
2845
+                    }
2846
+
2847
+
2848
+                }
2849
+            }
2850
+        }
2851
+        /// <summary>
2852
+        /// 删除
2853
+        /// </summary>
2854
+        /// <param name="sender"></param>
2855
+        /// <param name="e"></param>
2856
+        private void BtnDelete_Click(object sender, RoutedEventArgs e)
2857
+        {
2858
+
2859
+            pageData.menuList[Subscript].IsEnabled = false;
2860
+            List<System.Windows.Controls.Button> buttons = FindChilds<System.Windows.Controls.Button>(listView1, "btnDelete");
2861
+            for (int i = 0; i < buttons.Count; i++)
2862
+            {
2863
+                if (buttons[i] == sender)
2864
+                {
2865
+
2866
+                    //if (APP.W_PromptWindow == null)
2867
+                    //{
2868
+                    //    APP.W_PromptWindow = new PromptWindow();
2869
+                    //    APP.W_PromptWindow.Owner = this;
2870
+                    //}
2871
+                    //APP.W_PromptWindow.Initialize(pageData.menuList[i].VideoName);
2872
+                    //APP.W_PromptWindow.ShowDialog();
2873
+
2874
+                    foreach (Model_WKData wKData in APP.WKDataList)
2875
+                    {
2876
+                        if (wKData.VideoList == null)
2877
+                            continue;
2878
+                        if (wKData.VideoList.Exists(x => x.FileGuid == pageData.menuList[i].FileGuid))
2879
+                        {
2880
+                            try
2881
+                            {
2882
+                                FileToolsCommon.DeleteFile(wKData.VideoList.Find(x => x.FileGuid == pageData.menuList[i].FileGuid).VideoPath);
2883
+                                FileToolsCommon.DeleteFile(wKData.VideoList.Find(x => x.FileGuid == pageData.menuList[i].FileGuid).ThumbnailPath);
2884
+                                wKData.VideoList.Remove(wKData.VideoList.Find(x => x.FileGuid == pageData.menuList[i].FileGuid));
2885
+                                InitializeUpload();
2886
+                                return;
2887
+                            }
2888
+                            catch (Exception ex)
2889
+                            {
2890
+                                System.Windows.MessageBox.Show("无法删除视频!" + ex.Message);
2891
+                                return;
2892
+                            }
2893
+                        }
2894
+                    }
2895
+                }
2896
+            }
2897
+        }
2898
+        /// <summary>
2899
+        /// 播放
2900
+        /// </summary>
2901
+        /// <param name="sender"></param>
2902
+        /// <param name="e"></param>
2903
+        private void BtnPlay_Click(object sender, RoutedEventArgs e)
2904
+        {
2905
+            pageData.menuList[Subscript].IsEnabled = false;
2906
+            List<System.Windows.Controls.Button> buttons = FindChilds<System.Windows.Controls.Button>(listView1, "btnPlay");
2907
+            for (int i = 0; i < buttons.Count; i++)
2908
+            {
2909
+                if (buttons[i] == sender)
2910
+                {
2911
+                    try
2912
+                    {
2913
+                        ProcessStartInfo psi = new ProcessStartInfo(pageData.menuList[i].Path);
2914
+                        Process pro = new Process
2915
+                        {
2916
+                            StartInfo = psi
2917
+                        };
2918
+                        pro.Start();
2919
+                    }
2920
+                    catch (Exception ex)
2921
+                    {
2922
+                        LogHelper.WriteErrLog("FileDirectoryWindow【BtnPlay_Click】" + ex.Message, ex);
2923
+                        System.Windows.MessageBox.Show(ex.Message);
2924
+                        return;
2925
+                    }
2926
+                }
2927
+            }
2928
+        }
2929
+        /// <summary>
2930
+        /// 搜索集合匹配的索引
2931
+        /// </summary>
2932
+        /// <typeparam name="T"></typeparam>
2933
+        /// <param name="parent"></param>
2934
+        /// <param name="childName"></param>
2935
+        /// <returns></returns>
2936
+        public static List<T> FindChilds<T>(DependencyObject parent, string childName)
2937
+  where T : DependencyObject
2938
+        {
2939
+            List<T> list = new List<T>();
2940
+            if (parent == null)
2941
+            {
2942
+                return list;
2943
+            }
2944
+
2945
+            int childrenCount = VisualTreeHelper.GetChildrenCount(parent);
2946
+            for (int i = 0; i < childrenCount; i++)
2947
+            {
2948
+                DependencyObject child = VisualTreeHelper.GetChild(parent, i);
2949
+                // 如果子控件不是需查找的控件类型
2950
+                T childType = child as T;
2951
+                if (childType == null)
2952
+                {
2953
+                    // 在下一级控件中递归查找
2954
+                    List<T> findChildList = FindChilds<T>(child, childName);
2955
+                    for (int j = 0; j < findChildList.Count; j++)
2956
+                    {
2957
+                    }
2958
+                    list.AddRange(FindChilds<T>(child, childName));
2959
+                }
2960
+                else if (!string.IsNullOrEmpty(childName))
2961
+                {
2962
+                    FrameworkElement frameworkElement = child as FrameworkElement;
2963
+                    // 如果控件名称符合参数条件
2964
+                    if (frameworkElement != null && frameworkElement.Name == childName)
2965
+                    {
2966
+                        list.Add((T)child);
2967
+                    }
2968
+                }
2969
+                else
2970
+                {
2971
+                    // 查找到了控件
2972
+                    list.Add((T)child);
2973
+                }
2974
+            }
2975
+
2976
+            return list;
2652 2977
         }
2978
+        /// <summary>
2979
+        /// 修改
2980
+        /// </summary>
2981
+        /// <param name="sender"></param>
2982
+        /// <param name="e"></param>
2983
+        private void BtnModify_Click(object sender, RoutedEventArgs e)
2984
+        {
2985
+            if (IsModify)
2986
+            {
2987
+                pageData.menuList[Subscript].IsEnabled = false;
2988
+            }
2989
+            List<System.Windows.Controls.Button> buttons = FindChilds<System.Windows.Controls.Button>(listView1, "btnModify");
2990
+            for (int i = 0; i < buttons.Count; i++)
2991
+            {
2992
+                if (buttons[i] == sender)
2993
+                {
2994
+                    pageData.menuList[i].IsEnabled = true;
2995
+                    Subscript = i;
2996
+                    IsModify = true;
2997
+                }
2998
+            }
2999
+        }
3000
+        int MouseNumber = 0;
3001
+        /// <summary>
3002
+        /// 上传 上页
3003
+        /// </summary>
3004
+        /// <param name="sender"></param>
3005
+        /// <param name="e"></param>
3006
+        private void BtnLastPage_Click(object sender, RoutedEventArgs e)
3007
+        {
3008
+            if (Currpage >1)
3009
+            {
3010
+                Currpage -= 1;
3011
+                txbCurrpageTwo.Text = Currpage.ToString();
3012
+                int i = 1;
3013
+                bool isColour = true;
3014
+                pageData.menuList.Clear();
3015
+                //显示视频
3016
+                foreach (Model_Video videoinfo in model_VideoList)
3017
+                {
3018
+                    //是否已上传
3019
+                    //videoinfo.IsUpload;
3020
+                    //录制时间
3021
+                    //videoinfo.RSTime;
3022
+                    //文件大小
3023
+                    //videoinfo.VideoSize;
3024
+                    //文件缩略图路径
3025
+                    //videoinfo.ThumbnailPath;
3026
+                    //文件唯一标示 上传事件筛选需要上传的视频
3027
+                    //videoinfo.FileGuid;
3028
+                    //文件存储路径
3029
+                    //videoinfo.VidePath;
3030
+
3031
+                    string colour = "#FFFFFF";
3032
+                    if (isColour == true)
3033
+                    {
3034
+                        colour = "#FFFFFF";
3035
+                        isColour = false;
3036
+                    }
3037
+                    else
3038
+                    {
3039
+                        colour = "#E6F1FF";
3040
+                        isColour = true;
3041
+                    }
3042
+                    string vis = "Visible";
3043
+                    string cos = "Collapsed";
3044
+                    if (!videoinfo.IsUpload)
3045
+                    {
3046
+                        vis = "Collapsed";
3047
+                        cos = "Visible";
3048
+                    }
3049
+                    if (i <= Currpage * 16 && i >= (Currpage - 1) * 16)
3050
+                    {
3051
+                        pageData.menuList.Add(new FileDirectoryModel()
3052
+                        {
3053
+                            SerialNumber = i,
3054
+                            VideoName = Common.system.FileToolsCommon.GetIOFileName(videoinfo.VideoPath).Replace(".MP4", "").Replace(".FLV", "").Replace(".AVI", "").Trim(),
3055
+                            Name = Common.system.FileToolsCommon.GetIOFileName(videoinfo.VideoPath).Replace(".MP4", "").Replace(".FLV", "").Replace(".AVI", "").Trim(),
3056
+                            FilePath = videoinfo.VideoPath.Replace(FileToolsCommon.GetIOFileName(videoinfo.VideoPath), "").Trim(),
3057
+                            VideoDuration = 0,
3058
+                            VideoSize = videoinfo.VideoSize,
3059
+                            VideoTime = videoinfo.RSTime,
3060
+                            IsEnabled = false,
3061
+                            Path = videoinfo.VideoPath,
3062
+                            Colour = colour,
3063
+                            Visi = vis,
3064
+                            Coll = cos,
3065
+                            FileGuid = videoinfo.FileGuid,
3066
+                            VideoType = videoinfo.VideoType.ToString()
3067
+                        }); ;
3068
+                    }
3069
+                    i++;
3070
+                }
3071
+                APP.myloading.Hide();
3072
+            }
3073
+        }
3074
+        /// <summary>
3075
+        /// 上传 下页
3076
+        /// </summary>
3077
+        /// <param name="sender"></param>
3078
+        /// <param name="e"></param>
3079
+        private void BtnNextPage_Click(object sender, RoutedEventArgs e)
3080
+        {
3081
+            if(Currpage< PageNum)
3082
+            {
3083
+                Currpage += 1;
3084
+                txbCurrpageTwo.Text = Currpage.ToString();
3085
+                int i = 1;
3086
+                bool isColour = true;
3087
+                pageData.menuList.Clear();
3088
+                //显示视频
3089
+                foreach (Model_Video videoinfo in model_VideoList)
3090
+                {
3091
+                    //是否已上传
3092
+                    //videoinfo.IsUpload;
3093
+                    //录制时间
3094
+                    //videoinfo.RSTime;
3095
+                    //文件大小
3096
+                    //videoinfo.VideoSize;
3097
+                    //文件缩略图路径
3098
+                    //videoinfo.ThumbnailPath;
3099
+                    //文件唯一标示 上传事件筛选需要上传的视频
3100
+                    //videoinfo.FileGuid;
3101
+                    //文件存储路径
3102
+                    //videoinfo.VidePath;
3103
+
3104
+                    string colour = "#FFFFFF";
3105
+                    if (isColour == true)
3106
+                    {
3107
+                        colour = "#FFFFFF";
3108
+                        isColour = false;
3109
+                    }
3110
+                    else
3111
+                    {
3112
+                        colour = "#E6F1FF";
3113
+                        isColour = true;
3114
+                    }
3115
+                    string vis = "Visible";
3116
+                    string cos = "Collapsed";
3117
+                    if (!videoinfo.IsUpload)
3118
+                    {
3119
+                        vis = "Collapsed";
3120
+                        cos = "Visible";
3121
+                    }
3122
+                    if (i <= Currpage*16&&i>(Currpage-1)*16)
3123
+                    {
3124
+                        pageData.menuList.Add(new FileDirectoryModel()
3125
+                        {
3126
+                            SerialNumber = i,
3127
+                            VideoName = Common.system.FileToolsCommon.GetIOFileName(videoinfo.VideoPath).Replace(".MP4", "").Replace(".FLV", "").Replace(".AVI", "").Trim(),
3128
+                            Name = Common.system.FileToolsCommon.GetIOFileName(videoinfo.VideoPath).Replace(".MP4", "").Replace(".FLV", "").Replace(".AVI", "").Trim(),
3129
+                            FilePath = videoinfo.VideoPath.Replace(FileToolsCommon.GetIOFileName(videoinfo.VideoPath), "").Trim(),
3130
+                            VideoDuration = 0,
3131
+                            VideoSize = videoinfo.VideoSize,
3132
+                            VideoTime = videoinfo.RSTime,
3133
+                            IsEnabled = false,
3134
+                            Path = videoinfo.VideoPath,
3135
+                            Colour = colour,
3136
+                            Visi = vis,
3137
+                            Coll = cos,
3138
+                            FileGuid = videoinfo.FileGuid,
3139
+                            VideoType = videoinfo.VideoType.ToString()
3140
+                        }); ;
3141
+                    }
3142
+                    i++;
3143
+                }
3144
+                APP.myloading.Hide();
3145
+            }    
3146
+        }
3147
+        #endregion
2653 3148
     }
2654 3149
 }

+ 8
- 0
XHWK.WKTool/XHWK.WKTool.csproj ファイルの表示

@@ -1547,5 +1547,13 @@
1547 1547
     <Resource Include="Images\countdown3_9.png" />
1548 1548
     <Resource Include="Images\microLessonSystem_999.png" />
1549 1549
   </ItemGroup>
1550
+  <ItemGroup>
1551
+    <Resource Include="Images\31.png" />
1552
+    <Resource Include="Images\32.png" />
1553
+    <Resource Include="Images\Toobar27.png" />
1554
+    <Resource Include="Images\Toobar28.png" />
1555
+    <Resource Include="Images\Toobar29.png" />
1556
+    <Resource Include="Images\Toobar30.png" />
1557
+  </ItemGroup>
1550 1558
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
1551 1559
 </Project>

読み込み中…
キャンセル
保存