Browse Source

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

tags/录制修改前
耀 4 years ago
parent
commit
6f691344d4

+ 2
- 2
XHWK.Model/Properties/AssemblyInfo.cs View File

@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
31 31
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
32 32
 //通过使用 "*",如下所示:
33 33
 // [assembly: AssemblyVersion("1.0.*")]
34
-[assembly: AssemblyVersion("1.1.1.0")]
35
-[assembly: AssemblyFileVersion("1.1.1.0")]
34
+[assembly: AssemblyVersion("1.1.3.0")]
35
+[assembly: AssemblyFileVersion("1.1.3.0")]

+ 3
- 3
XHWK.WKTool/App.config View File

@@ -4,7 +4,7 @@
4 4
         <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5 5
     </startup>
6 6
   <appSettings>
7
-    <add key="IsDebug" value="1"/>
7
+    <add key="IsDebug" value="0"/>
8 8
     <!--图片压缩等级-->
9 9
     <add key="ImageCompressionLevel" value="30" />
10 10
     <!--文件存放路径  路径\账户名\讲解名称_x.MP4-->
@@ -32,7 +32,7 @@
32 32
     <!--上传每片大小 Mb-->
33 33
     <add key="UploadSliceLen" value="1"/>
34 34
     <!--版本号-->
35
-    <add key="VersionCode" value="12"/>
36
-    <add key="VersionName" value="1.1.1"/>
35
+    <add key="VersionCode" value="14"/>
36
+    <add key="VersionName" value="1.1.3"/>
37 37
   </appSettings>
38 38
 </configuration>

+ 10
- 1
XHWK.WKTool/UploadWindow.xaml.cs View File

@@ -8,6 +8,7 @@ using System.Windows.Input;
8 8
 
9 9
 using XHWK.Model;
10 10
 using XHWK.WKTool.DAL;
11
+using static XHWK.WKTool.XHMicroLessonSystemWindow;
11 12
 
12 13
 namespace XHWK.WKTool
