Bladeren bron

zhao:删除视频

tags/录制修改前
耀 4 jaren geleden
bovenliggende
commit
8cdd682ea7
2 gewijzigde bestanden met toevoegingen van 25 en 8 verwijderingen
  1. 4
    7
      XHWK.WKTool/App.cs
  2. 21
    1
      XHWK.WKTool/FileDirectoryWindow.xaml.cs

+ 4
- 7
XHWK.WKTool/App.cs Bestand weergeven

@@ -9,6 +9,7 @@ using System.Security.Principal;
9 9
 using System.Security.RightsManagement;
10 10
 using System.Threading;
11 11
 using System.Windows;
12
+using System.Windows.Documents;
12 13
 using System.Windows.Threading;
13 14
 
14 15
 using TStudyDigitalPen.HID;
@@ -142,6 +143,7 @@ namespace XHWK.WKTool
142 143
                     // 定义Application对象作为整个应用程序入口
143 144
                     Application app = new Application();
144 145
                     app.Run(W_CreateAMicroLessonWindow);
146
+                    //Application.Run(W_CreateAMicroLessonWindow);
145 147
                 }
146 148
                 else
147 149
                 {
@@ -161,7 +163,8 @@ namespace XHWK.WKTool
161 163
                         return;
162 164
                     }
163 165
                     //退出
164
-                    Application.Current.Shutdown();
166
+                    //Current.Shutdown();
167
+                    Environment.Exit(0);
165 168
 
166 169
                 }
167 170
                 #endregion
@@ -172,12 +175,6 @@ namespace XHWK.WKTool
172 175
                 string ErrMessage = "【进程】(Main):进程意外关闭。 " + ex.Message;
173 176
                 LogHelper.WriteErrLog(ErrMessage, ex);
174 177
             }
175
-
176
-            //app.DispatcherUnhandledException += MyApp_DispatcherUnhandledException;
177
-            //Application app = new Application();
178
-            //W_CreateAMicroLessonWindow = new CreateAMicroLessonWindow();
179
-            //app.Run(W_CreateAMicroLessonWindow);
180
-            //LogHelper.WriteInfoLog("启动项目");
181 178
             StopSameProcess();
182 179
             Killffmpeg();
183 180
             LatticeFileHelper.RunPrintConfig();

+ 21
- 1
XHWK.WKTool/FileDirectoryWindow.xaml.cs Bestand weergeven

@@ -165,7 +165,27 @@ namespace XHWK.WKTool
165 165
             {
166 166
                 if (buttons[i] == sender)
167 167
                 {
168
-
168
+                    foreach (Model_WKData wKData in APP.WKDataList)
169
+                    {
170
+                        if (wKData.VideoList == null)
171
+                            continue;
172
+                        if(wKData.VideoList.Exists(x=>x.FileGuid==pageData.menuList[i].FileGuid))
173
+                        {
174
+                            try
175
+                            {
176
+                                FileToolsCommon.DeleteFile(wKData.VideoList.Find(x => x.FileGuid == pageData.menuList[i].FileGuid).VideoPath);
177
+                                FileToolsCommon.DeleteFile(wKData.VideoList.Find(x => x.FileGuid == pageData.menuList[i].FileGuid).ThumbnailPath);
178
+                                wKData.VideoList.Remove(wKData.VideoList.Find(x => x.FileGuid == pageData.menuList[i].FileGuid));
179
+                                Initialize();
180
+                                return;
181
+                            }
182
+                            catch (Exception ex)
183
+                            {
184
+                                MessageBox.Show("无法删除视频!"+ex.Message);
185
+                                return;
186
+                            }
187
+                        }
188
+                    }
169 189
                 }
170 190
             }
171 191
         }

Laden…
Annuleren
Opslaan