- Update Project and Libraries to .Net 7

- Update Nuget Packages
- Update Namespaces to C# 10 Style
- Change BinaryFormatter to XmlSerializer
This commit is contained in:
Ali Jebali 2023-08-28 13:15:36 +03:30
parent 4f30e3f0e3
commit e1cd0bbf63
86 changed files with 14564 additions and 14665 deletions

View file

@ -1,10 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Update="Resources.Designer.cs">
<DesignTime>True</DesignTime>
@ -16,5 +14,4 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>

View file

@ -1,20 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Protobuf Include="Statistics.proto" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.23.3" />
<PackageReference Include="Grpc.Net.Client" Version="2.54.0" />
<PackageReference Include="Grpc.Tools" Version="2.54.0">
<PackageReference Include="Google.Protobuf" Version="3.24.2" />
<PackageReference Include="Grpc.Net.Client" Version="2.56.0" />
<PackageReference Include="Grpc.Tools" Version="2.57.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>

View file

@ -1,13 +1,12 @@
using ProtosLib.Statistics;
namespace ProtosLib
namespace ProtosLib;
public class Tests
{
public class Tests
{
private StatsService.StatsServiceClient client_;
public Tests()
{
}
}
}

View file

@ -4,13 +4,13 @@ using v2rayN.Handler;
using v2rayN.Mode;
using v2rayN.Tool;
namespace v2rayN
namespace v2rayN;
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
public static EventWaitHandle ProgramStarted;
private static Config _config;
@ -86,5 +86,4 @@ namespace v2rayN
{
Utils.SaveLog("TaskScheduler_UnobservedTaskException", e.Exception);
}
}
}

View file

@ -2,10 +2,10 @@
using System.IO;
using System.Net;
namespace v2rayN.Base
namespace v2rayN.Base;
internal class DownloaderHelper
{
internal class DownloaderHelper
{
private static readonly Lazy<DownloaderHelper> _instance = new(() => new());
public static DownloaderHelper Instance => _instance.Value;
@ -177,5 +177,4 @@ namespace v2rayN.Base
downloadOpt = null;
}
}
}

View file

@ -3,12 +3,12 @@ using System.Net.Http;
using System.Net.Mime;
using System.Text;
namespace v2rayN.Base
namespace v2rayN.Base;
/// <summary>
/// </summary>
public class HttpClientHelper
{
/// <summary>
/// </summary>
public class HttpClientHelper
{
private static readonly Lazy<HttpClientHelper> _instance = new(() =>
{
HttpClientHandler handler = new() { UseCookies = false };
@ -152,5 +152,4 @@ namespace v2rayN.Base
}
} while (isMoreToRead);
}
}
}

View file

@ -1,9 +1,8 @@
using System.Windows.Controls;
namespace v2rayN.Base
namespace v2rayN.Base;
internal class MyDGTextColumn : DataGridTextColumn
{
internal class MyDGTextColumn : DataGridTextColumn
{
public string ExName { get; set; }
}
}

View file

@ -1,10 +1,10 @@
using SQLite;
using System.Collections;
namespace v2rayN.Base
namespace v2rayN.Base;
public sealed class SqliteHelper
{
public sealed class SqliteHelper
{
private static readonly Lazy<SqliteHelper> _instance = new(() => new());
public static SqliteHelper Instance => _instance.Value;
private string _connstr;
@ -118,5 +118,4 @@ namespace v2rayN.Base
{
return _dbAsync.Table<T>();
}
}
}

View file

@ -1,10 +1,10 @@
using System.Diagnostics.CodeAnalysis;
using System.IO;
namespace v2rayN.Base
namespace v2rayN.Base;
internal static class StringEx
{
internal static class StringEx
{
public static bool IsNullOrEmpty([NotNullWhen(false)] this string? value)
{
return string.IsNullOrEmpty(value);
@ -80,5 +80,4 @@ namespace v2rayN.Base
return char.ToUpper(value[0]) + value.Substring(1);
}
}
}

View file

@ -1,10 +1,10 @@
using System.Windows.Data;
using System.Windows.Media;
namespace v2rayN.Converters
namespace v2rayN.Converters;
public class DelayColorConverter : IValueConverter
{
public class DelayColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
int.TryParse(value.ToString(), out var delay);
@ -21,5 +21,4 @@ namespace v2rayN.Converters
{
return null;
}
}
}

View file

@ -1,11 +1,11 @@
using System.Globalization;
using System.Windows.Data;
namespace v2rayN.Converters
namespace v2rayN.Converters;
[ValueConversion(typeof(bool), typeof(bool))]
public class InverseBooleanConverter : IValueConverter
{
[ValueConversion(typeof(bool), typeof(bool))]
public class InverseBooleanConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (targetType != typeof(bool))
@ -20,5 +20,4 @@ namespace v2rayN.Converters
{
throw new NotImplementedException();
}
}
}

View file

@ -1,10 +1,10 @@
using System.Windows.Media;
using v2rayN.Handler;
namespace v2rayN.Converters
namespace v2rayN.Converters;
public class MaterialDesignFonts
{
public class MaterialDesignFonts
{
public static FontFamily MyFont { get; }
static MaterialDesignFonts()
@ -23,5 +23,4 @@ namespace v2rayN.Converters
}
MyFont ??= new FontFamily("Microsoft YaHei");
}
}
}

View file

@ -1,7 +1,7 @@
namespace v2rayN
namespace v2rayN;
internal class Global
{
internal class Global
{
#region const
public const string githubUrl = "https://github.com";
@ -170,5 +170,4 @@
public static string ExePathKey { get; set; }
#endregion global variable
}
}

View file

@ -5,13 +5,13 @@ using v2rayN.Base;
using v2rayN.Mode;
using v2rayN.Tool;
namespace v2rayN.Handler
namespace v2rayN.Handler;
/// <summary>
/// 本软件配置文件处理类
/// </summary>
internal class ConfigHandler
{
/// <summary>
/// 本软件配置文件处理类
/// </summary>
internal class ConfigHandler
{
private static string configRes = Global.ConfigFileName;
private static readonly object objLock = new();
@ -1621,5 +1621,4 @@ namespace v2rayN.Handler
}
#endregion DNS
}
}

View file

@ -2,13 +2,13 @@
using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Handler
namespace v2rayN.Handler;
/// <summary>
/// Core configuration file processing class
/// </summary>
internal class CoreConfigHandler
{
/// <summary>
/// Core configuration file processing class
/// </summary>
internal class CoreConfigHandler
{
public static int GenerateClientConfig(ProfileItem node, string? fileName, out string msg, out string content)
{
content = string.Empty;
@ -152,5 +152,4 @@ namespace v2rayN.Handler
var coreConfigV2ray = new CoreConfigV2ray(config);
return coreConfigV2ray.GenerateClientSpeedtestConfigString(selecteds, out msg);
}
}
}

View file

@ -2,10 +2,10 @@
using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Handler
namespace v2rayN.Handler;
internal class CoreConfigSingbox
{
internal class CoreConfigSingbox
{
private string SampleClient = Global.SingboxSampleClient;
private Config _config;
@ -736,5 +736,4 @@ namespace v2rayN.Handler
}
return 0;
}
}
}

