|
@@ -564,124 +564,131 @@ namespace XHWK.WKTool
|
564
|
564
|
/// <param name="e"></param>
|
565
|
565
|
private void BtnSave_Click(object sender, RoutedEventArgs e)
|
566
|
566
|
{
|
567
|
|
- ImgRecord.Visibility = Visibility.Visible;//设置结束时可录制
|
568
|
|
- ImgRecordTwo.Visibility = Visibility.Collapsed;//设置结束时可录制
|
569
|
|
- BtnRecord.IsEnabled = true;//设置结束时可录制
|
570
|
|
-
|
571
|
|
- if (!string.IsNullOrWhiteSpace(txbInterfaceAddress.Text))
|
572
|
|
- {
|
573
|
|
- string ApplicationData = APP.dataPath + "interfaceAddress.txt";
|
574
|
|
- string temp = "http://" + txbInterfaceAddress.Text;
|
575
|
|
- System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
|
576
|
|
- }
|
577
|
|
- else
|
578
|
|
- {
|
579
|
|
- MessageWindow.Show("接口地址未输入");
|
580
|
|
- return;
|
581
|
|
- }
|
582
|
|
- if (!string.IsNullOrWhiteSpace(txbImageUploadAddress.Text))//图片上传地址
|
583
|
|
- {
|
584
|
|
- string ApplicationData = APP.dataPath + "imageUploadAddress.txt";
|
585
|
|
- string temp = "http://" + txbImageUploadAddress.Text + "/";
|
586
|
|
- System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
|
587
|
|
- }
|
588
|
|
- else
|
589
|
|
- {
|
590
|
|
- MessageWindow.Show("上传地址未输入");
|
591
|
|
- return;
|
592
|
|
- }
|
593
|
|
- if (!string.IsNullOrWhiteSpace(txbPictureShowsAddress.Text))
|
594
|
|
- {
|
595
|
|
- string ApplicationData = APP.dataPath + "pictureShowsAddress.txt";
|
596
|
|
- string temp = "http://" + txbPictureShowsAddress.Text + "/static/";
|
597
|
|
- System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
|
598
|
|
- }
|
599
|
|
- else
|
600
|
|
- {
|
601
|
|
- MessageWindow.Show("下载地址未输入");
|
602
|
|
- return;
|
603
|
|
- }
|
604
|
|
- if (!APP.apiUrl.Equals("http://" + txbInterfaceAddress.Text))
|
|
567
|
+ try
|
605
|
568
|
{
|
606
|
|
- APP.apiUrl = "http://" + txbInterfaceAddress.Text;
|
607
|
|
-
|
608
|
|
- if(!txbLoginType.Text.Equals("未登录"))
|
|
569
|
+ ImgRecord.Visibility = Visibility.Visible;//设置结束时可录制
|
|
570
|
+ ImgRecordTwo.Visibility = Visibility.Collapsed;//设置结束时可录制
|
|
571
|
+ BtnRecord.IsEnabled = true;//设置结束时可录制
|
|
572
|
+
|
|
573
|
+ if (!string.IsNullOrWhiteSpace(txbInterfaceAddress.Text))
|
609
|
574
|
{
|
610
|
|
- LoginType();
|
611
|
|
- MessageWindow.Show("接口地址已修改,请重新登陆!");
|
|
575
|
+ string ApplicationData = APP.dataPath + "interfaceAddress.txt";
|
|
576
|
+ string temp = "http://" + txbInterfaceAddress.Text;
|
|
577
|
+ System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
|
612
|
578
|
}
|
613
|
|
- }
|
614
|
|
- if (!APP.uploadUrl.Equals(txbImageUploadAddress.Text))
|
615
|
|
- {
|
616
|
|
- APP.uploadUrl = "http://" + txbImageUploadAddress.Text + "/";
|
617
|
|
- }
|
618
|
|
- if (!APP.showImageUrl.Equals(txbPictureShowsAddress.Text))
|
619
|
|
- {
|
620
|
|
- APP.showImageUrl = "http://" + txbPictureShowsAddress.Text + "/static/";
|
621
|
|
- }
|
622
|
|
- if (rbnMP4.IsChecked == true)
|
623
|
|
- {
|
624
|
|
- //存储文件
|
625
|
|
- FileToolsCommon.SetConfigValue("VideoType", "1");
|
626
|
|
- }
|
627
|
|
- else if (rbnFLV.IsChecked == true)
|
628
|
|
- {
|
629
|
|
- FileToolsCommon.SetConfigValue("VideoType", "2");
|
630
|
|
- }
|
631
|
|
- else
|
632
|
|
- {
|
633
|
|
- FileToolsCommon.SetConfigValue("VideoType", "3");
|
634
|
|
- }
|
635
|
|
- if (rbnY.IsChecked == true)
|
636
|
|
- {
|
637
|
|
- FileToolsCommon.SetConfigValue("IsSound", "true");
|
638
|
|
- }
|
639
|
|
- else
|
640
|
|
- {
|
641
|
|
- FileToolsCommon.SetConfigValue("IsSound", "false");
|
642
|
|
- }
|
643
|
|
- /// < !--摄像头位置 1.右上 2.左上 3.右下 4.左下-- >
|
644
|
|
- if (rbnRight.IsChecked == true)
|
645
|
|
- {
|
646
|
|
- FileToolsCommon.SetConfigValue("CameraPosition", "1");
|
647
|
|
- }
|
648
|
|
- else if (rbnLeft.IsChecked == true)
|
649
|
|
- {
|
650
|
|
- FileToolsCommon.SetConfigValue("CameraPosition", "2");
|
651
|
|
- }
|
652
|
|
- else if (rbnRightUnder.IsChecked == true)
|
653
|
|
- {
|
654
|
|
- FileToolsCommon.SetConfigValue("CameraPosition", "3");
|
655
|
|
- }
|
656
|
|
- else if (rbnLeftUnder.IsChecked == true)
|
657
|
|
- {
|
658
|
|
- FileToolsCommon.SetConfigValue("CameraPosition", "4");
|
659
|
|
- }
|
|
579
|
+ else
|
|
580
|
+ {
|
|
581
|
+ MessageWindow.Show("接口地址未输入");
|
|
582
|
+ return;
|
|
583
|
+ }
|
|
584
|
+ if (!string.IsNullOrWhiteSpace(txbImageUploadAddress.Text))//图片上传地址
|
|
585
|
+ {
|
|
586
|
+ string ApplicationData = APP.dataPath + "imageUploadAddress.txt";
|
|
587
|
+ string temp = "http://" + txbImageUploadAddress.Text + "/";
|
|
588
|
+ System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
|
|
589
|
+ }
|
|
590
|
+ else
|
|
591
|
+ {
|
|
592
|
+ MessageWindow.Show("上传地址未输入");
|
|
593
|
+ return;
|
|
594
|
+ }
|
|
595
|
+ if (!string.IsNullOrWhiteSpace(txbPictureShowsAddress.Text))
|
|
596
|
+ {
|
|
597
|
+ string ApplicationData = APP.dataPath + "pictureShowsAddress.txt";
|
|
598
|
+ string temp = "http://" + txbPictureShowsAddress.Text + "/static/";
|
|
599
|
+ System.IO.File.WriteAllText(ApplicationData, temp, Encoding.Default);
|
|
600
|
+ }
|
|
601
|
+ else
|
|
602
|
+ {
|
|
603
|
+ MessageWindow.Show("下载地址未输入");
|
|
604
|
+ return;
|
|
605
|
+ }
|
|
606
|
+ if (!APP.apiUrl.Equals("http://" + txbInterfaceAddress.Text))
|
|
607
|
+ {
|
|
608
|
+ APP.apiUrl = "http://" + txbInterfaceAddress.Text;
|
660
|
609
|
|
661
|
|
- if (rbnMP4.IsChecked == true)
|
662
|
|
- {
|
663
|
|
- FileToolsCommon.SetConfigValue("VideoType", "1");
|
664
|
|
- }
|
665
|
|
- else if (rbnFLV.IsChecked == true)
|
666
|
|
- {
|
667
|
|
- FileToolsCommon.SetConfigValue("VideoType", "2");
|
668
|
|
- }
|
669
|
|
- else if (rbnAVI.IsChecked == true)
|
670
|
|
- {
|
671
|
|
- FileToolsCommon.SetConfigValue("VideoType", "3");
|
|
610
|
+ if (!txbLoginType.Text.Equals("未登录"))
|
|
611
|
+ {
|
|
612
|
+ LoginType();
|
|
613
|
+ MessageWindow.Show("接口地址已修改,请重新登陆!");
|
|
614
|
+ }
|
|
615
|
+ }
|
|
616
|
+ if (!APP.uploadUrl.Equals(txbImageUploadAddress.Text))
|
|
617
|
+ {
|
|
618
|
+ APP.uploadUrl = "http://" + txbImageUploadAddress.Text + "/";
|
|
619
|
+ }
|
|
620
|
+ if (!APP.showImageUrl.Equals(txbPictureShowsAddress.Text))
|
|
621
|
+ {
|
|
622
|
+ APP.showImageUrl = "http://" + txbPictureShowsAddress.Text + "/static/";
|
|
623
|
+ }
|
|
624
|
+ if (rbnMP4.IsChecked == true)
|
|
625
|
+ {
|
|
626
|
+ //存储文件
|
|
627
|
+ FileToolsCommon.SetConfigValue("VideoType", "1");
|
|
628
|
+ }
|
|
629
|
+ else if (rbnFLV.IsChecked == true)
|
|
630
|
+ {
|
|
631
|
+ FileToolsCommon.SetConfigValue("VideoType", "2");
|
|
632
|
+ }
|
|
633
|
+ else
|
|
634
|
+ {
|
|
635
|
+ FileToolsCommon.SetConfigValue("VideoType", "3");
|
|
636
|
+ }
|
|
637
|
+ if (rbnY.IsChecked == true)
|
|
638
|
+ {
|
|
639
|
+ FileToolsCommon.SetConfigValue("IsSound", "true");
|
|
640
|
+ }
|
|
641
|
+ else
|
|
642
|
+ {
|
|
643
|
+ FileToolsCommon.SetConfigValue("IsSound", "false");
|
|
644
|
+ }
|
|
645
|
+ /// < !--摄像头位置 1.右上 2.左上 3.右下 4.左下-- >
|
|
646
|
+ if (rbnRight.IsChecked == true)
|
|
647
|
+ {
|
|
648
|
+ FileToolsCommon.SetConfigValue("CameraPosition", "1");
|
|
649
|
+ }
|
|
650
|
+ else if (rbnLeft.IsChecked == true)
|
|
651
|
+ {
|
|
652
|
+ FileToolsCommon.SetConfigValue("CameraPosition", "2");
|
|
653
|
+ }
|
|
654
|
+ else if (rbnRightUnder.IsChecked == true)
|
|
655
|
+ {
|
|
656
|
+ FileToolsCommon.SetConfigValue("CameraPosition", "3");
|
|
657
|
+ }
|
|
658
|
+ else if (rbnLeftUnder.IsChecked == true)
|
|
659
|
+ {
|
|
660
|
+ FileToolsCommon.SetConfigValue("CameraPosition", "4");
|
|
661
|
+ }
|
|
662
|
+
|
|
663
|
+ if (rbnMP4.IsChecked == true)
|
|
664
|
+ {
|
|
665
|
+ FileToolsCommon.SetConfigValue("VideoType", "1");
|
|
666
|
+ }
|
|
667
|
+ else if (rbnFLV.IsChecked == true)
|
|
668
|
+ {
|
|
669
|
+ FileToolsCommon.SetConfigValue("VideoType", "2");
|
|
670
|
+ }
|
|
671
|
+ else if (rbnAVI.IsChecked == true)
|
|
672
|
+ {
|
|
673
|
+ FileToolsCommon.SetConfigValue("VideoType", "3");
|
|
674
|
+ }
|
|
675
|
+ APP.CameraPosition = FileToolsCommon.GetConfigValue("CameraPosition");
|
|
676
|
+ GridMain.Visibility = Visibility.Visible;
|
|
677
|
+ gridSetUp.Visibility = Visibility.Collapsed;
|
|
678
|
+ imgPlayerRight.Visibility = Visibility.Collapsed;
|
|
679
|
+ imgPlayerLeft.Visibility = Visibility.Collapsed;
|
|
680
|
+ imgPlayerRightUnder.Visibility = Visibility.Collapsed;
|
|
681
|
+ imgPlayerLeftUnder.Visibility = Visibility.Collapsed;
|
|
682
|
+ if (!txbStoragePath.Content.ToString().Equals(APP.WKData.WkPath))
|
|
683
|
+ {
|
|
684
|
+ //存储文件
|
|
685
|
+ FileToolsCommon.SetConfigValue("VideoSavePath", txbStoragePath.Content.ToString());
|
|
686
|
+ MessageWindow.Show("路径已变更,下次创建微课时自动生效!!!");
|
|
687
|
+ }
|
672
|
688
|
}
|
673
|
|
- APP.CameraPosition = FileToolsCommon.GetConfigValue("CameraPosition");
|
674
|
|
- GridMain.Visibility = Visibility.Visible;
|
675
|
|
- gridSetUp.Visibility = Visibility.Collapsed;
|
676
|
|
- imgPlayerRight.Visibility = Visibility.Collapsed;
|
677
|
|
- imgPlayerLeft.Visibility = Visibility.Collapsed;
|
678
|
|
- imgPlayerRightUnder.Visibility = Visibility.Collapsed;
|
679
|
|
- imgPlayerLeftUnder.Visibility = Visibility.Collapsed;
|
680
|
|
- if (!txbStoragePath.Content.ToString().Equals(APP.WKData.WkPath))
|
|
689
|
+ catch (Exception ex)
|
681
|
690
|
{
|
682
|
|
- //存储文件
|
683
|
|
- FileToolsCommon.SetConfigValue("VideoSavePath", txbStoragePath.Content.ToString());
|
684
|
|
- MessageWindow.Show("路径已变更,下次创建微课时自动生效!!!");
|
|
691
|
+ LogHelper.WriteErrLog("XHMicroLessonSystemWindow(设置保存事件报错:)" + ex.Message,ex);
|
685
|
692
|
}
|
686
|
693
|
}
|
687
|
694
|
/// <summary>
|
|
@@ -986,7 +993,7 @@ namespace XHWK.WKTool
|
986
|
993
|
};
|
987
|
994
|
|
988
|
995
|
|
989
|
|
- APP.myloading.Show();
|
|
996
|
+ //APP.myloading.Show();
|
990
|
997
|
APP.BackgroundWorkerHelper.RunWorkerAsync(InvokeServering, InvokeServerCompate);
|
991
|
998
|
|
992
|
999
|
|
|
@@ -1019,13 +1026,16 @@ namespace XHWK.WKTool
|
1019
|
1026
|
Dispatcher.Invoke(new Action(() =>
|
1020
|
1027
|
{
|
1021
|
1028
|
result = ofd.ShowDialog();
|
1022
|
|
- if (result == System.Windows.Forms.DialogResult.OK)
|
|
1029
|
+ }));
|
|
1030
|
+ if (result == System.Windows.Forms.DialogResult.OK)
|
1023
|
1031
|
{
|
1024
|
1032
|
if (ofd.FileName != "")
|
|
1033
|
+ {
|
|
1034
|
+ Dispatcher.Invoke(new Action(() =>
|
1025
|
1035
|
{
|
1026
|
1036
|
APP.myloading.Show();
|
1027
|
|
-
|
1028
|
1037
|
myblackboard.changepage(APP.pageData.pagenum);
|
|
1038
|
+ }));
|
1029
|
1039
|
#region PPT转PDF
|
1030
|
1040
|
string filepath = ofd.FileName;
|
1031
|
1041
|
string path = ofd.SafeFileName.Replace(".ppt", "").Replace(".pptx", "").Trim();
|
|
@@ -1077,8 +1087,11 @@ namespace XHWK.WKTool
|
1077
|
1087
|
File.Delete(filePathOutPut);
|
1078
|
1088
|
}
|
1079
|
1089
|
}
|
1080
|
|
- #endregion
|
1081
|
|
- string[] page = images.ToArray();
|
|
1090
|
+ #endregion
|
|
1091
|
+
|
|
1092
|
+ Dispatcher.Invoke(new Action(() =>
|
|
1093
|
+ {
|
|
1094
|
+ string[] page = images.ToArray();
|
1082
|
1095
|
int num = 0;
|
1083
|
1096
|
for (int i = 0 + APP.pageData.pagenum; i < page.Length + APP.pageData.pagenum; i++)//给画板模型加图片路径
|
1084
|
1097
|
{
|
|
@@ -1101,6 +1114,7 @@ namespace XHWK.WKTool
|
1101
|
1114
|
};
|
1102
|
1115
|
APP.PageDrawList.Add(model_DrawData);
|
1103
|
1116
|
}
|
|
1117
|
+
|
1104
|
1118
|
ImgPrint.Visibility = Visibility.Visible;//导入成功可打印
|
1105
|
1119
|
ImgPrintTwo.Visibility = Visibility.Collapsed;
|
1106
|
1120
|
btnPrint.IsEnabled = true;
|
|
@@ -1130,11 +1144,11 @@ namespace XHWK.WKTool
|
1130
|
1144
|
ImgScreenshotTwo.Visibility = Visibility.Collapsed;
|
1131
|
1145
|
btnScreenshot.IsEnabled = true;
|
1132
|
1146
|
}
|
1133
|
|
- APP.myloading.Hide();
|
1134
|
|
- }
|
|
1147
|
+
|
|
1148
|
+ }));
|
|
1149
|
+ }
|
1135
|
1150
|
catch (Exception ex)
|
1136
|
1151
|
{
|
1137
|
|
- APP.myloading.Hide();
|
1138
|
1152
|
MessageWindow.Show("文件无效或者文件被加密!");
|
1139
|
1153
|
LogHelper.WriteErrLog("【打开ppt】(OpenDialog PPT)" + ex.Message, ex);
|
1140
|
1154
|
}
|
|
@@ -1238,6 +1252,8 @@ namespace XHWK.WKTool
|
1238
|
1252
|
string paths = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
|
1239
|
1253
|
string[] page = ConvertWordToImage(filepath, paths, "", 0, 0, null, 0).ToArray();
|
1240
|
1254
|
int num = 0;
|
|
1255
|
+ Dispatcher.Invoke(new Action(() =>
|
|
1256
|
+ {
|
1241
|
1257
|
for (int i = 0 + APP.pageData.pagenum; i < page.Length + APP.pageData.pagenum; i++)//给画板模型加图片路径
|
1242
|
1258
|
{
|
1243
|
1259
|
if (APP.PageDrawList != null && APP.PageDrawList.Count > i)
|
|
@@ -1290,8 +1306,9 @@ namespace XHWK.WKTool
|
1290
|
1306
|
ImgScreenshotTwo.Visibility = Visibility.Collapsed;
|
1291
|
1307
|
btnScreenshot.IsEnabled = true;
|
1292
|
1308
|
}
|
1293
|
|
- APP.myloading.Hide();
|
1294
|
|
- }
|
|
1309
|
+
|
|
1310
|
+ }));
|
|
1311
|
+ }
|
1295
|
1312
|
catch (Exception ex)
|
1296
|
1313
|
{
|
1297
|
1314
|
APP.myloading.Hide();
|
|
@@ -1300,31 +1317,6 @@ namespace XHWK.WKTool
|
1300
|
1317
|
}
|
1301
|
1318
|
}
|
1302
|
1319
|
}
|
1303
|
|
- }
|
1304
|
|
- ));
|
1305
|
|
-
|
1306
|
|
-
|
1307
|
|
-
|
1308
|
|
-
|
1309
|
|
-
|
1310
|
|
-
|
1311
|
|
-
|
1312
|
|
-
|
1313
|
|
-
|
1314
|
|
-
|
1315
|
|
-
|
1316
|
|
-
|
1317
|
|
-
|
1318
|
|
-
|
1319
|
|
-
|
1320
|
|
-
|
1321
|
|
-
|
1322
|
|
-
|
1323
|
|
-
|
1324
|
|
-
|
1325
|
|
-
|
1326
|
|
-
|
1327
|
|
-
|
1328
|
1320
|
//OpenDialog();
|
1329
|
1321
|
return "";
|
1330
|
1322
|
}
|
|
@@ -1335,7 +1327,7 @@ namespace XHWK.WKTool
|
1335
|
1327
|
public void InvokeServerCompate(object obj)
|
1336
|
1328
|
{
|
1337
|
1329
|
//APP.myloading.Hide();
|
1338
|
|
-
|
|
1330
|
+ APP.myloading.Hide();
|
1339
|
1331
|
}
|
1340
|
1332
|
/// <summary>
|
1341
|
1333
|
/// 导入文档
|
|
@@ -1641,11 +1633,7 @@ namespace XHWK.WKTool
|
1641
|
1633
|
/// <param name="e"></param>
|
1642
|
1634
|
private void BtnUpload_Click(object sender, RoutedEventArgs e)
|
1643
|
1635
|
{
|
1644
|
|
- if (APP.IsLoginType == false)
|
1645
|
|
- {
|
1646
|
|
- Login();
|
1647
|
|
- return;
|
1648
|
|
- }
|
|
1636
|
+
|
1649
|
1637
|
if (gridUpload.Visibility == Visibility.Visible)
|
1650
|
1638
|
{
|
1651
|
1639
|
gridUpload.Visibility = Visibility.Collapsed;
|
|
@@ -1845,6 +1833,11 @@ namespace XHWK.WKTool
|
1845
|
1833
|
/// <param name="e"></param>
|
1846
|
1834
|
private void BtnUploads_Click(object sender, RoutedEventArgs e)
|
1847
|
1835
|
{
|
|
1836
|
+ if (APP.IsLoginType == false)
|
|
1837
|
+ {
|
|
1838
|
+ Login();
|
|
1839
|
+ return;
|
|
1840
|
+ }
|
1848
|
1841
|
pageData.menuList[Subscript].IsEnabled = false;
|
1849
|
1842
|
List<System.Windows.Controls.Button> buttons = FindChilds<System.Windows.Controls.Button>(listView1, "btnUpload");
|
1850
|
1843
|
for (int i = 0; i < buttons.Count; i++)
|
|
@@ -3043,15 +3036,15 @@ namespace XHWK.WKTool
|
3043
|
3036
|
{
|
3044
|
3037
|
txbLoginType.Text = APP.UserInfo.Username;
|
3045
|
3038
|
|
3046
|
|
- ImgUpload.Visibility = Visibility.Visible;
|
3047
|
|
- ImgUploadTwo.Visibility = Visibility.Collapsed;
|
|
3039
|
+ //ImgUpload.Visibility = Visibility.Visible;
|
|
3040
|
+ //ImgUploadTwo.Visibility = Visibility.Collapsed;
|
3048
|
3041
|
}
|
3049
|
3042
|
else
|
3050
|
3043
|
{
|
3051
|
3044
|
txbLoginType.Text = "未登录";
|
3052
|
3045
|
|
3053
|
|
- ImgUpload.Visibility = Visibility.Collapsed;
|
3054
|
|
- ImgUploadTwo.Visibility = Visibility.Visible;
|
|
3046
|
+ //ImgUpload.Visibility = Visibility.Collapsed;
|
|
3047
|
+ //ImgUploadTwo.Visibility = Visibility.Visible;
|
3055
|
3048
|
}
|
3056
|
3049
|
}
|
3057
|
3050
|
/// <summary>
|
|
@@ -4545,5 +4538,17 @@ namespace XHWK.WKTool
|
4545
|
4538
|
{
|
4546
|
4539
|
HideAngleBorder();
|
4547
|
4540
|
}
|
|
4541
|
+ /// <summary>
|
|
4542
|
+ /// 鼠标左键点击事件
|
|
4543
|
+ /// </summary>
|
|
4544
|
+ /// <param name="sender"></param>
|
|
4545
|
+ /// <param name="e"></param>
|
|
4546
|
+ private void Window_MouseLeftButtonDown_1(object sender, MouseButtonEventArgs e)
|
|
4547
|
+ {
|
|
4548
|
+ if (RectImgBorder.Visibility != Visibility.Hidden)
|
|
4549
|
+ {
|
|
4550
|
+ HideAngleBorder();
|
|
4551
|
+ }
|
|
4552
|
+ }
|
4548
|
4553
|
}
|
4549
|
4554
|
}
|