Skip to content

Commit

Permalink
Code clean
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Sep 4, 2024
1 parent 488e8aa commit 81b84d2
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 33 deletions.
1 change: 0 additions & 1 deletion v2rayN/ServiceLib/Common/FileManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,5 @@ public static bool CreateFromDirectory(string sourceDirectoryName, string destin
}
return true;
}

}
}
2 changes: 1 addition & 1 deletion v2rayN/ServiceLib/Enums/EViewAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public enum EViewAction
DispatcherRefreshServersBiz,
DispatcherRefreshIcon,
DispatcherCheckUpdate,
DispatcherCheckUpdateFinished,
DispatcherCheckUpdateFinished,
DispatcherShowMsg,
}
}
4 changes: 1 addition & 3 deletions v2rayN/ServiceLib/Handler/LazyConfig.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;

namespace ServiceLib.Handler
namespace ServiceLib.Handler
{
public sealed class LazyConfig
{
Expand Down
10 changes: 2 additions & 8 deletions v2rayN/ServiceLib/Models/CheckUpdateItem.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand All @@ -14,4 +8,4 @@ public class CheckUpdateItem
public string? fileName { get; set; }
public bool? isFinished { get; set; }
}
}
}
1 change: 1 addition & 0 deletions v2rayN/ServiceLib/ViewModels/AddServer2ViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class AddServer2ViewModel : MyReactiveObject
{
[Reactive]
public ProfileItem SelectedSource { get; set; }

[Reactive]
public string? CoreType { get; set; }

Expand Down
1 change: 0 additions & 1 deletion v2rayN/ServiceLib/ViewModels/MsgViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using ReactiveUI.Fody.Helpers;
using Splat;
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Text.RegularExpressions;

namespace ServiceLib.ViewModels
Expand Down
1 change: 1 addition & 0 deletions v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ private async Task<bool> UpdateViewHandler(EViewAction action, object? obj)
var clipboardData = await AvaUtils.GetClipboardData(this);
ViewModel?.AddServerViaClipboardAsync(clipboardData);
break;

case EViewAction.AdjustMainLvColWidth:
Dispatcher.UIThread.Post(() =>
Locator.Current.GetService<ProfilesViewModel>()?.AutofitColumnWidthAsync(),
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/App.xaml
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
2 changes: 0 additions & 2 deletions v2rayN/v2rayN/Views/CheckUpdateView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
IsCancel="True"
IsDefault="True"
Style="{StaticResource MaterialDesignFlatButton}" />

</StackPanel>

<StackPanel>
Expand Down Expand Up @@ -106,7 +105,6 @@
</DataTemplate>
</ListView.ItemTemplate>
</ListView>

</StackPanel>
</DockPanel>
</reactiveui:ReactiveUserControl>
2 changes: 1 addition & 1 deletion v2rayN/v2rayN/Views/CheckUpdateView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ private async Task<bool> UpdateViewHandler(EViewAction action, object? obj)
ViewModel?.UpdateViewResult((CheckUpdateItem)obj);
}), DispatcherPriority.Normal);
break;

case EViewAction.DispatcherCheckUpdateFinished:
if (obj is null) return false;
Application.Current?.Dispatcher.Invoke((() =>
{
ViewModel?.UpdateFinishedResult((bool)obj);
}), DispatcherPriority.Normal);
break;

}

return await Task.FromResult(true);
Expand Down
1 change: 0 additions & 1 deletion v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public GlobalHotkeySettingWindow()
{
InitializeComponent();


this.Owner = Application.Current.MainWindow;
_config = LazyConfig.Instance.Config;
_config.globalHotkeys ??= new List<KeyEventItem>();
Expand Down
4 changes: 2 additions & 2 deletions v2rayN/v2rayN/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace v2rayN.Views
{
public partial class MainWindow
{
private static Config _config;
private static Config _config;
private CheckUpdateView? _checkUpdateView;

public MainWindow()
Expand Down Expand Up @@ -296,7 +296,7 @@ private async Task<bool> UpdateViewHandler(EViewAction action, object? obj)
Application.Current?.Dispatcher.Invoke((() =>
{
Application.Current.Shutdown();
}), DispatcherPriority.Normal);
}), DispatcherPriority.Normal);
break;

case EViewAction.ScanScreenTask:
Expand Down
8 changes: 4 additions & 4 deletions v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
8 changes: 4 additions & 4 deletions v2rayN/v2rayN/Views/SubEditWindow.xaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
6 changes: 2 additions & 4 deletions v2rayN/v2rayN/Views/ThemeSettingView.xaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 81b84d2

Please sign in to comment.