View file

@ -4,10 +4,10 @@ using v2rayN.Base;
using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Handler
namespace v2rayN.Handler;
internal class CoreConfigV2ray
{
internal class CoreConfigV2ray
{
private string SampleClient = Global.v2raySampleClient;
private Config _config;
@ -945,5 +945,4 @@ namespace v2rayN.Handler
}
#endregion Gen speedtest config
}
}

View file

@ -4,13 +4,13 @@ using System.Text;
using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Handler
namespace v2rayN.Handler;
/// <summary>
/// Core process processing class
/// </summary>
internal class CoreHandler
{
/// <summary>
/// Core process processing class
/// </summary>
internal class CoreHandler
{
private Config _config;
private Process? _process;
private Process? _processPre;
@ -358,5 +358,4 @@ namespace v2rayN.Handler
}
#endregion Process
}
}

View file

@ -7,13 +7,13 @@ using System.Net.Sockets;
using v2rayN.Base;
using v2rayN.Resx;
namespace v2rayN.Handler
namespace v2rayN.Handler;
/// <summary>
///Download
/// </summary>
internal class DownloadHandle
{
/// <summary>
///Download
/// </summary>
internal class DownloadHandle
{
public event EventHandler<ResultEventArgs>? UpdateCompleted;
public event ErrorEventHandler? Error;
@ -335,5 +335,4 @@ namespace v2rayN.Handler
return false;
}
}
}
}

View file

@ -7,10 +7,10 @@ using System.Windows.Interop;
using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Handler
namespace v2rayN.Handler;
public sealed class HotkeyHandler
{
public sealed class HotkeyHandler
{
private static readonly Lazy<HotkeyHandler> _instance = new(() => new());
public static HotkeyHandler Instance = _instance.Value;
@ -176,5 +176,4 @@ namespace v2rayN.Handler
Win = 0x0008,
NoRepeat = 0x4000
}
}
}

View file

@ -1,10 +1,10 @@
using v2rayN.Base;
using v2rayN.Mode;
namespace v2rayN.Handler
namespace v2rayN.Handler;
public sealed class LazyConfig
{
public sealed class LazyConfig
{
private static readonly Lazy<LazyConfig> _instance = new(() => new());
private Config _config;
private List<CoreInfo> coreInfos;
@ -364,5 +364,4 @@ namespace v2rayN.Handler
}
#endregion Core Type
}
}

View file

@ -5,10 +5,10 @@ using System.Windows.Media.Imaging;
using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Handler
namespace v2rayN.Handler;
public sealed class MainFormHandler
{
public sealed class MainFormHandler
{
private static readonly Lazy<MainFormHandler> instance = new(() => new());
public static MainFormHandler Instance => instance.Value;
@ -224,5 +224,4 @@ namespace v2rayN.Handler
HotkeyHandler.Instance.HotkeyTriggerEvent += handler;
HotkeyHandler.Instance.Load();
}
}
}

View file

@ -1,10 +1,10 @@
using MaterialDesignThemes.Wpf;
using ReactiveUI;
namespace v2rayN.Handler
namespace v2rayN.Handler;
public class NoticeHandler
{
public class NoticeHandler
{
private readonly ISnackbarMessageQueue _snackbarMessageQueue;
public NoticeHandler(ISnackbarMessageQueue snackbarMessageQueue)
@ -29,5 +29,4 @@ namespace v2rayN.Handler
msg = $"{DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")} {msg}";
MessageBus.Current.SendMessage(msg, "MsgView");
}
}
}

View file

@ -3,10 +3,10 @@ using System.Reactive.Linq;
using v2rayN.Base;
using v2rayN.Mode;
namespace v2rayN.Handler
namespace v2rayN.Handler;
internal class ProfileExHandler
{
internal class ProfileExHandler
{
private static readonly Lazy<ProfileExHandler> _instance = new(() => new());
private ConcurrentBag<ProfileExItem> _lstProfileEx;
private Queue<string> _queIndexIds = new();
@ -141,5 +141,4 @@ namespace v2rayN.Handler
}
return _lstProfileEx.Max(t => t == null ? 0 : t.sort);
}
}
}

View file

@ -1,10 +1,10 @@
using Microsoft.Win32;
using System.Runtime.InteropServices;
namespace v2rayN.Handler
namespace v2rayN.Handler;
internal class ProxySetting
{
internal class ProxySetting
{
public static bool UnsetProxy()
{
return SetProxy(null, null, 1);
@ -212,5 +212,4 @@ namespace v2rayN.Handler
string ProxyServer = rk.GetValue("ProxyServer").ToString();
return ProxyServer;
}
}
}

View file

@ -2,13 +2,9 @@
using QRCoder.Xaml;
using System.Windows.Media;
namespace v2rayN.Handler
namespace v2rayN.Handler;
public class QRCodeHelper
{
/// <summary>
/// 含有QR码的描述类和包装编码和渲染
/// </summary>
public class QRCodeHelper
{
public static DrawingImage? GetQRCode(string strContent)
{
try
@ -24,5 +20,4 @@ namespace v2rayN.Handler
return null;
}
}
}
}

View file

@ -5,10 +5,10 @@ using v2rayN.Base;
using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Handler
namespace v2rayN.Handler;
internal class ShareHandler
{
internal class ShareHandler
{
#region GetShareUrl
/// <summary>
@ -813,5 +813,4 @@ namespace v2rayN.Handler
}
#endregion ImportShareUrl
}
}

View file

@ -5,10 +5,10 @@ using System.Net.Sockets;
using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.Handler
namespace v2rayN.Handler;
internal class SpeedtestHandler
{
internal class SpeedtestHandler
{
private Config _config;
private CoreHandler _coreHandler;
private List<ServerTestItem> _selecteds;
@ -423,5 +423,4 @@ namespace v2rayN.Handler
{
_updateFunc(indexId, delay, speed);
}
}
}

View file

@ -3,10 +3,10 @@ using System.Net.Sockets;
using v2rayN.Base;
using v2rayN.Mode;
namespace v2rayN.Handler
namespace v2rayN.Handler;
internal class StatisticsHandler
{
internal class StatisticsHandler
{
private Config _config;
private ServerStatItem? _serverStatItem;
private List<ServerStatItem> _lstServerStat;
@ -157,5 +157,4 @@ namespace v2rayN.Handler
}
return 69090;
}
}
}

View file

@ -2,10 +2,10 @@
using System.Text;
using v2rayN.Mode;
namespace v2rayN.Handler
namespace v2rayN.Handler;
internal class StatisticsSingbox
{
internal class StatisticsSingbox
{
private Config _config;
private bool _exitFlag;
private ClientWebSocket? webSocket;
@ -124,5 +124,4 @@ namespace v2rayN.Handler
{
}
}
}
}

View file

@ -3,10 +3,10 @@ using Grpc.Net.Client;
using ProtosLib.Statistics;
using v2rayN.Mode;
namespace v2rayN.Handler
namespace v2rayN.Handler;
internal class StatisticsV2ray
{
internal class StatisticsV2ray
{
private Mode.Config _config;
private GrpcChannel _channel;
private StatsService.StatsServiceClient _client;
@ -115,5 +115,4 @@ namespace v2rayN.Handler
{
}
}
}
}