13 14
 {
@@ -40,6 +41,12 @@ namespace XHWK.WKTool
40 41
         /// 唯一编号
41 42
         /// </summary>
42 43
         private string Guid = string.Empty;
44
+        //定义事件
45
+        public event ChangeTextHandlers ChangeTextEvents;
46
+        /// <summary>
47
+        /// 当前视频的下标
48
+        /// </summary>
49
+       private int i = 0;
43 50
         public UploadWindow()
44 51
         {
45 52
             InitializeComponent();
@@ -47,8 +54,9 @@ namespace XHWK.WKTool
47 54
         /// <summary>
48 55
         /// 初始化
49 56
         /// </summary>
50
-        public void Initialize(string _resourcename, long _resourcesize, string _suffix, string _guid)
57
+        public void Initialize(string _resourcename, long _resourcesize, string _suffix, string _guid,int _i)
51 58
         {
59
+            i = _i;
52 60
             Resourcename = _resourcename;
53 61
             Resourcesize = _resourcesize;
54 62
             Suffix = _suffix;
@@ -247,6 +255,7 @@ namespace XHWK.WKTool
247 255
                     if (code == 0)
248 256
                     {
249 257
                         MessageWindow.Show("视频上传成功!");
258
+                        ChangeTextEvents("上传成功",i);
250 259
                         Hide();
251 260
                     }
252 261
                     else

+ 203
- 112
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

@@ -52,6 +52,8 @@ namespace XHWK.WKTool
52 52
         public event ChangeTextHandler ChangeTextEvent;
53 53
         //定义委托
54 54
         public delegate void ChangeTextHandler(string text);
55
+        //定义委托
56
+        public delegate void ChangeTextHandlers(string text, int i); 
55 57
 
56 58
         /// <summary>
57 59
         /// 图片
@@ -113,6 +115,7 @@ namespace XHWK.WKTool
113 115
         public XHMicroLessonSystemWindow()
114 116
         {
115 117
             new Aspose.Pdf.License().SetLicense(new MemoryStream(Convert.FromBase64String("PExpY2Vuc2U+CiAgPERhdGE+CiAgICA8TGljZW5zZWRUbz5TdXpob3UgQXVuYm94IFNvZnR3YXJlIENvLiwgTHRkLjwvTGljZW5zZWRUbz4KICAgIDxFbWFpbFRvPnNhbGVzQGF1bnRlYy5jb208L0VtYWlsVG8+CiAgICA8TGljZW5zZVR5cGU+RGV2ZWxvcGVyIE9FTTwvTGljZW5zZVR5cGU+CiAgICA8TGljZW5zZU5vdGU+TGltaXRlZCB0byAxIGRldmVsb3BlciwgdW5saW1pdGVkIHBoeXNpY2FsIGxvY2F0aW9uczwvTGlj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c0cwd1ZDcnp6MytVYk9iQjRYUndTZWxsTFdXeXNDL0haTDNpN01SMC9jZUFxaVZFOU0rWndOQkR4RnlRbE9uYTFQajhQMzhzR1grQ3ZsemJLZFZPZXk1S3A2dDN5c0dqYWtaL1E9PC9TaWduYXR1cmU+CjwvTGljZW5zZT4=")));
116 119
             InitializeComponent();
117 120
             double proportion = 1036.0 / 1290.0;
118 121
             Width = (PrimaryScreen.ScaleWorkingAreaSize.Height) / proportion - (BorderThickness.Left + BorderThickness.Right);
@@ -459,86 +462,95 @@ namespace XHWK.WKTool
459 462
         {
460 463
             if (!TxbRecordingWord.Text.Equals("暂停"))
461 464
             {
462
-                GridMain.Visibility = Visibility.Collapsed;
463
-                gridSetUp.Visibility = Visibility.Visible;
464
-                gridUpload.Visibility = Visibility.Collapsed;
465
-                txbStoragePath.Content = APP.WKData.WkPath;
466
-                //ImgRecord.Visibility = Visibility.Collapsed;//设置时不可录制
467
-                //ImgRecordTwo.Visibility = Visibility.Visible;//设置时不可录制
468
-                //BtnRecord.IsEnabled = false;//设置时不可录制
469
-
470
-
471
-
472
-                #region 读取用户配置
473
-                //接口地址
474
-                if (!File.Exists(APP.dataPath + "interfaceAddress.txt")) //若为空
475
-                {
476
-                    txbInterfaceAddress.Text = APP.apiUrl.Replace("http://", "").Trim();
477
-                }
478
-                else
465
+                if(gridSetUp.Visibility==Visibility.Collapsed)
479 466
                 {
480
-                    txbInterfaceAddress.Text = System.IO.File.ReadAllText(APP.dataPath + "interfaceAddress.txt", Encoding.Default).Replace("http://", "").Trim();
481
-                }
482
-                //上传地址
483
-                if (!File.Exists(APP.dataPath + "imageUploadAddress.txt")) //若为空
484
-                {
485
-                    txbImageUploadAddress.Text = APP.uploadUrl.Replace("http://", "").Replace("/", "").Trim();
486
-                }
487
-                else
488
-                {
489
-                    txbImageUploadAddress.Text = System.IO.File.ReadAllText(APP.dataPath + "imageUploadAddress.txt", Encoding.Default).Replace("http://", "").Replace("/", "").Trim();
490
-                }
491
-                //下载地址
492
-                if (!File.Exists(APP.dataPath + "pictureShowsAddress.txt")) //若为空
493
-                {
494
-                    txbPictureShowsAddress.Text = APP.showImageUrl.Replace("http://", "").Replace("/", "").Replace("static", "").Trim();
495
-                }
496
-                else
497
-                {
498
-                    txbPictureShowsAddress.Text = System.IO.File.ReadAllText(APP.dataPath + "pictureShowsAddress.txt", Encoding.Default).Replace("http://", "").Replace("/", "").Replace("static", "").Trim();
499
-                }
500
-           
467
+                    GridMain.Visibility = Visibility.Collapsed;
468
+                    gridSetUp.Visibility = Visibility.Visible;
469
+                    gridUpload.Visibility = Visibility.Collapsed;
470
+                    txbStoragePath.Content = APP.WKData.WkPath;
471
+
472
+                    #region 读取用户配置
473
+                    //接口地址
474
+                    if (!File.Exists(APP.dataPath + "interfaceAddress.txt")) //若为空
475
+                    {
476
+                        txbInterfaceAddress.Text = APP.apiUrl.Replace("http://", "").Trim();
477
+                    }
478
+                    else
479
+                    {
480
+                        txbInterfaceAddress.Text = System.IO.File.ReadAllText(APP.dataPath + "interfaceAddress.txt", Encoding.Default).Replace("http://", "").Trim();
481
+                    }
482
+                    //上传地址
483
+                    if (!File.Exists(APP.dataPath + "imageUploadAddress.txt")) //若为空
484
+                    {
485
+                        txbImageUploadAddress.Text = APP.uploadUrl.Replace("http://", "").Replace("/", "").Trim();
486
+                    }
487
+                    else
488
+                    {
489
+                        txbImageUploadAddress.Text = System.IO.File.ReadAllText(APP.dataPath + "imageUploadAddress.txt", Encoding.Default).Replace("http://", "").Replace("/", "").Trim();
490
+                    }
491
+                    //下载地址
492
+                    if (!File.Exists(APP.dataPath + "pictureShowsAddress.txt")) //若为空
493
+                    {
494
+                        txbPictureShowsAddress.Text = APP.showImageUrl.Replace("http://", "").Replace("/", "").Replace("static", "").Trim();
495
+                    }
496
+                    else
497
+                    {
498
+                        txbPictureShowsAddress.Text = System.IO.File.ReadAllText(APP.dataPath + "pictureShowsAddress.txt", Encoding.Default).Replace("http://", "").Replace("/", "").Replace("static", "").Trim();
499
+                    }
501 500
 
502
-                ///  < !--摄像头位置 1.右上 2.左上 3.右下 4.左下-- >
503
-                if ("1".Equals(APP.CameraPosition))
504
-                {
505
-                    rbnRight.IsChecked = true;
506
-                }
507
-                else if ("2".Equals(APP.CameraPosition))
508
-                {
509
-                    rbnLeft.IsChecked = true;
510
-                }
511
-                else if ("3".Equals(APP.CameraPosition))
512
-                {
513
-                    rbnRightUnder.IsChecked = true;
514
-                }
515
-                else if ("4".Equals(APP.CameraPosition))
516
-                {
517
-                    rbnLeftUnder.IsChecked = true;
518
-                }
519
-                string type = FileToolsCommon.GetConfigValue("VideoType");//<!--视频格式 1、MP4 2、FlV 3、AVI-->
520
-                if ("1".Equals(type))
521
-                {
522
-                    rbnMP4.IsChecked = true;
523
-                }
524
-                else if ("2".Equals(type))
525
-                {
526
-                    rbnFLV.IsChecked = true;
527
-                }
528
-                else if ("3".Equals(type))
529
-                {
530
-                    rbnAVI.IsChecked = true;
531
-                }
532
-                string isSound = FileToolsCommon.GetConfigValue("IsSound");//<!--声音 true 有 false 无-->
533
-                if (isSound == "true")
534
-                {
535
-                    rbnY.IsChecked = true;
501
+
502
+                    ///  < !--摄像头位置 1.右上 2.左上 3.右下 4.左下-- >
503
+                    if ("1".Equals(APP.CameraPosition))
504
+                    {
505
+                        rbnRight.IsChecked = true;
506
+                    }
507
+                    else if ("2".Equals(APP.CameraPosition))
508
+                    {
509
+                        rbnLeft.IsChecked = true;
510
+                    }
511
+                    else if ("3".Equals(APP.CameraPosition))
512
+                    {
513
+                        rbnRightUnder.IsChecked = true;
514
+                    }
515
+                    else if ("4".Equals(APP.CameraPosition))
516
+                    {
517
+                        rbnLeftUnder.IsChecked = true;
518
+                    }
519
+                    string type = FileToolsCommon.GetConfigValue("VideoType");//<!--视频格式 1、MP4 2、FlV 3、AVI-->
520
+                    if ("1".Equals(type))
521
+                    {
522
+                        rbnMP4.IsChecked = true;
523
+                    }
524
+                    else if ("2".Equals(type))
525
+                    {
526
+                        rbnFLV.IsChecked = true;
527
+                    }
528
+                    else if ("3".Equals(type))
529
+                    {
530
+                        rbnAVI.IsChecked = true;
531
+                    }
532
+                    string isSound = FileToolsCommon.GetConfigValue("IsSound");//<!--声音 true 有 false 无-->
533
+                    if (isSound == "true")
534
+                    {
535
+                        rbnY.IsChecked = true;
536
+                    }
537
+                    else
538
+                    {
539
+                        rbnN.IsChecked = true;
540
+                    }
541
+                    #endregion
536 542
                 }
537 543
                 else
538 544
                 {
539
-                    rbnN.IsChecked = true;
545
+                    GridMain.Visibility = Visibility.Visible;
546
+                    gridSetUp.Visibility = Visibility.Collapsed;
547
+                    gridUpload.Visibility = Visibility.Collapsed;
548
+                    if (APP.pageData.pagenum > 0)
549
+                    {
550
+                        gridPage.Visibility = Visibility.Visible;
551
+                    }
552
+                    DataContext = APP.pageData;
540 553
                 }
541
-                #endregion
542 554
             }
543 555
         }
544 556
         /// <summary>
@@ -548,34 +560,6 @@ namespace XHWK.WKTool
548 560
         /// <param name="e"></param>
549 561
         private void BtnSave_Click(object sender, RoutedEventArgs e)
550 562
         {
551
-            #region 合法性判断
552
-            //if (string.IsNullOrWhiteSpace(txbStoragePath.Text.Trim()))
553
-            //{
554
-            //    MessageWindow.Show("路径不可为空!");
555
-            //    return;
556
-            //}
557
-            //string temp = FileToolsCommon.GetLegalPath(txbStoragePath.Text) + APP.WKData.WkName.Trim() + "/";
558
-            //if (!APP.WKData.WkPath.Equals(temp))
559
-            //{
560
-            //    APP.WKData.WkPath = FileToolsCommon.GetLegalPath(txbStoragePath.Text) + APP.WKData.WkName.Trim() + "/";
561
-            //    if (FileToolsCommon.IsExistDirectory(APP.WKData.WkPath))
562
-            //    {
563
-            //        //微课已存在
564
-            //        MessageBoxResult dr = MessageWindow.Show("讲解已存在是否覆盖?", "提示", MessageBoxButton.OKCancel);
565
-            //        if (dr == MessageBoxResult.OK)
566
-            //        {
567
-            //            FileToolsCommon.DeleteDirectory(APP.WKData.WkPath);
568
-            //        }
569
-            //        else
570
-            //        {
571
-            //            return;
572
-            //        }
573
-            //    }
574
-            //    //创建文件夹
575
-            //    FileToolsCommon.CreateDirectory(APP.WKData.WkPath);
576
-            //}
577
-            #endregion
578
-
579 563
             ImgRecord.Visibility = Visibility.Visible;//设置结束时可录制
580 564
             ImgRecordTwo.Visibility = Visibility.Collapsed;//设置结束时可录制
581 565
             BtnRecord.IsEnabled = true;//设置结束时可录制
@@ -985,7 +969,7 @@ namespace XHWK.WKTool
985 969
                 ofd = new System.Windows.Forms.OpenFileDialog
986 970
                 {
987 971
                     //Filter = "文档|*.docx;*.doc;*.ppt;*.pptx",
988
-                    Filter = "文档|*.docx;*.doc;*.pptx",
972
+                    Filter = "文档|*.docx;*.doc;*.ppt;*.pptx;*.pdf",
989 973
                     InitialDirectory = desktopPath,
990 974
                     Multiselect = false,
991 975
                     AddExtension = true,
@@ -1027,13 +1011,15 @@ namespace XHWK.WKTool
1027 1011
                     #region PPT转PDF
1028 1012
                     string filepath = ofd.FileName;
1029 1013
                     string path = ofd.SafeFileName.Replace(".ppt", "").Replace(".pptx", "").Trim();
1030
-                    string type = ofd.SafeFileName.Replace(".ppt", "typezsygppt").Replace(".pptx", "typezsygppt").Trim();
1014
+                    string type = ofd.SafeFileName.Replace(".ppt", "typezsygppt").Replace(".pptx", "typezsygppt").Replace(".pdf", "typepdf").Trim();
1031 1015
                     if (type.Contains("typezsygppt"))//ppt
1032 1016
                     {
1033 1017
                         try
1034 1018
                         {
1035 1019
                             string pathTemp = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
1036 1020
                             path = pathTemp + path + ".pdf";
1021
+                            FileToolsCommon.CreateDirectory(pathTemp);
1022
+
1037 1023
                             //PPT转PDF
1038 1024
                             Presentation ppt = new Presentation(filepath);
1039 1025
                             ppt.Save(path, Aspose.Slides.Export.SaveFormat.Pdf);
@@ -1135,6 +1121,98 @@ namespace XHWK.WKTool
1135 1121
                             LogHelper.WriteErrLog("【打开ppt】(OpenDialog PPT)" + ex.Message, ex);
1136 1122
                         }
1137 1123
                     }
1124
+                    else if(type.Contains("typepdf"))
1125
+                    {
1126
+                        string pathTemp = AppDomain.CurrentDomain.BaseDirectory + "Temp\\";
1127
+                        #region PDF转图片
1128
+                        // 图片绝对路径集合
1129
+                        List<string> images = new List<string>();
1130
+                        string directoryPath = pathTemp;
1131
+                        //aspose许可证
1132
+                        //Aspose.Pdf.License l = new Aspose.Pdf.License();
1133
+                        //string licenseName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Aspose.Total.Product.Family.lic");
1134
+                        //l.SetLicense(licenseName);
1135
+                        //定义Jpeg转换设备
1136
+                        Aspose.Pdf.Document document = new Aspose.Pdf.Document(filepath);
1137
+                        Aspose.Pdf.Devices.JpegDevice device = new Aspose.Pdf.Devices.JpegDevice();
1138
+                        //int quality = int.Parse(this.comboBox1.SelectedItem.ToString());
1139
+                        //directoryPath += quality;
1140
+                        Directory.CreateDirectory(directoryPath);
1141
+                        //默认质量为100,设置质量的好坏与处理速度不成正比,甚至是设置的质量越低反而花的时间越长,怀疑处理过程是先生成高质量的再压缩
1142
+                        device = new Aspose.Pdf.Devices.JpegDevice(100);
1143
+                        //遍历每一页转为jpg
1144
+                        for (int i = 1; i <= document.Pages.Count; i++)
1145
+                        {
1146
+                            long ii = Timestamp();
1147
+                            string filePathOutPut = Path.Combine(directoryPath, string.Format("{0}{1}.jpg", ii, i));
1148
+                            images.Add(filePathOutPut);
1149
+                            FileStream fs = new FileStream(filePathOutPut, FileMode.OpenOrCreate);
1150
+                            try
1151
+                            {
1152
+                                device.Process(document.Pages[i], fs);
1153
+                                fs.Close();
1154
+                            }
1155
+                            catch (Exception)
1156
+                            {
1157
+                                fs.Close();
1158
+                                File.Delete(filePathOutPut);
1159
+                            }
1160
+                        }
1161
+                        #endregion
1162
+                        string[] page = images.ToArray();
1163
+                        int num = 0;
1164
+                        for (int i = 0 + APP.pageData.pagenum; i < page.Length + APP.pageData.pagenum; i++)//给画板模型加图片路径
1165
+                        {
1166
+                            if (APP.PageDrawList != null && APP.PageDrawList.Count > i)
1167
+                            {
1168
+                                APP.PageDrawList[i].PageImagePath = page[i - APP.pageData.pagenum]; //zxycs
1169
+                                APP.PageDrawList[i].PdfImagePath = page[i - APP.pageData.pagenum];
1170
+                                APP.PageDrawList[i].PageNum = i + 1;
1171
+                                APP.PageDrawList[i].ImgDocumentation = true;
1172
+                            }
1173
+                            else
1174
+                            {
1175
+
1176
+                                Model_DrawData model_DrawData = new Model_DrawData
1177
+                                {
1178
+                                    PageImagePath = page[i - APP.pageData.pagenum],
1179
+                                    PdfImagePath = page[i - APP.pageData.pagenum],
1180
+                                    PageNum = i + 1,
1181
+                                    ImgDocumentation = true
1182
+                                };
1183
+                                APP.PageDrawList.Add(model_DrawData);
1184
+                            }
1185
+                            ImgPrint.Visibility = Visibility.Visible;//导入成功可打印
1186
+                            ImgPrintTwo.Visibility = Visibility.Collapsed;
1187
+                            btnPrint.IsEnabled = true;
1188
+                            APP.SaveDraw();
1189
+                            num++;
1190
+                        }
1191
+                        if (num > 0)
1192
+                        {
1193
+                            APP.pageData.currpage = APP.pageData.pagenum + 1;
1194
+                            APP.pageData.pagenum += num;
1195
+                            gridPage.Visibility = Visibility.Visible;//页码大于0 显示
1196
+                        }
1197
+                        if (APP.pageData.currpage > 0 && APP.pageData.currpage < APP.PageDrawList.Count)
1198
+                        {
1199
+                            imgCanvas.Source = null;
1200
+                            ImgScreenshot.Visibility = Visibility.Collapsed;//当前页为导入时不可截图
1201
+                            ImgScreenshotTwo.Visibility = Visibility.Visible;
1202
+                            btnScreenshot.IsEnabled = false;
1203
+                            imgDocumentation.Source = new BitmapImage(new Uri(APP.PageDrawList[APP.pageData.currpage - 1].PageImagePath));//给当前页面展示图片
1204
+                        }
1205
+                        else
1206
+                        {
1207
+                            imgDocumentation.Source = null;
1208
+                            imgCanvas.Source = null;
1209
+                            ///截图可用
1210
+                            ImgScreenshot.Visibility = Visibility.Visible;
1211
+                            ImgScreenshotTwo.Visibility = Visibility.Collapsed;
1212
+                            btnScreenshot.IsEnabled = true;
1213
+                        }
1214
+                        APP.myloading.Hide();
1215
+                    }
1138 1216
                     else//word
1139 1217
                     {
1140 1218
                         try
@@ -1405,6 +1483,8 @@ namespace XHWK.WKTool
1405 1483
                 LogHelper.WriteErrLog("【加载视频列表】(LoadingVideoList)" + ex.Message, ex);
1406 1484
             }
1407 1485
         }
1486
+        //定义事件
1487
+        public event ChangeTextHandler ChangeTextEvents;
1408 1488
         /// <summary>
1409 1489
         /// 上传
1410 1490
         /// </summary>
@@ -1422,10 +1502,7 @@ namespace XHWK.WKTool
1422 1502
 
1423 1503
                     if (dAL_Upload.UploadVideo(pageData.menuList[i].FileGuid, out string ErrMessage))
1424 1504
                     {
1425
-                        pageData.menuList[i].Visi = "Visible";
1426
-                        pageData.menuList[i].Coll = "Collapsed";
1427
-
1428
-                        DataContext = pageData;
1505
+                      
1429 1506
                         //MessageWindow.Show("视频上传服务器成功!");
1430 1507
                         if (APP.W_UploadWindow == null)
1431 1508
                         {
@@ -1433,13 +1510,12 @@ namespace XHWK.WKTool
1433 1510
                             {
1434 1511
                                 Owner = this
1435 1512
                             };
1513
+                            APP.W_UploadWindow.ChangeTextEvents += new ChangeTextHandlers(frm_ChangeTextEvents);
1436 1514
                         }
1437 1515
                       
1438 1516
                         //long size = Convert.ToInt64(FileToolsCommon.GetFileSizeByMB(pageData.menuList[i].FilePath));
1439
-                        APP.W_UploadWindow.Initialize(pageData.menuList[i].VideoName, pageData.menuList[i].VideoSizes, pageData.menuList[i].VideoType, pageData.menuList[i].FileGuid);
1517
+                        APP.W_UploadWindow.Initialize(pageData.menuList[i].VideoName, pageData.menuList[i].VideoSizes, pageData.menuList[i].VideoType, pageData.menuList[i].FileGuid,i);
1440 1518
                         APP.W_UploadWindow.ShowDialog();
1441
-                    
1442
-
1443 1519
                     }
1444 1520
                     else
1445 1521
                     {
@@ -1449,6 +1525,20 @@ namespace XHWK.WKTool
1449 1525
             }
1450 1526
         }
1451 1527
         /// <summary>
1528
+        /// 上传返回事件
1529
+        /// </summary>
1530
+        /// <param name="text"></param>
1531
+        private void frm_ChangeTextEvents(string text,int i)
1532
+        {
1533
+            if ("上传成功".Equals(text))
1534
+            {
1535
+                pageData.menuList[i].Visi = "Visible";
1536
+                pageData.menuList[i].Coll = "Collapsed";
1537
+
1538
+                DataContext = pageData;
1539
+            }
1540
+        }
1541
+        /// <summary>
1452 1542
         /// 删除
1453 1543
         /// </summary>
1454 1544
         /// <param name="sender"></param>
@@ -1589,7 +1679,8 @@ namespace XHWK.WKTool
1589 1679
             {
1590 1680
                 try
1591 1681
                 {
1592
-                    bool isName = ModifyPathName(pageData.menuList[Subscript].FileGuid, pageData.menuList[Subscript].VideoName, out string Errmessage);
1682
+                    string newName = pageData.menuList[Subscript].VideoName +"."+ pageData.menuList[Subscript].VideoType;
1683
+                    bool isName = ModifyPathName(pageData.menuList[Subscript].FileGuid, newName, out string Errmessage);
1593 1684
                     if (!isName)
1594 1685
                     {
1595 1686
                         MessageWindow.Show(Errmessage);

+ 2
- 1
XHWK.WKTool/XHWK.WKTool.csproj View File

@@ -68,7 +68,8 @@
68 68
     <Reference Include="Aspose.PDF, Version=19.1.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
69 69
       <HintPath>..\packages\Aspose.PDF.19.1.0\lib\net4.0\Aspose.PDF.dll</HintPath>
70 70
     </Reference>
71
-    <Reference Include="Aspose.Slides">
71
+    <Reference Include="Aspose.Slides, Version=15.1.0.0, Culture=neutral, PublicKeyToken=00725b1ceb58d0a9, processorArchitecture=MSIL">
72
+      <SpecificVersion>False</SpecificVersion>
72 73
       <HintPath>..\dl\Aspose.Slides.dll</HintPath>
73 74
     </Reference>
74 75
     <Reference Include="Aspose.Words">

+ 1
- 0
XHWK.WKTool/packages.config View File

@@ -7,6 +7,7 @@
7 7
   <package id="AForge.Video" version="2.2.5" targetFramework="net452" />
8 8
   <package id="AForge.Video.DirectShow" version="2.2.5" targetFramework="net452" />
9 9
   <package id="Aspose.PDF" version="19.1.0" targetFramework="net452" />
10
+  <package id="Aspose.Slides.NET" version="19.10.0" targetFramework="net452" />
10 11
   <package id="iTextSharp" version="5.5.13.1" targetFramework="net452" />
11 12
   <package id="WpfAnimatedGif" version="2.0.0" targetFramework="net452" />
12 13
 </packages>

BIN
dl/Aspose.Slides.dll View File


Loading…
Cancel
Save