Browse Source

Code clean

pull/5701/head
2dust 3 months ago
parent
commit
81b84d235c
  1. 1
      v2rayN/ServiceLib/Common/FileManager.cs
  2. 2
      v2rayN/ServiceLib/Enums/EViewAction.cs
  3. 4
      v2rayN/ServiceLib/Handler/LazyConfig.cs
  4. 10
      v2rayN/ServiceLib/Models/CheckUpdateItem.cs
  5. 1
      v2rayN/ServiceLib/ViewModels/AddServer2ViewModel.cs
  6. 1
      v2rayN/ServiceLib/ViewModels/MsgViewModel.cs
  7. 1
      v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs
  8. 2
      v2rayN/v2rayN/App.xaml
  9. 2
      v2rayN/v2rayN/Views/CheckUpdateView.xaml
  10. 2
      v2rayN/v2rayN/Views/CheckUpdateView.xaml.cs
  11. 1
      v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs
  12. 4
      v2rayN/v2rayN/Views/MainWindow.xaml.cs
  13. 8
      v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml
  14. 8
      v2rayN/v2rayN/Views/SubEditWindow.xaml
  15. 6
      v2rayN/v2rayN/Views/ThemeSettingView.xaml

1
v2rayN/ServiceLib/Common/FileManager.cs

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

2
v2rayN/ServiceLib/Enums/EViewAction.cs

@ -39,7 +39,7 @@
DispatcherRefreshServersBiz,
DispatcherRefreshIcon,
DispatcherCheckUpdate,
DispatcherCheckUpdateFinished,
DispatcherCheckUpdateFinished,
DispatcherShowMsg,
}
}

4
v2rayN/ServiceLib/Handler/LazyConfig.cs

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

10
v2rayN/ServiceLib/Models/CheckUpdateItem.cs

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ServiceLib.Models
namespace ServiceLib.Models
{
public class CheckUpdateItem
{
@ -14,4 +8,4 @@ namespace ServiceLib.Models
public string? fileName { get; set; }
public bool? isFinished { get; set; }
}
}
}

1
v2rayN/ServiceLib/ViewModels/AddServer2ViewModel.cs

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

1
v2rayN/ServiceLib/ViewModels/MsgViewModel.cs

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

1
v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs

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

2
v2rayN/v2rayN/App.xaml

@ -1,9 +1,9 @@
<Application
x:Class="v2rayN.App"
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:conv="clr-namespace:v2rayN.Converters"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
ShutdownMode="OnExplicitShutdown"
StartupUri="Views/MainWindow.xaml">
<Application.Resources>

2
v2rayN/v2rayN/Views/CheckUpdateView.xaml

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

2
v2rayN/v2rayN/Views/CheckUpdateView.xaml.cs

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

1
v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs

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

4
v2rayN/v2rayN/Views/MainWindow.xaml.cs

@ -15,7 +15,7 @@ namespace v2rayN.Views
{
public partial class MainWindow
{
private static Config _config;
private static Config _config;
private CheckUpdateView? _checkUpdateView;
public MainWindow()
@ -296,7 +296,7 @@ namespace v2rayN.Views
Application.Current?.Dispatcher.Invoke((() =>
{
Application.Current.Shutdown();
}), DispatcherPriority.Normal);
}), DispatcherPriority.Normal);
break;
case EViewAction.ScanScreenTask:

8
v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml

@ -1,14 +1,14 @@
<reactiveui:ReactiveWindow
x:Class="v2rayN.Views.RoutingRuleSettingWindow"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
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:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
xmlns:conv="clr-namespace:v2rayN.Converters"
Title="{x:Static resx:ResUI.menuRoutingRuleSetting}"
Width="960"
Height="700"

8
v2rayN/v2rayN/Views/SubEditWindow.xaml

@ -1,14 +1,14 @@
<reactiveui:ReactiveWindow
x:Class="v2rayN.Views.SubEditWindow"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
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:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
xmlns:conv="clr-namespace:v2rayN.Converters"
Title="{x:Static resx:ResUI.menuSubSetting}"
Width="700"
Height="600"

6
v2rayN/v2rayN/Views/ThemeSettingView.xaml

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

Loading…
Cancel
Save