From dafc83aa534ff71022f5faf6b116f6cd2b3ac6f0 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sun, 14 May 2023 17:25:05 +0800 Subject: [PATCH] Code clean --- v2rayN/v2rayN/App.xaml | 4 ++-- .../Converters/InverseBooleanConverter.cs | 4 ++-- v2rayN/v2rayN/Tool/SemanticVersion.cs | 19 ++++++++++++++----- v2rayN/v2rayN/Views/MainWindow.xaml | 6 +++--- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/v2rayN/v2rayN/App.xaml b/v2rayN/v2rayN/App.xaml index 03af3be5..3fc23de2 100644 --- a/v2rayN/v2rayN/App.xaml +++ b/v2rayN/v2rayN/App.xaml @@ -1,9 +1,9 @@  @@ -21,7 +21,7 @@ 14 11 - + =(SemanticVersion v1, SemanticVersion v2) { return v1.GreaterEquals(v2); } - public static bool operator <=(SemanticVersion v1, SemanticVersion v2) { return v1.LessEquals(v2); } + public static bool operator ==(SemanticVersion v1, SemanticVersion v2) + { return v1.Equals(v2); } + + public static bool operator !=(SemanticVersion v1, SemanticVersion v2) + { return !v1.Equals(v2); } + + public static bool operator >=(SemanticVersion v1, SemanticVersion v2) + { return v1.GreaterEquals(v2); } + + public static bool operator <=(SemanticVersion v1, SemanticVersion v2) + { return v1.LessEquals(v2); } #region Private + private bool GreaterEquals(SemanticVersion other) { if (this.major < other.major) @@ -168,6 +176,7 @@ namespace v2rayN.Tool } } } + #endregion Private } -} +} \ No newline at end of file diff --git a/v2rayN/v2rayN/Views/MainWindow.xaml b/v2rayN/v2rayN/Views/MainWindow.xaml index 9aefc90e..81495c84 100644 --- a/v2rayN/v2rayN/Views/MainWindow.xaml +++ b/v2rayN/v2rayN/Views/MainWindow.xaml @@ -321,8 +321,8 @@ Grid.Row="0" Grid.Column="1" Margin="8" - IsEnabled="{Binding ElementName=followSystemTheme, Path=IsChecked, Converter={StaticResource InverseBooleanConverter}}"/> - + IsEnabled="{Binding ElementName=followSystemTheme, Path=IsChecked, Converter={StaticResource InverseBooleanConverter}}" /> + + Header="{x:Static resx:ResUI.menuSpeedServer}" />