View file

@ -6,10 +6,10 @@ using v2rayN.Mode;
using v2rayN.Properties;
using v2rayN.Tool;
namespace v2rayN.Handler
namespace v2rayN.Handler;
public static class SysProxyHandle
{
public static class SysProxyHandle
{
//private const string _userWininetConfigFile = "user-wininet.json";
//private static string _queryStr;
@ -218,5 +218,4 @@ namespace v2rayN.Handler
// _queryStr = stdout;
//}
}
}
}

View file

@ -11,10 +11,10 @@ using v2rayN.Mode;
using v2rayN.Resx;
using v2rayN.Tool;
namespace v2rayN.Handler
namespace v2rayN.Handler;
internal class UpdateHandle
{
internal class UpdateHandle
{
private Action<bool, string> _updateFunc;
private Config _config;
@ -642,5 +642,4 @@ namespace v2rayN.Handler
}
#endregion private
}
}

View file

@ -1,7 +1,7 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
public class ComboItem
{
public class ComboItem
{
public string ID
{
get; set;
@ -11,5 +11,4 @@
{
get; set;
}
}
}

View file

@ -1,11 +1,11 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
/// <summary>
/// 本软件配置文件实体类
/// </summary>
[Serializable]
public class Config
{
/// <summary>
/// 本软件配置文件实体类
/// </summary>
[Serializable]
public class Config
{
#region property
public string indexId { get; set; }
@ -33,5 +33,4 @@
public List<CoreTypeItem> coreTypeItem { get; set; }
#endregion other entities
}
}

View file

@ -1,10 +1,10 @@
using System.Windows.Input;
namespace v2rayN.Mode
namespace v2rayN.Mode;
[Serializable]
public class CoreBasicItem
{
[Serializable]
public class CoreBasicItem
{
/// <summary>
/// 允许日志
/// </summary>
@ -31,11 +31,11 @@ namespace v2rayN.Mode
/// 默认用户代理
/// </summary>
public string defUserAgent { get; set; }
}
}
[Serializable]
public class InItem
{
[Serializable]
public class InItem
{
public int localPort { get; set; }
public string protocol { get; set; }
@ -52,11 +52,11 @@ namespace v2rayN.Mode
public string user { get; set; }
public string pass { get; set; }
}
}
[Serializable]
public class KcpItem
{
[Serializable]
public class KcpItem
{
public int mtu { get; set; }
public int tti { get; set; }
@ -70,20 +70,20 @@ namespace v2rayN.Mode
public int readBufferSize { get; set; }
public int writeBufferSize { get; set; }
}
}
[Serializable]
public class GrpcItem
{
[Serializable]
public class GrpcItem
{
public int idle_timeout { get; set; }
public int health_check_timeout { get; set; }
public bool permit_without_stream { get; set; }
public int initial_windows_size { get; set; }
}
}
[Serializable]
public class GUIItem
{
[Serializable]
public class GUIItem
{
public bool autoRun { get; set; }
public bool enableStatistics { get; set; }
@ -103,11 +103,11 @@ namespace v2rayN.Mode
public bool enableHWA { get; set; } = false;
public bool enableLog { get; set; } = true;
}
}
[Serializable]
public class UIItem
{
[Serializable]
public class UIItem
{
public bool enableAutoAdjustMainLvColWidth { get; set; }
public double mainWidth { get; set; }
public double mainHeight { get; set; }
@ -125,18 +125,18 @@ namespace v2rayN.Mode
public string mainMsgFilter { get; set; }
public bool showTrayTip { get; set; }
public List<ColumnItem> mainColumnItem { get; set; }
}
}
[Serializable]
public class ConstItem
{
[Serializable]
public class ConstItem
{
public string defIEProxyExceptions { get; set; }
public string subConvertUrl { get; set; } = string.Empty;
}
}
[Serializable]
public class KeyEventItem
{
[Serializable]
public class KeyEventItem
{
public EGlobalHotkey eGlobalHotkey { get; set; }
public bool Alt { get; set; }
@ -146,37 +146,37 @@ namespace v2rayN.Mode
public bool Shift { get; set; }
public Key? KeyCode { get; set; }
}
}
[Serializable]
public class CoreTypeItem
{
[Serializable]
public class CoreTypeItem
{
public EConfigType configType { get; set; }
public ECoreType coreType { get; set; }
}
}
[Serializable]
public class TunModeItem
{
[Serializable]
public class TunModeItem
{
public bool enableTun { get; set; }
public bool strictRoute { get; set; } = true;
public string stack { get; set; }
public int mtu { get; set; }
public bool enableExInbound { get; set; }
}
}
[Serializable]
public class SpeedTestItem
{
[Serializable]
public class SpeedTestItem
{
public int speedTestTimeout { get; set; }
public string speedTestUrl { get; set; }
public string speedPingTestUrl { get; set; }
}
}
[Serializable]
public class RoutingBasicItem
{
[Serializable]
public class RoutingBasicItem
{
/// <summary>
/// 域名解析策略
/// </summary>
@ -187,23 +187,22 @@ namespace v2rayN.Mode
public string domainMatcher { get; set; }
public string routingIndexId { get; set; }
public bool enableRoutingAdvanced { get; set; }
}
}
[Serializable]
public class ColumnItem
{
[Serializable]
public class ColumnItem
{
public string Name { get; set; }
public int Width { get; set; }
public int Index { get; set; }
}
}
[Serializable]
public class Mux4Sbox
{
[Serializable]
public class Mux4Sbox
{
public string protocol { get; set; }
public int max_connections { get; set; }
public int min_streams { get; set; }
public int max_streams { get; set; }
public bool padding { get; set; }
}
}

View file

@ -1,8 +1,8 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
[Serializable]
public class ConfigOld
{
[Serializable]
public class ConfigOld
{
#region property
/// <summary>
@ -206,11 +206,11 @@
}
#endregion other entities
}
}
[Serializable]
public class VmessItem
{
[Serializable]
public class VmessItem
{
public VmessItem()
{
indexId = string.Empty;
@ -405,11 +405,11 @@
}
public string fingerprint { get; set; }
}
}
[Serializable]
public class RoutingItemOld
{
[Serializable]
public class RoutingItemOld
{
public string remarks
{
get; set;
@ -436,5 +436,4 @@
{
get; set;
}
}
}

View file

@ -1,8 +1,8 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
[Serializable]
public class CoreInfo
{
[Serializable]
public class CoreInfo
{
public ECoreType coreType { get; set; }
public List<string> coreExes { get; set; }
@ -23,5 +23,4 @@
public string versionArg { get; set; }
public bool redirectInfo { get; set; }
}
}

View file

@ -1,10 +1,10 @@
using SQLite;
namespace v2rayN.Mode
namespace v2rayN.Mode;
[Serializable]
public class DNSItem
{
[Serializable]
public class DNSItem
{
[PrimaryKey]
public string id { get; set; }
@ -14,5 +14,4 @@ namespace v2rayN.Mode
public string? normalDNS { get; set; }
public string? tunDNS { get; set; }
public string? domainStrategy4Freedom { get; set; }
}
}

View file

@ -1,12 +1,11 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
public enum EConfigType
{
public enum EConfigType
{
VMess = 1,
Custom = 2,
Shadowsocks = 3,
Socks = 4,
VLESS = 5,
Trojan = 6
}
}

View file

@ -1,7 +1,7 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
public enum ECoreType
{
public enum ECoreType
{
v2fly = 1,
Xray = 2,
SagerNet = 3,
@ -14,5 +14,4 @@
sing_box = 24,
juicity = 25,
v2rayN = 99
}
}

View file

@ -1,11 +1,10 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
public enum EGlobalHotkey
{
public enum EGlobalHotkey
{
ShowForm = 0,
SystemProxyClear = 1,
SystemProxySet = 2,
SystemProxyUnchanged = 3,
SystemProxyPac = 4,
}
}

View file

@ -1,11 +1,10 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
public enum EMove
{
public enum EMove
{
Top = 1,
Up = 2,
Down = 3,
Bottom = 4,
Position = 5
}
}

View file

@ -1,7 +1,7 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
public enum EServerColName
{
public enum EServerColName
{
def = 0,
configType,
remarks,
@ -18,5 +18,4 @@
todayUp,
totalDown,
totalUp
}
}

View file

@ -1,11 +1,10 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
public enum ESpeedActionType
{
public enum ESpeedActionType
{
Ping,
Tcping,
Realping,
Speedtest,
Mixedtest
}
}

View file

@ -1,10 +1,9 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
public enum ESysProxyType
{
public enum ESysProxyType
{
ForcedClear = 0,
ForcedChange = 1,
Unchanged = 2,
Pac = 3
}
}

View file

@ -1,8 +1,7 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
public enum EViewAction
{
public enum EViewAction
{
AdjustMainLvColWidth,
ProfilesFocus
}
}

View file

@ -1,9 +1,9 @@
using Newtonsoft.Json;
namespace v2rayN.Mode
namespace v2rayN.Mode;
public class GitHubReleaseAsset
{
public class GitHubReleaseAsset
{
[JsonProperty("url")] public string Url { get; set; }
[JsonProperty("id")] public int Id { get; set; }
@ -27,10 +27,10 @@ namespace v2rayN.Mode
[JsonProperty("updated_at")] public DateTime UpdatedAt { get; set; }
[JsonProperty("browser_download_url")] public string BrowserDownloadUrl { get; set; }
}
}
public class GitHubRelease
{
public class GitHubRelease
{
[JsonProperty("url")] public string Url { get; set; }
[JsonProperty("assets_url")] public string AssetsUrl { get; set; }
@ -64,5 +64,4 @@ namespace v2rayN.Mode
[JsonProperty("zipball_url")] public string ZipballUrl { get; set; }
[JsonProperty("body")] public string Body { get; set; }
}
}

View file

@ -1,15 +1,14 @@
using SQLite;
namespace v2rayN.Mode
namespace v2rayN.Mode;
[Serializable]
public class ProfileExItem
{
[Serializable]
public class ProfileExItem
{
[PrimaryKey]
public string indexId { get; set; }
public int delay { get; set; }
public decimal speed { get; set; }
public int sort { get; set; }
}
}

View file

@ -1,11 +1,11 @@
using SQLite;
using v2rayN.Base;
namespace v2rayN.Mode
namespace v2rayN.Mode;
[Serializable]
public class ProfileItem
{
[Serializable]
public class ProfileItem
{
public ProfileItem()
{
indexId = string.Empty;
@ -191,5 +191,4 @@ namespace v2rayN.Mode
public string publicKey { get; set; }
public string shortId { get; set; }
public string spiderX { get; set; }
}
}

View file

@ -1,8 +1,8 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
[Serializable]
public class ProfileItemModel : ProfileItem
{
[Serializable]
public class ProfileItemModel : ProfileItem
{
public bool isActive { get; set; }
public string subRemarks { get; set; }
public int delay { get; set; }
@ -14,5 +14,4 @@
public string todayDown { get; set; }
public string totalUp { get; set; }
public string totalDown { get; set; }
}
}

View file

@ -1,10 +1,10 @@
using SQLite;
namespace v2rayN.Mode
namespace v2rayN.Mode;
[Serializable]
public class RoutingItem
{
[Serializable]
public class RoutingItem
{
[PrimaryKey]
public string id { get; set; }
@ -18,5 +18,4 @@ namespace v2rayN.Mode
public string domainStrategy { get; set; }
public string domainStrategy4Singbox { get; set; }
public int sort { get; set; }
}
}

View file

@ -1,8 +1,7 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
[Serializable]
public class RoutingItemModel : RoutingItem
{
[Serializable]
public class RoutingItemModel : RoutingItem
{
public bool isActive { get; set; }
}
}

View file

@ -1,8 +1,8 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
[Serializable]
public class RulesItem
{
[Serializable]
public class RulesItem
{
public string id { get; set; }
public string type { get; set; }
@ -21,5 +21,4 @@
public List<string> process { get; set; }
public bool enabled { get; set; } = true;
}
}

View file

@ -1,8 +1,8 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
[Serializable]
public class RulesItemModel : RulesItem
{
[Serializable]
public class RulesItemModel : RulesItem
{
public string inboundTags { get; set; }
public string ips { get; set; }
@ -10,5 +10,4 @@
public string domains { get; set; }
public string protocols { get; set; }
}
}

View file

@ -1,8 +1,8 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
[Serializable]
internal class ServerSpeedItem : ServerStatItem
{
[Serializable]
internal class ServerSpeedItem : ServerStatItem
{
public long proxyUp
{
get; set;
@ -22,11 +22,11 @@
{
get; set;
}
}
}
[Serializable]
public class TrafficItem
{
[Serializable]
public class TrafficItem
{
public ulong up
{
get; set;
@ -36,5 +36,4 @@
{
get; set;
}
}
}

View file

@ -1,10 +1,10 @@
using SQLite;
namespace v2rayN.Mode
namespace v2rayN.Mode;
[Serializable]
public class ServerStatItem
{
[Serializable]
public class ServerStatItem
{
[PrimaryKey]
public string indexId
{
@ -35,5 +35,4 @@ namespace v2rayN.Mode
{
get; set;
}
}
}

View file

@ -1,13 +1,12 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
[Serializable]
internal class ServerTestItem
{
[Serializable]
internal class ServerTestItem
{
public string indexId { get; set; }
public string address { get; set; }
public int port { get; set; }
public EConfigType configType { get; set; }
public bool allowTest { get; set; }
public int delay { get; set; }
}
}

View file

@ -1,25 +1,25 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
public class SingboxConfig
{
public class SingboxConfig
{
public Log4Sbox log { get; set; }
public object dns { get; set; }
public List<Inbound4Sbox> inbounds { get; set; }
public List<Outbound4Sbox> outbounds { get; set; }
public Route4Sbox route { get; set; }
public Experimental4Sbox experimental { get; set; }
}
}
public class Log4Sbox
{
public class Log4Sbox
{
public bool? disabled { get; set; }
public string level { get; set; }
public string output { get; set; }
public bool timestamp { get; set; }
}
}
public class Dns4Sbox
{
public class Dns4Sbox
{
public List<Server4Sbox> servers { get; set; }
public List<Rule4Sbox> rules { get; set; }
public string? final { get; set; }
@ -29,17 +29,17 @@
public bool? independent_cache { get; set; }
public bool? reverse_mapping { get; set; }
public Fakeip4Sbox? fakeip { get; set; }
}
}
public class Route4Sbox
{
public class Route4Sbox
{
public bool? auto_detect_interface { get; set; }
public List<Rule4Sbox> rules { get; set; }
}
}
[Serializable]
public class Rule4Sbox
{
[Serializable]
public class Rule4Sbox
{
public string outbound { get; set; }
public string server { get; set; }
public bool? disable_cache { get; set; }
@ -60,11 +60,11 @@
public List<string>? source_ip_cidr { get; set; }
public List<string>? process_name { get; set; }
}
}
[Serializable]
public class Inbound4Sbox
{
[Serializable]
public class Inbound4Sbox
{
public string type { get; set; }
public string tag { get; set; }
public string listen { get; set; }
@ -81,16 +81,16 @@
public bool? sniff { get; set; }
public bool? sniff_override_destination { get; set; }
public List<User4Sbox> users { get; set; }
}
}
public class User4Sbox
{
public class User4Sbox
{
public string username { get; set; }
public string password { get; set; }
}
}
public class Outbound4Sbox
{
public class Outbound4Sbox
{
public string type { get; set; }
public string tag { get; set; }
public string server { get; set; }
@ -115,43 +115,43 @@
public Tls4Sbox tls { get; set; }
public Multiplex4Sbox multiplex { get; set; }
public Transport4Sbox transport { get; set; }
}
}
public class Tls4Sbox
{
public class Tls4Sbox
{
public bool enabled { get; set; }
public string server_name { get; set; }
public bool? insecure { get; set; }
public List<string> alpn { get; set; }
public Utls4Sbox utls { get; set; }
public Reality4Sbox reality { get; set; }
}
}
public class Multiplex4Sbox
{
public class Multiplex4Sbox
{
public bool enabled { get; set; }
public string protocol { get; set; }
public int max_connections { get; set; }
public int min_streams { get; set; }
public int max_streams { get; set; }
public bool padding { get; set; }
}
}
public class Utls4Sbox
{
public class Utls4Sbox
{
public bool enabled { get; set; }
public string fingerprint { get; set; }
}
}
public class Reality4Sbox
{
public class Reality4Sbox
{
public bool enabled { get; set; }
public string public_key { get; set; }
public string short_id { get; set; }
}
}
public class Transport4Sbox
{
public class Transport4Sbox
{
public string type { get; set; }
public List<string>? host { get; set; }
public string? path { get; set; }
@ -161,52 +161,51 @@
public string idle_timeout { get; set; }
public string ping_timeout { get; set; }
public bool? permit_without_stream { get; set; }
}
}
public class Headers4Sbox
{
public class Headers4Sbox
{
public string? Host { get; set; }
}
}
public class Server4Sbox
{
public class Server4Sbox
{
public string tag { get; set; }
public string address { get; set; }
public string address_resolver { get; set; }
public string strategy { get; set; }
public string detour { get; set; }
}
}
public class Experimental4Sbox
{
public class Experimental4Sbox
{
public V2ray_Api4Sbox v2ray_api { get; set; }
public Clash_Api4Sbox clash_api { get; set; }
}
}
public class V2ray_Api4Sbox
{
public class V2ray_Api4Sbox
{
public string listen { get; set; }
public Stats4Sbox stats { get; set; }
}
}
public class Clash_Api4Sbox
{
public class Clash_Api4Sbox
{
public string external_controller { get; set; }
public bool store_selected { get; set; }
}
}
public class Stats4Sbox
{
public class Stats4Sbox
{
public bool enabled { get; set; }
public List<string>? inbounds { get; set; }
public List<string>? outbounds { get; set; }
public List<string>? users { get; set; }
}
}
public class Fakeip4Sbox
{
public class Fakeip4Sbox
{
public bool enabled { get; set; }
public string inet4_range { get; set; }
public string inet6_range { get; set; }
}
}

View file

@ -1,18 +1,17 @@
namespace v2rayN.Mode
{
public class SsSIP008
{
public List<SsServer> servers { get; set; }
}
namespace v2rayN.Mode;
[Serializable]
public class SsServer
{
public class SsSIP008
{
public List<SsServer> servers { get; set; }
}
[Serializable]
public class SsServer
{
public string remarks { get; set; }
public string server { get; set; }
public string server_port { get; set; }
public string method { get; set; }
public string password { get; set; }
public string plugin { get; set; }
}
}

View file

@ -1,10 +1,10 @@
using SQLite;
namespace v2rayN.Mode
namespace v2rayN.Mode;
[Serializable]
public class SubItem
{
[Serializable]
public class SubItem
{
[PrimaryKey]
public string id { get; set; }
@ -27,5 +27,4 @@ namespace v2rayN.Mode
public long updateTime { get; set; }
public string? convertTarget { get; set; }
}
}

View file

@ -1,7 +1,7 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
internal class SysproxyConfig
{
internal class SysproxyConfig
{
public bool UserSettingsRecorded;
public string Flags;
public string ProxyServer;
@ -16,5 +16,4 @@
BypassList = "";
PacUrl = "";
}
}
}

View file

@ -1,13 +1,13 @@
using Newtonsoft.Json;
namespace v2rayN.Mode
namespace v2rayN.Mode;
/// <summary>
/// v2ray配置文件实体类
/// 例子SampleConfig.txt
/// </summary>
public class V2rayConfig
{
/// <summary>
/// v2ray配置文件实体类
/// 例子SampleConfig.txt
/// </summary>
public class V2rayConfig
{
/// <summary>
/// 日志配置
/// </summary>
@ -43,30 +43,30 @@ namespace v2rayN.Mode
/// 路由配置
/// </summary>
public Routing4Ray routing { get; set; }
}
}
public class Stats4Ray
{ };
public class Stats4Ray
{ };
public class API4Ray
{
public class API4Ray
{
public string tag { get; set; }
public List<string> services { get; set; }
}
}
public class Policy4Ray
{
public class Policy4Ray
{
public SystemPolicy4Ray system;
}
}
public class SystemPolicy4Ray
{
public class SystemPolicy4Ray
{
public bool statsOutboundUplink;
public bool statsOutboundDownlink;
}
}
public class Log4Ray
{
public class Log4Ray
{
/// <summary>
///
/// </summary>
@ -81,10 +81,10 @@ namespace v2rayN.Mode
///
/// </summary>
public string loglevel { get; set; }
}
}
public class Inbounds4Ray
{
public class Inbounds4Ray
{
public string tag { get; set; }
/// <summary>
@ -116,10 +116,10 @@ namespace v2rayN.Mode
///
/// </summary>
public StreamSettings4Ray streamSettings { get; set; }
}
}
public class Inboundsettings4Ray
{
public class Inboundsettings4Ray
{
/// <summary>
///
/// </summary>
@ -153,10 +153,10 @@ namespace v2rayN.Mode
public bool allowTransparent { get; set; }
public List<AccountsItem4Ray> accounts { get; set; }
}
}
public class UsersItem4Ray
{
public class UsersItem4Ray
{
/// <summary>
///
/// </summary>
@ -186,17 +186,17 @@ namespace v2rayN.Mode
/// VLESS
/// </summary>
public string? flow { get; set; }
}
}
public class Sniffing4Ray
{
public class Sniffing4Ray
{
public bool enabled { get; set; }
public List<string> destOverride { get; set; }
public bool routeOnly { get; set; }
}
}
public class Outbounds4Ray
{
public class Outbounds4Ray
{
/// <summary>
/// 默认值agentout
/// </summary>
@ -221,10 +221,10 @@ namespace v2rayN.Mode
///
/// </summary>
public Mux4Ray mux { get; set; }
}
}
public class Outboundsettings4Ray
{
public class Outboundsettings4Ray
{
/// <summary>
///
/// </summary>
@ -249,10 +249,10 @@ namespace v2rayN.Mode
///
/// </summary>
public int? userLevel { get; set; }
}
}
public class VnextItem4Ray
{
public class VnextItem4Ray
{
/// <summary>
///
/// </summary>
@ -267,10 +267,10 @@ namespace v2rayN.Mode
///
/// </summary>
public List<UsersItem4Ray> users { get; set; }
}
}
public class ServersItem4Ray
{
public class ServersItem4Ray
{
/// <summary>
///
/// </summary>
@ -315,10 +315,10 @@ namespace v2rayN.Mode
///
/// </summary>
public List<SocksUsersItem4Ray> users { get; set; }
}
}
public class SocksUsersItem4Ray
{
public class SocksUsersItem4Ray
{
/// <summary>
///
/// </summary>
@ -333,10 +333,10 @@ namespace v2rayN.Mode
///
/// </summary>
public int level { get; set; }
}
}
public class Mux4Ray
{
public class Mux4Ray
{
/// <summary>
///
/// </summary>
@ -346,26 +346,26 @@ namespace v2rayN.Mode
///
/// </summary>
public int concurrency { get; set; }
}
}
public class Response4Ray
{
public class Response4Ray
{
/// <summary>
///
/// </summary>
public string type { get; set; }
}
}
public class Dns4Ray
{
public class Dns4Ray
{
/// <summary>
///
/// </summary>
public List<string> servers { get; set; }
}
}
public class Routing4Ray
{
public class Routing4Ray
{
/// <summary>
///
/// </summary>
@ -380,11 +380,11 @@ namespace v2rayN.Mode
///
/// </summary>
public List<RulesItem4Ray> rules { get; set; }
}
}
[Serializable]
public class RulesItem4Ray
{
[Serializable]
public class RulesItem4Ray
{
public string type { get; set; }
public string port { get; set; }
@ -398,10 +398,10 @@ namespace v2rayN.Mode
public List<string> domain { get; set; }
public List<string> protocol { get; set; }
}
}
public class StreamSettings4Ray
{
public class StreamSettings4Ray
{
/// <summary>
///
/// </summary>
@ -451,10 +451,10 @@ namespace v2rayN.Mode
/// grpc
/// </summary>
public GrpcSettings4Ray grpcSettings { get; set; }
}
}
public class TlsSettings4Ray
{
public class TlsSettings4Ray
{
/// <summary>
/// 是否允许不安全连接(用于客户端)
/// </summary>
@ -476,18 +476,18 @@ namespace v2rayN.Mode
public string? publicKey { get; set; }
public string? shortId { get; set; }
public string? spiderX { get; set; }
}
}
public class TcpSettings4Ray
{
public class TcpSettings4Ray
{
/// <summary>
/// 数据包头部伪装设置
/// </summary>
public Header4Ray header { get; set; }
}
}
public class Header4Ray
{
public class Header4Ray
{
/// <summary>
/// 伪装
/// </summary>
@ -502,10 +502,10 @@ namespace v2rayN.Mode
/// 结构复杂,直接存起来
/// </summary>
public object response { get; set; }
}
}
public class KcpSettings4Ray
{
public class KcpSettings4Ray
{
/// <summary>
///
/// </summary>
@ -550,10 +550,10 @@ namespace v2rayN.Mode
///
/// </summary>
public string seed { get; set; }
}
}
public class WsSettings4Ray
{
public class WsSettings4Ray
{
/// <summary>
///
/// </summary>
@ -563,10 +563,10 @@ namespace v2rayN.Mode
///
/// </summary>
public Headers4Ray headers { get; set; }
}
}
public class Headers4Ray
{
public class Headers4Ray
{
/// <summary>
///
/// </summary>
@ -577,10 +577,10 @@ namespace v2rayN.Mode
/// </summary>
[JsonProperty("User-Agent")]
public string UserAgent { get; set; }
}
}
public class HttpSettings4Ray
{
public class HttpSettings4Ray
{
/// <summary>
///
/// </summary>
@ -590,10 +590,10 @@ namespace v2rayN.Mode
///
/// </summary>
public List<string> host { get; set; }
}
}
public class QuicSettings4Ray
{
public class QuicSettings4Ray
{
/// <summary>
///
/// </summary>
@ -608,20 +608,20 @@ namespace v2rayN.Mode
///
/// </summary>
public Header4Ray header { get; set; }
}
}
public class GrpcSettings4Ray
{
public class GrpcSettings4Ray
{
public string serviceName { get; set; }
public bool multiMode { get; set; }
public int idle_timeout { get; set; }
public int health_check_timeout { get; set; }
public bool permit_without_stream { get; set; }
public int initial_windows_size { get; set; }
}
}
public class AccountsItem4Ray
{
public class AccountsItem4Ray
{
/// <summary>
///
/// </summary>
@ -631,5 +631,4 @@ namespace v2rayN.Mode
///
/// </summary>
public string pass { get; set; }
}
}

View file

@ -1,21 +1,20 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
/// <summary>
/// Tcp伪装http的Request只要Host
/// </summary>
public class V2rayTcpRequest
{
/// <summary>
/// Tcp伪装http的Request只要Host
/// </summary>
public class V2rayTcpRequest
{
/// <summary>
///
/// </summary>
public RequestHeaders headers { get; set; }
}
}
public class RequestHeaders
{
public class RequestHeaders
{
/// <summary>
///
/// </summary>
public List<string> Host { get; set; }
}
}

View file

@ -1,11 +1,11 @@
namespace v2rayN.Mode
namespace v2rayN.Mode;
/// <summary>
/// https://github.com/2dust/v2rayN/wiki/
/// </summary>
[Serializable]
internal class VmessQRCode
{
/// <summary>
/// https://github.com/2dust/v2rayN/wiki/
/// </summary>
[Serializable]
internal class VmessQRCode
{
/// <summary>
///
/// </summary>
@ -80,5 +80,4 @@
/// TLS fingerprint
/// </summary>
public string fp { get; set; } = string.Empty;
}
}

View file

@ -2,10 +2,10 @@
using System.IO.Compression;
using System.Text;
namespace v2rayN.Tool
namespace v2rayN.Tool;
public static class FileManager
{
public static class FileManager
{
public static bool ByteArrayToFile(string fileName, byte[] content)
{
try
@ -86,5 +86,4 @@ namespace v2rayN.Tool
}
return true;
}
}
}

View file

@ -1,15 +1,15 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace v2rayN
{
/*
namespace v2rayN;
/*
* See:
* http://stackoverflow.com/questions/6266820/working-example-of-createjobobject-setinformationjobobject-pinvoke-in-net
*/
public class Job : IDisposable
{
public class Job : IDisposable
{
private IntPtr handle = IntPtr.Zero;
public Job()
@ -113,24 +113,24 @@ namespace v2rayN
private static extern bool CloseHandle(IntPtr hObject);
#endregion Interop
}
}
#region Helper classes
#region Helper classes
[StructLayout(LayoutKind.Sequential)]
internal struct IO_COUNTERS
{
[StructLayout(LayoutKind.Sequential)]
internal struct IO_COUNTERS
{
public UInt64 ReadOperationCount;
public UInt64 WriteOperationCount;
public UInt64 OtherOperationCount;
public UInt64 ReadTransferCount;
public UInt64 WriteTransferCount;
public UInt64 OtherTransferCount;
}
}
[StructLayout(LayoutKind.Sequential)]
internal struct JOBOBJECT_BASIC_LIMIT_INFORMATION
{
[StructLayout(LayoutKind.Sequential)]
internal struct JOBOBJECT_BASIC_LIMIT_INFORMATION
{
public Int64 PerProcessUserTimeLimit;
public Int64 PerJobUserTimeLimit;
public UInt32 LimitFlags;
@ -140,29 +140,29 @@ namespace v2rayN
public UIntPtr Affinity;
public UInt32 PriorityClass;
public UInt32 SchedulingClass;
}
}
[StructLayout(LayoutKind.Sequential)]
public struct SECURITY_ATTRIBUTES
{
[StructLayout(LayoutKind.Sequential)]
public struct SECURITY_ATTRIBUTES
{
public UInt32 nLength;
public IntPtr lpSecurityDescriptor;
public Int32 bInheritHandle;
}
}
[StructLayout(LayoutKind.Sequential)]
internal struct JOBOBJECT_EXTENDED_LIMIT_INFORMATION
{
[StructLayout(LayoutKind.Sequential)]
internal struct JOBOBJECT_EXTENDED_LIMIT_INFORMATION
{
public JOBOBJECT_BASIC_LIMIT_INFORMATION BasicLimitInformation;
public IO_COUNTERS IoInfo;
public UIntPtr ProcessMemoryLimit;
public UIntPtr JobMemoryLimit;
public UIntPtr PeakProcessMemoryUsed;
public UIntPtr PeakJobMemoryUsed;
}
}
public enum JobObjectInfoType
{
public enum JobObjectInfoType
{
AssociateCompletionPortInformation = 7,
BasicLimitInformation = 2,
BasicUIRestrictions = 4,
@ -170,7 +170,6 @@ namespace v2rayN
ExtendedLimitInformation = 9,
SecurityLimitInformation = 5,
GroupInformation = 11
}
#endregion Helper classes
}
#endregion Helper classes

View file

@ -3,10 +3,10 @@ using NLog.Config;
using NLog.Targets;
using System.IO;
namespace v2rayN.Tool
namespace v2rayN.Tool;
public class Logging
{
public class Logging
{
public static void Setup()
{
LoggingConfiguration config = new();
@ -51,5 +51,4 @@ namespace v2rayN.Tool
catch { }
});
}
}
}

View file

@ -1,10 +1,10 @@
using System.Linq.Expressions;
using System.Reflection;
namespace v2rayN.Tool
namespace v2rayN.Tool;
public static class QueryableExtension
{
public static class QueryableExtension
{
public static IOrderedQueryable<T> OrderBy<T>(this IQueryable<T> query, string propertyName)
{
return _OrderBy<T>(query, propertyName, false);
@ -46,5 +46,4 @@ namespace v2rayN.Tool
return lamba;
}
}
}

View file

@ -1,9 +1,9 @@
using v2rayN.Base;
namespace v2rayN.Tool
namespace v2rayN.Tool;
public class SemanticVersion
{
public class SemanticVersion
{
private int major;
private int minor;
private int patch;
@ -178,5 +178,4 @@ namespace v2rayN.Tool
}
#endregion Private
}
}

View file

@ -1,9 +1,9 @@
using System.Windows;
namespace v2rayN
namespace v2rayN;
internal class UI
{
internal class UI
{
private static readonly string caption = "v2rayN";
public static void Show(string msg)
@ -20,5 +20,4 @@ namespace v2rayN
{
return MessageBox.Show(msg, caption, MessageBoxButton.YesNo, MessageBoxImage.Question);
}
}
}

View file

@ -22,6 +22,7 @@ using System.Windows;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Xml.Serialization;
using v2rayN.Base;
using v2rayN.Mode;
using ZXing;
@ -29,10 +30,10 @@ using ZXing.Common;
using ZXing.QrCode;
using ZXing.Windows.Compatibility;
namespace v2rayN
namespace v2rayN;
internal class Utils
{
internal class Utils
{
#region Json操作
/// <summary>
@ -907,7 +908,7 @@ namespace v2rayN
{
object retval;
MemoryStream ms = new MemoryStream();
BinaryFormatter bf = new BinaryFormatter();
XmlSerializer bf = new XmlSerializer(obj.GetType());
//序列化成流
bf.Serialize(ms, obj);
ms.Seek(0, SeekOrigin.Begin);
@ -1273,5 +1274,4 @@ namespace v2rayN
public static extern int DwmSetWindowAttribute(IntPtr hwnd, DWMWINDOWATTRIBUTE attribute, ref int attributeValue, uint attributeSize);
#endregion Windows API
}
}

View file

@ -11,10 +11,10 @@ using v2rayN.Handler;
using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.ViewModels
namespace v2rayN.ViewModels;
public class AddServer2ViewModel : ReactiveValidationObject
{
public class AddServer2ViewModel : ReactiveValidationObject
{
private static Config _config;
private NoticeHandler? _noticeHandler;
private Window _view;
@ -156,5 +156,4 @@ namespace v2rayN.ViewModels
_noticeHandler?.Enqueue(ResUI.FailedReadConfiguration);
}
}
}
}

View file

@ -8,10 +8,10 @@ using v2rayN.Handler;
using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.ViewModels
namespace v2rayN.ViewModels;
public class AddServerViewModel : ReactiveObject
{
public class AddServerViewModel : ReactiveObject
{
private static Config _config;
private NoticeHandler? _noticeHandler;
private Window _view;
@ -158,5 +158,4 @@ namespace v2rayN.ViewModels
UI.Show(ResUI.OperationFailed);
}
}
}
}

