Browse Source

文件大小上传 修改

tags/录制修改前
zhangxueyang 4 years ago
parent
commit
b8b1f53eb4

+ 1
- 1
XHWK.Model/Model_Video.cs View File

@@ -83,7 +83,7 @@
83 83
     public enum Enum_VideoType
84 84
     {
85 85
         MP4 = 1,
86
-        FlV = 2,
86
+        FLV = 2,
87 87
         AVI = 3
88 88
     }
89 89
 

+ 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.0.0.0")]
35
-[assembly: AssemblyFileVersion("1.0.0.0")]
34
+[assembly: AssemblyVersion("1.0.9.0")]
35
+[assembly: AssemblyFileVersion("1.0.9.0")]

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

@@ -31,8 +31,8 @@
31 31
     <!--上传每片大小 Mb-->
32 32
     <add key="UploadSliceLen" value="1"/>
33 33
     <!--版本号-->
34
-    <add key="VersionCode" value="8"/>
35
-    <add key="VersionName" value="1.0.7"/>
34
+    <add key="VersionCode" value="10"/>
35
+    <add key="VersionName" value="1.0.9"/>
36 36
     
37 37
   </appSettings>
38 38
 </configuration>

+ 1
- 1
XHWK.WKTool/XHMicroLessonSystemWindow.xaml View File

@@ -60,7 +60,7 @@
60 60
                 <Grid>
61 61
                     <StackPanel Orientation="Horizontal"   HorizontalAlignment="Center"
62 62
                     VerticalAlignment="Center">
63
-                        <TextBox IsEnabled="{Binding IsEnabled}"
63
+                        <TextBox IsEnabled="{Binding IsEnabled,Mode=TwoWay}"
64 64
                     HorizontalAlignment="Center"
65 65
                     VerticalAlignment="Center"
66 66
                     FontSize="16" Height="30" Padding="0,5,0,0"

+ 62
- 30
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

@@ -1482,18 +1482,36 @@ namespace XHWK.WKTool
1482 1482
         {
1483 1483
             if (IsModify)
1484 1484
             {
1485
+                try
1486
+                {
1487
+                    bool isName = ModifyPathName(pageData.menuList[Subscript].FileGuid, pageData.menuList[Subscript].VideoName, out string Errmessage);
1488
+                    if (!isName)
1489
+                    {
1490
+                        MessageWindow.Show(Errmessage);
1491
+                    }
1492
+                }
1493
+                catch (Exception ex)
1494
+                {
1495
+                    LogHelper.WriteErrLog("XHMicroLessonSystemWindow(BtnModify_Click)" + ex.Message, ex);
1496
+                }
1497
+                IsModify = false;
1485 1498
                 pageData.menuList[Subscript].IsEnabled = false;
1499
+                listView1.DataContext = pageData;
1486 1500
             }
1487
-            List<System.Windows.Controls.Button> buttons = FindChilds<System.Windows.Controls.Button>(listView1, "btnModify");
1488
-            for (int i = 0; i < buttons.Count; i++)
1501
+            else
1489 1502
             {
1490
-                if (buttons[i] == sender)
1503
+                List<System.Windows.Controls.Button> buttons = FindChilds<System.Windows.Controls.Button>(listView1, "btnModify");
1504
+                for (int i = 0; i < buttons.Count; i++)
1491 1505
                 {
1492
-                    pageData.menuList[i].IsEnabled = true;
1493
-                    Subscript = i;
1494
-                    IsModify = true;
1506
+                    if (buttons[i] == sender)
1507
+                    {
1508
+                        pageData.menuList[i].IsEnabled = true;
1509
+                        Subscript = i;
1510
+                        IsModify = true;
1511
+                    }
1495 1512
                 }
1496 1513
             }
1514
+         
1497 1515
         }
1498 1516
 
1499 1517
         private int MouseNumber = 0;
@@ -1654,32 +1672,46 @@ namespace XHWK.WKTool
1654 1672
         private bool ModifyPathName(string FileGuid, string NewName, out string Errmessage)
1655 1673
         {
1656 1674
             Errmessage = "";
1657
-            Model_Video model_Video = APP.VideoList.Find(x => x.FileGuid == FileGuid);
1658
-            string filePathName = model_Video.VideoPath;
1659
-            string filePath = FileToolsCommon.GetDirectoryName(filePathName);
1660
-            string newFilePathName = filePath + NewName;
1661
-            //缩略图
1662
-            string ThumbnailPath = filePath + "ThumbnailPath/";
1663
-            FileToolsCommon.CreateDirectory(ThumbnailPath);
1664
-            //缩略图存储位置
1665
-            string ThumbnailPathName = ThumbnailPath + NewName.Replace(".", "") + ".JPG";
1666
-            if (FileToolsCommon.IsExistFile(newFilePathName))
1667
-            {
1668
-                Errmessage = "文件已存在,请重新修改文件名!";
1669
-                return false;
1670
-            }
1671
-            else
1675
+            foreach(Model_WKData WKData in APP.WKDataList)
1672 1676
             {
1673
-                //修改文件名
1674
-                FileToolsCommon.Copy(filePathName, newFilePathName);
1675
-                model_Video.VideoPath = newFilePathName;
1676
-                //修改缩略图名
1677
-                FileToolsCommon.DeleteFile(ThumbnailPathName);
1678
-                FileToolsCommon.Copy(model_Video.ThumbnailPath, ThumbnailPathName);
1679
-                model_Video.ThumbnailPath = ThumbnailPathName;
1680
-                APP.SaveWkData();
1681
-                return true;
1677
+                if (WKData.VideoList.Exists(x => x.FileGuid == FileGuid))
1678
+                {
1679
+
1680
+                    Model_Video model_Video = WKData.VideoList.Find(x => x.FileGuid == FileGuid);
1681
+
1682
+                    string filePathName = model_Video.VideoPath;
1683
+                    string filePath = FileToolsCommon.GetDirectoryName(filePathName);
1684
+                    string newFilePathName = filePath + NewName;
1685
+                    //缩略图
1686
+                    string ThumbnailPath = filePath + "ThumbnailPath/";
1687
+                    FileToolsCommon.CreateDirectory(ThumbnailPath);
1688
+                    //缩略图存储位置
1689
+                    string ThumbnailPathName = ThumbnailPath + NewName.Replace(".", "") + ".JPG";
1690
+                    if (FileToolsCommon.IsExistFile(newFilePathName))
1691
+                    {
1692
+                        Errmessage = "文件已存在,请重新修改文件名!";
1693
+                        return false;
1694
+                    }
1695
+                    else
1696
+                    {
1697
+                        //修改文件名
1698
+                        FileToolsCommon.Copy(filePathName, newFilePathName);
1699
+                        model_Video.VideoPath = newFilePathName;
1700
+                        //修改缩略图名
1701
+                        FileToolsCommon.DeleteFile(ThumbnailPathName);
1702
+                        FileToolsCommon.Copy(model_Video.ThumbnailPath, ThumbnailPathName);
1703
+                        model_Video.ThumbnailPath = ThumbnailPathName;
1704
+                        APP.SaveWkData();
1705
+                        return true;
1706
+                    }
1707
+                }
1708
+                else
1709
+                {
1710
+                    continue;
1711
+                }
1682 1712
             }
1713
+            Errmessage = "视频文件有改动,当前文件不存在,请关闭后重新打开“我的”";
1714
+            return false;
1683 1715
         }
1684 1716
 
1685 1717
         #endregion

Loading…
Cancel
Save