diff --git a/SearchEverywhere/Converter/StatusIconWidthConventer.cs b/SearchEverywhere/Converter/StatusIconWidthConventer.cs index 223c497..44e3f28 100644 --- a/SearchEverywhere/Converter/StatusIconWidthConventer.cs +++ b/SearchEverywhere/Converter/StatusIconWidthConventer.cs @@ -1,26 +1,21 @@ using System; -using System.Collections.Generic; using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Data; -namespace SearchEverywhere.Converter +namespace SearchEverywhere.Converter; + +public class StatusIconWidthConventer : IValueConverter { - public class StatusIconWidthConventer : IValueConverter + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - - if (value == null) - return 20; - return long.Parse(value.ToString()) * (double.Parse(parameter.ToString())/10); - } + if (value == null || parameter == null) + return 20; + return System.Convert.ToInt64(Math.Round(System.Convert.ToDouble(value))) * + (double.Parse(parameter.ToString()) / 10); + } - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); } +} \ No newline at end of file diff --git a/SearchEverywhere/Converter/WidthConverter.cs b/SearchEverywhere/Converter/WidthConverter.cs index 047b49c..c2c2f9f 100644 --- a/SearchEverywhere/Converter/WidthConverter.cs +++ b/SearchEverywhere/Converter/WidthConverter.cs @@ -2,27 +2,26 @@ using System.Globalization; using System.Windows.Data; -namespace SearchEverywhere.Converter +namespace SearchEverywhere.Converter; + +public class WidthConverter : IValueConverter { - public class WidthConverter : IValueConverter + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + if (value != null) { - if (value != null) - { - var res = int.Parse(value.ToString()); - if (parameter == null) - parameter = 0; - if (res - long.Parse(parameter.ToString()) <= 10) return 90; - return res - long.Parse(parameter.ToString()); - } - - return 100; + var res = System.Convert.ToInt32(Math.Round(System.Convert.ToDouble(value))); + if (parameter == null) + parameter = 0; + if (res - long.Parse(parameter.ToString()) <= 10) return 90; + return res - long.Parse(parameter.ToString()); } - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } + return 100; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); } -} +} \ No newline at end of file diff --git "a/SearchEverywhere/SearchEverywhere-\346\272\220\344\273\243\347\240\201.zip" "b/SearchEverywhere/SearchEverywhere-\346\272\220\344\273\243\347\240\201.zip" deleted file mode 100644 index 1790059..0000000 Binary files "a/SearchEverywhere/SearchEverywhere-\346\272\220\344\273\243\347\240\201.zip" and /dev/null differ diff --git a/SearchEverywhere/SearchEverywhere.csproj b/SearchEverywhere/SearchEverywhere.csproj index 360df02..229e00b 100644 --- a/SearchEverywhere/SearchEverywhere.csproj +++ b/SearchEverywhere/SearchEverywhere.csproj @@ -27,6 +27,21 @@ true + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true AnyCPU @@ -576,7 +591,18 @@ - + + + False + Microsoft .NET Framework 4.7.2 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + PreserveNewest diff --git a/SearchEverywhere/Utility/ProcessUtility.cs b/SearchEverywhere/Utility/ProcessUtility.cs index 7c70596..4148944 100644 --- a/SearchEverywhere/Utility/ProcessUtility.cs +++ b/SearchEverywhere/Utility/ProcessUtility.cs @@ -62,6 +62,14 @@ private async void NewProcessEvent(object sender, EventArrivedEventArgs e) if (processList.Exists(x => x.ProcessId == ProcessId)) return; var tempProcess = Process.GetProcessById(ProcessId); + var count = 0; + while (tempProcess.MainWindowTitle.Length <= 0 && count < 3) + { + tempProcess = Process.GetProcessById(ProcessId); + count++; + await Task.Delay(500); + } + if (tempProcess.MainWindowTitle.Length > 0) { var processInfo = await GetProcessInfo(tempProcess); @@ -69,6 +77,9 @@ private async void NewProcessEvent(object sender, EventArrivedEventArgs e) WeakReferenceMessenger.Default.Send(new RefreshProcessModel(true, processInfo), "RefreshApplistToken"); } } + catch (ArgumentException exp) + { + } catch (Exception exception) { } diff --git a/SearchEverywhere/View/AboutView.xaml b/SearchEverywhere/View/AboutView.xaml index 871cc28..38ae438 100644 --- a/SearchEverywhere/View/AboutView.xaml +++ b/SearchEverywhere/View/AboutView.xaml @@ -18,8 +18,11 @@ - SearchEverywhere + SearchEverywhere + + Ver 1.3 + 快速多任务切换 | 毫秒级文件搜索 | 常用格式预览 | 遵循MVVM模式 = 0) CurrentApp = searchResultList[value]; else CurrentApp = null; diff --git "a/SearchEverywhere/\346\272\220\344\273\243\347\240\201 Ver1.3.zip" "b/SearchEverywhere/\346\272\220\344\273\243\347\240\201 Ver1.3.zip" new file mode 100644 index 0000000..18defc7 Binary files /dev/null and "b/SearchEverywhere/\346\272\220\344\273\243\347\240\201 Ver1.3.zip" differ