View file

@ -7,10 +7,10 @@ using v2rayN.Handler;
using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.ViewModels
namespace v2rayN.ViewModels;
public class DNSSettingViewModel : ReactiveObject
{
public class DNSSettingViewModel : ReactiveObject
{
private static Config _config;
private NoticeHandler? _noticeHandler;
private Window _view;
@ -106,5 +106,4 @@ namespace v2rayN.ViewModels
_noticeHandler?.Enqueue(ResUI.OperationSuccess);
_view.DialogResult = true;
}
}
}

View file

@ -22,10 +22,10 @@ using v2rayN.Resx;
using v2rayN.Tool;
using v2rayN.Views;
namespace v2rayN.ViewModels
namespace v2rayN.ViewModels;
public class MainWindowViewModel : ReactiveObject
{
public class MainWindowViewModel : ReactiveObject
{
#region private prop
private CoreHandler _coreHandler;
@ -1842,5 +1842,4 @@ namespace v2rayN.ViewModels
}
#endregion UI
}
}

View file

@ -7,10 +7,10 @@ using v2rayN.Handler;
using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.ViewModels
namespace v2rayN.ViewModels;
public class OptionSettingViewModel : ReactiveObject
{
public class OptionSettingViewModel : ReactiveObject
{
private static Config _config;
private NoticeHandler? _noticeHandler;
private Window _view;
@ -364,5 +364,4 @@ namespace v2rayN.ViewModels
}
return 0;
}
}
}

