Code clean

pull/5701/head
2dust 2024-09-04 16:15:31 +08:00
parent 488e8aab00
commit 81b84d235c
15 changed files with 21 additions and 34 deletions

View File

@ -115,6 +115,5 @@ namespace ServiceLib.Common
} }
return true; return true;
} }
} }
} }

View File

@ -1,6 +1,4 @@
using System.Runtime.InteropServices; namespace ServiceLib.Handler
namespace ServiceLib.Handler
{ {
public sealed class LazyConfig public sealed class LazyConfig
{ {

View File

@ -1,10 +1,4 @@
using System; namespace ServiceLib.Models
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ServiceLib.Models
{ {
public class CheckUpdateItem public class CheckUpdateItem
{ {

View File

@ -9,6 +9,7 @@ namespace ServiceLib.ViewModels
{ {
[Reactive] [Reactive]
public ProfileItem SelectedSource { get; set; } public ProfileItem SelectedSource { get; set; }
[Reactive] [Reactive]
public string? CoreType { get; set; } public string? CoreType { get; set; }

View File

@ -2,7 +2,6 @@
using ReactiveUI.Fody.Helpers; using ReactiveUI.Fody.Helpers;
using Splat; using Splat;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Diagnostics;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace ServiceLib.ViewModels namespace ServiceLib.ViewModels

View File

@ -279,6 +279,7 @@ namespace v2rayN.Desktop.Views
var clipboardData = await AvaUtils.GetClipboardData(this); var clipboardData = await AvaUtils.GetClipboardData(this);
ViewModel?.AddServerViaClipboardAsync(clipboardData); ViewModel?.AddServerViaClipboardAsync(clipboardData);
break; break;
case EViewAction.AdjustMainLvColWidth: case EViewAction.AdjustMainLvColWidth:
Dispatcher.UIThread.Post(() => Dispatcher.UIThread.Post(() =>
Locator.Current.GetService<ProfilesViewModel>()?.AutofitColumnWidthAsync(), Locator.Current.GetService<ProfilesViewModel>()?.AutofitColumnWidthAsync(),

View File

@ -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>

View File

@ -56,7 +56,6 @@
IsCancel="True" IsCancel="True"
IsDefault="True" IsDefault="True"
Style="{StaticResource MaterialDesignFlatButton}" /> Style="{StaticResource MaterialDesignFlatButton}" />
</StackPanel> </StackPanel>
<StackPanel> <StackPanel>
@ -106,7 +105,6 @@
</DataTemplate> </DataTemplate>
</ListView.ItemTemplate> </ListView.ItemTemplate>
</ListView> </ListView>
</StackPanel> </StackPanel>
</DockPanel> </DockPanel>
</reactiveui:ReactiveUserControl> </reactiveui:ReactiveUserControl>

View File

@ -34,6 +34,7 @@ namespace v2rayN.Views
ViewModel?.UpdateViewResult((CheckUpdateItem)obj); ViewModel?.UpdateViewResult((CheckUpdateItem)obj);
}), DispatcherPriority.Normal); }), DispatcherPriority.Normal);
break; break;
case EViewAction.DispatcherCheckUpdateFinished: case EViewAction.DispatcherCheckUpdateFinished:
if (obj is null) return false; if (obj is null) return false;
Application.Current?.Dispatcher.Invoke((() => Application.Current?.Dispatcher.Invoke((() =>
@ -41,7 +42,6 @@ namespace v2rayN.Views
ViewModel?.UpdateFinishedResult((bool)obj); ViewModel?.UpdateFinishedResult((bool)obj);
}), DispatcherPriority.Normal); }), DispatcherPriority.Normal);
break; break;
} }
return await Task.FromResult(true); return await Task.FromResult(true);

View File

@ -15,7 +15,6 @@ namespace v2rayN.Views
{ {
InitializeComponent(); InitializeComponent();
this.Owner = Application.Current.MainWindow; this.Owner = Application.Current.MainWindow;
_config = LazyConfig.Instance.Config; _config = LazyConfig.Instance.Config;
_config.globalHotkeys ??= new List<KeyEventItem>(); _config.globalHotkeys ??= new List<KeyEventItem>();

View File

@ -1,14 +1,14 @@
<reactiveui:ReactiveWindow <reactiveui:ReactiveWindow
x:Class="v2rayN.Views.RoutingRuleSettingWindow" x:Class="v2rayN.Views.RoutingRuleSettingWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:v2rayN.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:reactiveui="http://reactiveui.net" xmlns:reactiveui="http://reactiveui.net"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib" xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib" xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
xmlns:conv="clr-namespace:v2rayN.Converters"
Title="{x:Static resx:ResUI.menuRoutingRuleSetting}" Title="{x:Static resx:ResUI.menuRoutingRuleSetting}"
Width="960" Width="960"
Height="700" Height="700"

View File

@ -1,14 +1,14 @@
<reactiveui:ReactiveWindow <reactiveui:ReactiveWindow
x:Class="v2rayN.Views.SubEditWindow" x:Class="v2rayN.Views.SubEditWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:v2rayN.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:reactiveui="http://reactiveui.net" xmlns:reactiveui="http://reactiveui.net"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib" xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib" xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
xmlns:conv="clr-namespace:v2rayN.Converters"
Title="{x:Static resx:ResUI.menuSubSetting}" Title="{x:Static resx:ResUI.menuSubSetting}"
Width="700" Width="700"
Height="600" Height="600"

View File

@ -1,12 +1,10 @@
<reactiveui:ReactiveUserControl <reactiveui:ReactiveUserControl
x:Class="v2rayN.Views.ThemeSettingView" x:Class="v2rayN.Views.ThemeSettingView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:v2rayN.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:reactiveui="http://reactiveui.net" xmlns:reactiveui="http://reactiveui.net"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib" xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
xmlns:vms="clr-namespace:v2rayN.ViewModels" xmlns:vms="clr-namespace:v2rayN.ViewModels"
d:DesignHeight="450" d:DesignHeight="450"