mirror of
https://github.com/2dust/v2rayN.git
synced 2025-05-03 05:38:51 +00:00
Code clean
This commit is contained in:
parent
7ab1cd6612
commit
dafc83aa53
4 changed files with 21 additions and 12 deletions
|
@ -1,9 +1,9 @@
|
||||||
<Application
|
<Application
|
||||||
x:Class="v2rayN.App"
|
x:Class="v2rayN.App"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:conv="clr-namespace:v2rayN.Converters"
|
xmlns:conv="clr-namespace:v2rayN.Converters"
|
||||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|
||||||
ShutdownMode="OnExplicitShutdown"
|
ShutdownMode="OnExplicitShutdown"
|
||||||
StartupUri="Views/MainWindow.xaml">
|
StartupUri="Views/MainWindow.xaml">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
<system:Double x:Key="StdFontSize2">14</system:Double>
|
<system:Double x:Key="StdFontSize2">14</system:Double>
|
||||||
<system:Double x:Key="StdFontSizeMsg">11</system:Double>
|
<system:Double x:Key="StdFontSizeMsg">11</system:Double>
|
||||||
|
|
||||||
<conv:InverseBooleanConverter x:Key="InverseBooleanConverter"/>
|
<conv:InverseBooleanConverter x:Key="InverseBooleanConverter" />
|
||||||
<Thickness
|
<Thickness
|
||||||
x:Key="ServerItemMargin"
|
x:Key="ServerItemMargin"
|
||||||
Bottom="4"
|
Bottom="4"
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace v2rayN.Converters
|
||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
if(targetType != typeof(bool))
|
if (targetType != typeof(bool))
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException("The target must be a boolean");
|
throw new InvalidOperationException("The target must be a boolean");
|
||||||
}
|
}
|
||||||
|
@ -21,4 +21,4 @@ namespace v2rayN.Converters
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -87,12 +87,20 @@ namespace v2rayN.Tool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool operator ==(SemanticVersion v1, SemanticVersion v2) { return v1.Equals(v2); }
|
public static bool operator ==(SemanticVersion v1, SemanticVersion v2)
|
||||||
public static bool operator !=(SemanticVersion v1, SemanticVersion v2) { return !v1.Equals(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); }
|
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
|
#region Private
|
||||||
|
|
||||||
private bool GreaterEquals(SemanticVersion other)
|
private bool GreaterEquals(SemanticVersion other)
|
||||||
{
|
{
|
||||||
if (this.major < other.major)
|
if (this.major < other.major)
|
||||||
|
@ -168,6 +176,7 @@ namespace v2rayN.Tool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Private
|
#endregion Private
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -321,8 +321,8 @@
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="8"
|
Margin="8"
|
||||||
IsEnabled="{Binding ElementName=followSystemTheme, Path=IsChecked, Converter={StaticResource InverseBooleanConverter}}"/>
|
IsEnabled="{Binding ElementName=followSystemTheme, Path=IsChecked, Converter={StaticResource InverseBooleanConverter}}" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
|
@ -574,7 +574,7 @@
|
||||||
<MenuItem
|
<MenuItem
|
||||||
x:Name="menuSpeedServer"
|
x:Name="menuSpeedServer"
|
||||||
Height="{StaticResource MenuItemHeight}"
|
Height="{StaticResource MenuItemHeight}"
|
||||||
Header="{x:Static resx:ResUI.menuSpeedServer}"/>
|
Header="{x:Static resx:ResUI.menuSpeedServer}" />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
x:Name="menuSortServerResult"
|
x:Name="menuSortServerResult"
|
||||||
Height="{StaticResource MenuItemHeight}"
|
Height="{StaticResource MenuItemHeight}"
|
||||||
|
|
Loading…
Reference in a new issue