View file

@ -8,10 +8,10 @@ using v2rayN.Handler;
using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.ViewModels
namespace v2rayN.ViewModels;
public class RoutingRuleDetailsViewModel : ReactiveObject
{
public class RoutingRuleDetailsViewModel : ReactiveObject
{
private static Config _config;
private NoticeHandler? _noticeHandler;
private Window _view;
@ -101,5 +101,4 @@ namespace v2rayN.ViewModels
//_noticeHandler?.Enqueue(ResUI.OperationSuccess);
_view.DialogResult = true;
}
}
}

View file

@ -12,10 +12,10 @@ using v2rayN.Resx;
using v2rayN.Views;
using Application = System.Windows.Application;
namespace v2rayN.ViewModels
namespace v2rayN.ViewModels;
public class RoutingRuleSettingViewModel : ReactiveObject
{
public class RoutingRuleSettingViewModel : ReactiveObject
{
private static Config _config;
private NoticeHandler? _noticeHandler;
private Window _view;
@ -356,5 +356,4 @@ namespace v2rayN.ViewModels
}
#endregion Import rules
}
}

View file

@ -10,10 +10,10 @@ using v2rayN.Mode;
using v2rayN.Resx;
using v2rayN.Views;
namespace v2rayN.ViewModels
namespace v2rayN.ViewModels;
public class RoutingSettingViewModel : ReactiveObject
{
public class RoutingSettingViewModel : ReactiveObject
{
private static Config _config;
private NoticeHandler? _noticeHandler;
private Window _view;
@ -304,5 +304,4 @@ namespace v2rayN.ViewModels
IsModified = true;
}
}
}
}

