|
1 | 1 | using System; |
| 2 | +using System.Collections.Generic; |
2 | 3 | using System.ComponentModel; |
3 | 4 | using System.Diagnostics; |
4 | 5 | using System.Reflection; |
@@ -57,6 +58,15 @@ public MainWindow() |
57 | 58 | { |
58 | 59 | try |
59 | 60 | { |
| 61 | + if (Properties.Settings.Default.SaveLogsToFile) |
| 62 | + { |
| 63 | + if (string.IsNullOrEmpty(Properties.Settings.Default.LogPath)) |
| 64 | + { |
| 65 | + Properties.Settings.Default.SaveLogsToFile = false; |
| 66 | + Properties.Settings.Default.Save(); |
| 67 | + } |
| 68 | + } |
| 69 | + |
60 | 70 | _logController = new LogController |
61 | 71 | ( |
62 | 72 | Properties.Settings.Default.LoggingEnabled, |
@@ -1079,18 +1089,20 @@ private void MainWindow_Drop(object sender, System.Windows.DragEventArgs e) |
1079 | 1089 | if (!e.Data.GetDataPresent(DataFormats.FileDrop)) return; |
1080 | 1090 | string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); |
1081 | 1091 | if (files == null) return; |
1082 | | - if (!System.IO.File.Exists(files[0])) return; |
1083 | 1092 |
|
1084 | 1093 | foreach (string s in files) |
1085 | 1094 | { |
1086 | | - Process process = Utils.GetProcessForFile(s); |
| 1095 | + if (!System.IO.File.Exists(s)) continue; |
| 1096 | + List<Process> processes = Utils.GetProcessesForFile(s); |
1087 | 1097 | try |
1088 | 1098 | { |
1089 | | - if (process == null) continue; |
1090 | | - |
1091 | | - _logController.AddLog(new RamLog("Emptying working set for process: " + process.ProcessName)); |
1092 | | - NativeMethods.EmptyWorkingSet(process.Handle); |
1093 | | - _logController.AddLog(new RamLog("Successfully emptied working set for process " + process.ProcessName)); |
| 1099 | + if (processes.Count == 0) return; |
| 1100 | + foreach (Process p in processes) |
| 1101 | + { |
| 1102 | + _logController.AddLog(new RamLog("Emptying working set for process: " + p.ProcessName)); |
| 1103 | + NativeMethods.EmptyWorkingSet(p.Handle); |
| 1104 | + _logController.AddLog(new RamLog("Successfully emptied working set for process " + p.ProcessName)); |
| 1105 | + } |
1094 | 1106 | } |
1095 | 1107 | catch (Exception ex) |
1096 | 1108 | { |
|
0 commit comments