View file

@ -8,10 +8,10 @@ using v2rayN.Handler;
using v2rayN.Mode;
using v2rayN.Resx;
namespace v2rayN.ViewModels
namespace v2rayN.ViewModels;
public class SubEditViewModel : ReactiveObject
{
public class SubEditViewModel : ReactiveObject
{
private static Config _config;
private NoticeHandler? _noticeHandler;
private Window _view;
@ -82,5 +82,4 @@ namespace v2rayN.ViewModels
_noticeHandler?.Enqueue(ResUI.OperationFailed);
}
}
}
}

View file

@ -12,10 +12,10 @@ using v2rayN.Mode;
using v2rayN.Resx;
using v2rayN.Views;
namespace v2rayN.ViewModels
namespace v2rayN.ViewModels;
public class SubSettingViewModel : ReactiveObject
{
public class SubSettingViewModel : ReactiveObject
{
private static Config _config;
private NoticeHandler? _noticeHandler;
@ -126,5 +126,4 @@ namespace v2rayN.ViewModels
await DialogHost.Show(dialog, "SubDialog");
}
}
}

View file

@ -1,9 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<GenerateSatelliteAssembliesForCore>true</GenerateSatelliteAssembliesForCore>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<ApplicationManifest>app.manifest</ApplicationManifest>
@ -12,23 +11,21 @@
<Copyright>Copyright © 2017-2023 (GPLv3)</Copyright>
<FileVersion>6.28</FileVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Downloader" Version="3.0.6" />
<PackageReference Include="MaterialDesignThemes" Version="4.9.0" />
<PackageReference Include="H.NotifyIcon.Wpf" Version="2.0.108" />
<PackageReference Include="H.NotifyIcon.Wpf" Version="2.0.115" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="QRCoder.Xaml" Version="1.4.3" />
<PackageReference Include="sqlite-net-pcl" Version="1.8.116" />
<PackageReference Include="TaskScheduler" Version="2.10.1" />
<PackageReference Include="ZXing.Net.Bindings.Windows.Compatibility" Version="0.16.12" />
<PackageReference Include="ReactiveUI.Fody" Version="18.4.1" />
<PackageReference Include="ReactiveUI.Validation" Version="3.0.22" />
<PackageReference Include="ReactiveUI.Validation" Version="3.1.7" />
<PackageReference Include="ReactiveUI.WPF" Version="18.4.1" />
<PackageReference Include="Splat.NLog" Version="14.6.37" />
<PackageReference Include="Splat.NLog" Version="14.7.1" />
<PackageReference Include="System.Reactive" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="app.manifest" />
<EmbeddedResource Include="Sample\SingboxSampleClientConfig">
@ -86,12 +83,10 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PacLib\PacLib.csproj" />
<ProjectReference Include="..\ProtosLib\ProtosLib.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="Resx\ResUI.Designer.cs">
<DesignTime>True</DesignTime>
@ -99,7 +94,6 @@
<DependentUpon>ResUI.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Resx\ResUI.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
@ -118,5 +112,4 @@
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource>
</ItemGroup>
</Project>

View file

@ -6,10 +6,10 @@ using System.Text;
using System.Web;
using System.Windows.Forms;
namespace v2rayUpgrade
namespace v2rayUpgrade;
public partial class MainForm : Form
{
public partial class MainForm : Form
{
private readonly string defaultFilename = "v2ray-windows.zip";
private string? fileName;
@ -144,5 +144,4 @@ namespace v2rayUpgrade
}
return Path.Combine(startupPath, fileName);
}
}
}

View file

@ -1,13 +1,10 @@
using System;
using System.Windows.Forms;
namespace v2rayUpgrade
namespace v2rayUpgrade;
internal static class Program
{
internal static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
private static void Main(string[] args)
{
@ -16,5 +13,4 @@ namespace v2rayUpgrade
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm(args));
}
}
}

View file

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net7.0-windows</TargetFramework>
<OutputType>WinExe</OutputType>
<UseWindowsForms>true</UseWindowsForms>
<Copyright>Copyright © 2019-2023 (GPLv3)</Copyright>