csharp_style_namespace_declarations = file_scoped

This commit is contained in:
2dust 2025-04-02 11:44:23 +08:00
parent d92540121f
commit 4d3db56065
186 changed files with 23574 additions and 23759 deletions

View file

@ -1,5 +1,5 @@
namespace AmazTool namespace AmazTool;
{
internal static class Program internal static class Program
{ {
[STAThread] [STAThread]
@ -23,4 +23,3 @@ namespace AmazTool
UpgradeApp.Upgrade(argData); UpgradeApp.Upgrade(argData);
} }
} }
}

View file

@ -2,8 +2,8 @@ using System.Diagnostics;
using System.IO.Compression; using System.IO.Compression;
using System.Text; using System.Text;
namespace AmazTool namespace AmazTool;
{
internal class UpgradeApp internal class UpgradeApp
{ {
public static void Upgrade(string fileName) public static void Upgrade(string fileName)
@ -114,4 +114,3 @@ namespace AmazTool
Utils.StartV2RayN(); Utils.StartV2RayN();
} }
} }
}

View file

@ -1,7 +1,7 @@
using System.Diagnostics; using System.Diagnostics;
namespace AmazTool namespace AmazTool;
{
internal class Utils internal class Utils
{ {
public static string GetExePath() public static string GetExePath()
@ -49,4 +49,3 @@ namespace AmazTool
} }
} }
} }
}

View file

@ -8,7 +8,7 @@
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch> <TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow> <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<NoWarn>CA1031;CS1591;NU1507;CA1416</NoWarn> <NoWarn>CA1031;CS1591;NU1507;CA1416;IDE0058</NoWarn>
<Nullable>annotations</Nullable> <Nullable>annotations</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Authors>2dust</Authors> <Authors>2dust</Authors>

View file

@ -1,10 +1,9 @@
using ReactiveUI; using ReactiveUI;
namespace ServiceLib.Base;
namespace ServiceLib.Base
{
public class MyReactiveObject : ReactiveObject public class MyReactiveObject : ReactiveObject
{ {
protected static Config? _config; protected static Config? _config;
protected Func<EViewAction, object?, Task<bool>>? _updateView; protected Func<EViewAction, object?, Task<bool>>? _updateView;
} }
}

View file

@ -1,8 +1,8 @@
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
namespace ServiceLib.Common namespace ServiceLib.Common;
{
public class AesUtils public class AesUtils
{ {
private const int KeySize = 256; // AES-256 private const int KeySize = 256; // AES-256
@ -98,4 +98,3 @@ namespace ServiceLib.Common
return randomNumber; return randomNumber;
} }
} }
}

View file

@ -1,8 +1,8 @@
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
namespace ServiceLib.Common namespace ServiceLib.Common;
{
public class DesUtils public class DesUtils
{ {
/// <summary> /// <summary>
@ -72,4 +72,3 @@ namespace ServiceLib.Common
return Utils.GetMd5(Utils.GetHomePath() + "DesUtils"); return Utils.GetMd5(Utils.GetHomePath() + "DesUtils");
} }
} }
}

View file

@ -1,8 +1,8 @@
using System.Net; using System.Net;
using Downloader; using Downloader;
namespace ServiceLib.Common namespace ServiceLib.Common;
{
public class DownloaderHelper public class DownloaderHelper
{ {
private static readonly Lazy<DownloaderHelper> _instance = new(() => new()); private static readonly Lazy<DownloaderHelper> _instance = new(() => new());
@ -178,4 +178,3 @@ namespace ServiceLib.Common
downloadOpt = null; downloadOpt = null;
} }
} }
}

View file

@ -2,8 +2,8 @@ using System.Formats.Tar;
using System.IO.Compression; using System.IO.Compression;
using System.Text; using System.Text;
namespace ServiceLib.Common namespace ServiceLib.Common;
{
public static class FileManager public static class FileManager
{ {
private static readonly string _tag = "FileManager"; private static readonly string _tag = "FileManager";
@ -224,4 +224,3 @@ namespace ServiceLib.Common
} }
} }
} }
}

View file

@ -2,8 +2,8 @@ using System.Net.Http.Headers;
using System.Net.Mime; using System.Net.Mime;
using System.Text; using System.Text;
namespace ServiceLib.Common namespace ServiceLib.Common;
{
/// <summary> /// <summary>
/// </summary> /// </summary>
public class HttpClientHelper public class HttpClientHelper
@ -203,4 +203,3 @@ namespace ServiceLib.Common
} while (isMoreToRead); } while (isMoreToRead);
} }
} }
}

View file

@ -1,8 +1,7 @@
using System.Diagnostics; using System.Diagnostics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace ServiceLib.Common namespace ServiceLib.Common;
{
/* /*
* See: * See:
* http://stackoverflow.com/questions/6266820/working-example-of-createjobobject-setinformationjobobject-pinvoke-in-net * http://stackoverflow.com/questions/6266820/working-example-of-createjobobject-setinformationjobobject-pinvoke-in-net
@ -178,4 +177,4 @@ namespace ServiceLib.Common
} }
#endregion Helper classes #endregion Helper classes
}

View file

@ -1,9 +1,9 @@
using System.Text.Json; using System.Text.Json;
using System.Text.Json.Nodes; using System.Text.Json.Nodes;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
namespace ServiceLib.Common namespace ServiceLib.Common;
{
public class JsonUtils public class JsonUtils
{ {
private static readonly string _tag = "JsonUtils"; private static readonly string _tag = "JsonUtils";
@ -128,4 +128,3 @@ namespace ServiceLib.Common
/// <returns></returns> /// <returns></returns>
public static JsonNode? SerializeToNode(object? obj) => JsonSerializer.SerializeToNode(obj); public static JsonNode? SerializeToNode(object? obj) => JsonSerializer.SerializeToNode(obj);
} }
}

View file

@ -2,10 +2,13 @@ using NLog;
using NLog.Config; using NLog.Config;
using NLog.Targets; using NLog.Targets;
namespace ServiceLib.Common namespace ServiceLib.Common;
{
public class Logging public class Logging
{ {
private static readonly Logger _logger1 = LogManager.GetLogger("Log1");
private static readonly Logger _logger2 = LogManager.GetLogger("Log2");
public static void Setup() public static void Setup()
{ {
LoggingConfiguration config = new(); LoggingConfiguration config = new();
@ -32,7 +35,7 @@ namespace ServiceLib.Common
return; return;
} }
LogManager.GetLogger("Log1").Info(strContent); _logger1.Info(strContent);
} }
public static void SaveLog(string strTitle, Exception ex) public static void SaveLog(string strTitle, Exception ex)
@ -42,13 +45,11 @@ namespace ServiceLib.Common
return; return;
} }
var logger = LogManager.GetLogger("Log2"); _logger2.Debug($"{strTitle},{ex.Message}");
logger.Debug($"{strTitle},{ex.Message}"); _logger2.Debug(ex.StackTrace);
logger.Debug(ex.StackTrace);
if (ex?.InnerException != null) if (ex?.InnerException != null)
{ {
logger.Error(ex.InnerException); _logger2.Error(ex.InnerException);
}
} }
} }
} }

View file

@ -1,9 +1,9 @@
using QRCoder; using QRCoder;
using SkiaSharp; using SkiaSharp;
using ZXing.SkiaSharp; using ZXing.SkiaSharp;
namespace ServiceLib.Common namespace ServiceLib.Common;
{
public class QRCodeHelper public class QRCodeHelper
{ {
public static byte[]? GenQRCode(string? url) public static byte[]? GenQRCode(string? url)
@ -87,4 +87,3 @@ namespace ServiceLib.Common
return flipped; return flipped;
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Common namespace ServiceLib.Common;
{
public class SemanticVersion public class SemanticVersion
{ {
private readonly int major; private readonly int major;
@ -184,4 +184,3 @@ namespace ServiceLib.Common
#endregion Private #endregion Private
} }
}

View file

@ -1,8 +1,8 @@
using System.Collections; using System.Collections;
using SQLite; using SQLite;
namespace ServiceLib.Common namespace ServiceLib.Common;
{
public sealed class SQLiteHelper public sealed class SQLiteHelper
{ {
private static readonly Lazy<SQLiteHelper> _instance = new(() => new()); private static readonly Lazy<SQLiteHelper> _instance = new(() => new());
@ -88,4 +88,3 @@ namespace ServiceLib.Common
}); });
} }
} }
}

View file

@ -1,7 +1,7 @@
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
namespace ServiceLib.Common namespace ServiceLib.Common;
{
public static class StringEx public static class StringEx
{ {
public static bool IsNullOrEmpty([NotNullWhen(false)] this string? value) public static bool IsNullOrEmpty([NotNullWhen(false)] this string? value)
@ -80,4 +80,3 @@ namespace ServiceLib.Common
return int.TryParse(value, out var result) ? result : defaultValue; return int.TryParse(value, out var result) ? result : defaultValue;
} }
} }
}

View file

@ -11,8 +11,8 @@ using System.Text;
using CliWrap; using CliWrap;
using CliWrap.Buffered; using CliWrap.Buffered;
namespace ServiceLib.Common namespace ServiceLib.Common;
{
public class Utils public class Utils
{ {
private static readonly string _tag = "Utils"; private static readonly string _tag = "Utils";
@ -863,4 +863,3 @@ namespace ServiceLib.Common
#endregion Platform #endregion Platform
} }
}

View file

@ -2,8 +2,8 @@ using System.Security.Cryptography;
using System.Text; using System.Text;
using Microsoft.Win32; using Microsoft.Win32;
namespace ServiceLib.Common namespace ServiceLib.Common;
{
internal static class WindowsUtils internal static class WindowsUtils
{ {
private static readonly string _tag = "WindowsUtils"; private static readonly string _tag = "WindowsUtils";
@ -71,4 +71,3 @@ namespace ServiceLib.Common
} }
} }
} }
}

View file

@ -2,8 +2,8 @@ using YamlDotNet.Core;
using YamlDotNet.Serialization; using YamlDotNet.Serialization;
using YamlDotNet.Serialization.NamingConventions; using YamlDotNet.Serialization.NamingConventions;
namespace ServiceLib.Common namespace ServiceLib.Common;
{
public class YamlUtils public class YamlUtils
{ {
private static readonly string _tag = "YamlUtils"; private static readonly string _tag = "YamlUtils";
@ -77,4 +77,3 @@ namespace ServiceLib.Common
#endregion YAML #endregion YAML
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums namespace ServiceLib.Enums;
{
public enum EConfigType public enum EConfigType
{ {
VMess = 1, VMess = 1,
@ -13,4 +13,3 @@
WireGuard = 9, WireGuard = 9,
HTTP = 10 HTTP = 10
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums namespace ServiceLib.Enums;
{
public enum ECoreType public enum ECoreType
{ {
v2fly = 1, v2fly = 1,
@ -16,4 +16,3 @@ namespace ServiceLib.Enums
overtls = 28, overtls = 28,
v2rayN = 99 v2rayN = 99
} }
}

View file

@ -1,9 +1,8 @@
namespace ServiceLib.Enums namespace ServiceLib.Enums;
{
public enum EGirdOrientation public enum EGirdOrientation
{ {
Horizontal, Horizontal,
Vertical, Vertical,
Tab, Tab,
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums namespace ServiceLib.Enums;
{
public enum EGlobalHotkey public enum EGlobalHotkey
{ {
ShowForm = 0, ShowForm = 0,
@ -8,4 +8,3 @@
SystemProxyUnchanged = 3, SystemProxyUnchanged = 3,
SystemProxyPac = 4, SystemProxyPac = 4,
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums namespace ServiceLib.Enums;
{
public enum EInboundProtocol public enum EInboundProtocol
{ {
socks = 0, socks = 0,
@ -11,4 +11,3 @@
mixed, mixed,
speedtest = 21 speedtest = 21
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums namespace ServiceLib.Enums;
{
public enum EMove public enum EMove
{ {
Top = 1, Top = 1,
@ -8,4 +8,3 @@
Bottom = 4, Bottom = 4,
Position = 5 Position = 5
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums namespace ServiceLib.Enums;
{
public enum EMsgCommand public enum EMsgCommand
{ {
ClearMsg, ClearMsg,
@ -8,4 +8,3 @@ namespace ServiceLib.Enums
RefreshProfiles, RefreshProfiles,
AppExit AppExit
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums namespace ServiceLib.Enums;
{
public enum EMultipleLoad public enum EMultipleLoad
{ {
Random, Random,
@ -7,4 +7,3 @@ namespace ServiceLib.Enums
LeastPing, LeastPing,
LeastLoad LeastLoad
} }
}

View file

@ -1,9 +1,8 @@
namespace ServiceLib.Enums namespace ServiceLib.Enums;
{
public enum EPresetType public enum EPresetType
{ {
Default = 0, Default = 0,
Russia = 1, Russia = 1,
Iran = 2, Iran = 2,
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums namespace ServiceLib.Enums;
{
public enum ERuleMode public enum ERuleMode
{ {
Rule = 0, Rule = 0,
@ -7,4 +7,3 @@
Direct = 2, Direct = 2,
Unchanged = 3 Unchanged = 3
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums namespace ServiceLib.Enums;
{
public enum EServerColName public enum EServerColName
{ {
Def = 0, Def = 0,
@ -18,4 +18,3 @@
TotalDown, TotalDown,
TotalUp TotalUp
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums namespace ServiceLib.Enums;
{
public enum ESpeedActionType public enum ESpeedActionType
{ {
Tcping, Tcping,
@ -7,4 +7,3 @@
Speedtest, Speedtest,
Mixedtest Mixedtest
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums namespace ServiceLib.Enums;
{
public enum ESysProxyType public enum ESysProxyType
{ {
ForcedClear = 0, ForcedClear = 0,
@ -7,4 +7,3 @@
Unchanged = 2, Unchanged = 2,
Pac = 3 Pac = 3
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums namespace ServiceLib.Enums;
{
public enum ETheme public enum ETheme
{ {
FollowSystem, FollowSystem,
@ -10,4 +10,3 @@
Dusk, Dusk,
NightSky NightSky
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums namespace ServiceLib.Enums;
{
public enum ETransport public enum ETransport
{ {
tcp, tcp,
@ -12,4 +12,3 @@
quic, quic,
grpc grpc
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Enums namespace ServiceLib.Enums;
{
public enum EViewAction public enum EViewAction
{ {
CloseWindow, CloseWindow,
@ -43,4 +43,3 @@
DispatcherCheckUpdateFinished, DispatcherCheckUpdateFinished,
DispatcherShowMsg, DispatcherShowMsg,
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib namespace ServiceLib;
{
public class Global public class Global
{ {
#region const #region const
@ -521,4 +521,3 @@ namespace ServiceLib
#endregion const #endregion const
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler namespace ServiceLib.Handler;
{
public sealed class AppHandler public sealed class AppHandler
{ {
#region Property #region Property
@ -241,4 +241,3 @@ namespace ServiceLib.Handler
#endregion Core Type #endregion Core Type
} }
}

View file

@ -1,8 +1,8 @@
using System.Security.Principal; using System.Security.Principal;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace ServiceLib.Handler namespace ServiceLib.Handler;
{
public static class AutoStartupHandler public static class AutoStartupHandler
{ {
private static readonly string _tag = "AutoStartupHandler"; private static readonly string _tag = "AutoStartupHandler";
@ -239,4 +239,3 @@ namespace ServiceLib.Handler
#endregion macOS #endregion macOS
} }
}

View file

@ -1,7 +1,7 @@
using static ServiceLib.Models.ClashProxies; using static ServiceLib.Models.ClashProxies;
namespace ServiceLib.Handler namespace ServiceLib.Handler;
{
public sealed class ClashApiHandler public sealed class ClashApiHandler
{ {
private static readonly Lazy<ClashApiHandler> instance = new(() => new()); private static readonly Lazy<ClashApiHandler> instance = new(() => new());
@ -185,4 +185,3 @@ namespace ServiceLib.Handler
return $"{Global.HttpProtocol}{Global.Loopback}:{AppHandler.Instance.StatePort2}"; return $"{Global.HttpProtocol}{Global.Loopback}:{AppHandler.Instance.StatePort2}";
} }
} }
}

View file

@ -1,8 +1,8 @@
using System.Data; using System.Data;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace ServiceLib.Handler namespace ServiceLib.Handler;
{
/// <summary> /// <summary>
/// 本软件配置文件处理类 /// 本软件配置文件处理类
/// </summary> /// </summary>
@ -1923,4 +1923,3 @@ namespace ServiceLib.Handler
#endregion Regional Presets #endregion Regional Presets
} }
}

View file

@ -1,9 +1,5 @@
using DynamicData; namespace ServiceLib.Handler;
using ServiceLib.Enums;
using ServiceLib.Models;
namespace ServiceLib.Handler
{
/// <summary> /// <summary>
/// Core configuration file processing class /// Core configuration file processing class
/// </summary> /// </summary>
@ -157,4 +153,3 @@ namespace ServiceLib.Handler
return result; return result;
} }
} }
}

View file

@ -1,8 +1,8 @@
using System.Diagnostics; using System.Diagnostics;
using System.Text; using System.Text;
namespace ServiceLib.Handler namespace ServiceLib.Handler;
{
/// <summary> /// <summary>
/// Core process processing class /// Core process processing class
/// </summary> /// </summary>
@ -407,4 +407,3 @@ namespace ServiceLib.Handler
#endregion Linux #endregion Linux
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler namespace ServiceLib.Handler;
{
public sealed class CoreInfoHandler public sealed class CoreInfoHandler
{ {
private static readonly Lazy<CoreInfoHandler> _instance = new(() => new()); private static readonly Lazy<CoreInfoHandler> _instance = new(() => new());
@ -215,4 +215,3 @@ namespace ServiceLib.Handler
return $"{Global.GithubUrl}/{Global.CoreUrls[eCoreType]}/releases"; return $"{Global.GithubUrl}/{Global.CoreUrls[eCoreType]}/releases";
} }
} }
}

View file

@ -1,7 +1,7 @@
using System.Collections.Specialized; using System.Collections.Specialized;
namespace ServiceLib.Handler.Fmt namespace ServiceLib.Handler.Fmt;
{
public class BaseFmt public class BaseFmt
{ {
protected static string GetIpv6(string address) protected static string GetIpv6(string address)
@ -239,4 +239,3 @@ namespace ServiceLib.Handler.Fmt
return $"{Global.ProtocolShares[eConfigType]}{url}{query}{remark}"; return $"{Global.ProtocolShares[eConfigType]}{url}{query}{remark}";
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.Fmt namespace ServiceLib.Handler.Fmt;
{
public class ClashFmt : BaseFmt public class ClashFmt : BaseFmt
{ {
public static ProfileItem? ResolveFull(string strData, string? subRemarks) public static ProfileItem? ResolveFull(string strData, string? subRemarks)
@ -20,4 +20,3 @@
return null; return null;
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.Fmt namespace ServiceLib.Handler.Fmt;
{
public class FmtHandler public class FmtHandler
{ {
private static readonly string _tag = "FmtHandler"; private static readonly string _tag = "FmtHandler";
@ -89,4 +89,3 @@
} }
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.Fmt namespace ServiceLib.Handler.Fmt;
{
public class Hysteria2Fmt : BaseFmt public class Hysteria2Fmt : BaseFmt
{ {
public static ProfileItem? Resolve(string str, out string msg) public static ProfileItem? Resolve(string str, out string msg)
@ -99,4 +99,3 @@ namespace ServiceLib.Handler.Fmt
return null; return null;
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.Fmt namespace ServiceLib.Handler.Fmt;
{
public class NaiveproxyFmt : BaseFmt public class NaiveproxyFmt : BaseFmt
{ {
public static ProfileItem? ResolveFull(string strData, string? subRemarks) public static ProfileItem? ResolveFull(string strData, string? subRemarks)
@ -20,4 +20,3 @@
return null; return null;
} }
} }
}

View file

@ -1,7 +1,7 @@
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace ServiceLib.Handler.Fmt namespace ServiceLib.Handler.Fmt;
{
public class ShadowsocksFmt : BaseFmt public class ShadowsocksFmt : BaseFmt
{ {
public static ProfileItem? Resolve(string str, out string msg) public static ProfileItem? Resolve(string str, out string msg)
@ -177,4 +177,3 @@ namespace ServiceLib.Handler.Fmt
return null; return null;
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.Fmt namespace ServiceLib.Handler.Fmt;
{
public class SingboxFmt : BaseFmt public class SingboxFmt : BaseFmt
{ {
public static List<ProfileItem>? ResolveFullArray(string strData, string? subRemarks) public static List<ProfileItem>? ResolveFullArray(string strData, string? subRemarks)
@ -45,4 +45,3 @@ namespace ServiceLib.Handler.Fmt
return profileItem; return profileItem;
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.Fmt namespace ServiceLib.Handler.Fmt;
{
public class SocksFmt : BaseFmt public class SocksFmt : BaseFmt
{ {
public static ProfileItem? Resolve(string str, out string msg) public static ProfileItem? Resolve(string str, out string msg)
@ -112,4 +112,3 @@ namespace ServiceLib.Handler.Fmt
return item; return item;
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.Fmt namespace ServiceLib.Handler.Fmt;
{
public class TrojanFmt : BaseFmt public class TrojanFmt : BaseFmt
{ {
public static ProfileItem? Resolve(string str, out string msg) public static ProfileItem? Resolve(string str, out string msg)
@ -45,4 +45,3 @@ namespace ServiceLib.Handler.Fmt
return ToUri(EConfigType.Trojan, item.Address, item.Port, item.Id, dicQuery, remark); return ToUri(EConfigType.Trojan, item.Address, item.Port, item.Id, dicQuery, remark);
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.Fmt namespace ServiceLib.Handler.Fmt;
{
public class TuicFmt : BaseFmt public class TuicFmt : BaseFmt
{ {
public static ProfileItem? Resolve(string str, out string msg) public static ProfileItem? Resolve(string str, out string msg)
@ -61,4 +61,3 @@ namespace ServiceLib.Handler.Fmt
return ToUri(EConfigType.TUIC, item.Address, item.Port, $"{item.Id}:{item.Security}", dicQuery, remark); return ToUri(EConfigType.TUIC, item.Address, item.Port, $"{item.Id}:{item.Security}", dicQuery, remark);
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.Fmt namespace ServiceLib.Handler.Fmt;
{
public class V2rayFmt : BaseFmt public class V2rayFmt : BaseFmt
{ {
public static List<ProfileItem>? ResolveFullArray(string strData, string? subRemarks) public static List<ProfileItem>? ResolveFullArray(string strData, string? subRemarks)
@ -46,4 +46,3 @@ namespace ServiceLib.Handler.Fmt
return profileItem; return profileItem;
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.Fmt namespace ServiceLib.Handler.Fmt;
{
public class VLESSFmt : BaseFmt public class VLESSFmt : BaseFmt
{ {
public static ProfileItem? Resolve(string str, out string msg) public static ProfileItem? Resolve(string str, out string msg)
@ -57,4 +57,3 @@ namespace ServiceLib.Handler.Fmt
return ToUri(EConfigType.VLESS, item.Address, item.Port, item.Id, dicQuery, remark); return ToUri(EConfigType.VLESS, item.Address, item.Port, item.Id, dicQuery, remark);
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.Fmt namespace ServiceLib.Handler.Fmt;
{
public class VmessFmt : BaseFmt public class VmessFmt : BaseFmt
{ {
public static ProfileItem? Resolve(string str, out string msg) public static ProfileItem? Resolve(string str, out string msg)
@ -123,4 +123,3 @@ namespace ServiceLib.Handler.Fmt
return item; return item;
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.Fmt namespace ServiceLib.Handler.Fmt;
{
public class WireguardFmt : BaseFmt public class WireguardFmt : BaseFmt
{ {
public static ProfileItem? Resolve(string str, out string msg) public static ProfileItem? Resolve(string str, out string msg)
@ -65,4 +65,3 @@ namespace ServiceLib.Handler.Fmt
return ToUri(EConfigType.WireGuard, item.Address, item.Port, item.Id, dicQuery, remark); return ToUri(EConfigType.WireGuard, item.Address, item.Port, item.Id, dicQuery, remark);
} }
} }
}

View file

@ -1,7 +1,7 @@
using ReactiveUI; using ReactiveUI;
namespace ServiceLib.Handler;
namespace ServiceLib.Handler
{
public class NoticeHandler public class NoticeHandler
{ {
private static readonly Lazy<NoticeHandler> _instance = new(() => new()); private static readonly Lazy<NoticeHandler> _instance = new(() => new());
@ -41,4 +41,3 @@ namespace ServiceLib.Handler
SendMessage(msg); SendMessage(msg);
} }
} }
}

View file

@ -1,8 +1,8 @@
using System.Net.Sockets; using System.Net.Sockets;
using System.Text; using System.Text;
namespace ServiceLib.Handler namespace ServiceLib.Handler;
{
public class PacHandler public class PacHandler
{ {
private static string _configPath; private static string _configPath;
@ -112,4 +112,3 @@ namespace ServiceLib.Handler
} }
} }
} }
}

View file

@ -2,8 +2,8 @@ using System.Collections.Concurrent;
//using System.Reactive.Linq; //using System.Reactive.Linq;
namespace ServiceLib.Handler namespace ServiceLib.Handler;
{
public class ProfileExHandler public class ProfileExHandler
{ {
private static readonly Lazy<ProfileExHandler> _instance = new(() => new()); private static readonly Lazy<ProfileExHandler> _instance = new(() => new());
@ -179,4 +179,3 @@ namespace ServiceLib.Handler
return _lstProfileEx.Max(t => t == null ? 0 : t.Sort); return _lstProfileEx.Max(t => t == null ? 0 : t.Sort);
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler namespace ServiceLib.Handler;
{
public class StatisticsHandler public class StatisticsHandler
{ {
private static readonly Lazy<StatisticsHandler> instance = new(() => new()); private static readonly Lazy<StatisticsHandler> instance = new(() => new());
@ -161,4 +161,3 @@
} }
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.SysProxy namespace ServiceLib.Handler.SysProxy;
{
public class ProxySettingLinux public class ProxySettingLinux
{ {
private static readonly string _proxySetFileName = $"{Global.ProxySetLinuxShellFileName.Replace(Global.NamespaceSample, "")}.sh"; private static readonly string _proxySetFileName = $"{Global.ProxySetLinuxShellFileName.Replace(Global.NamespaceSample, "")}.sh";
@ -30,4 +30,3 @@ namespace ServiceLib.Handler.SysProxy
await Utils.GetCliWrapOutput(fileName, args); await Utils.GetCliWrapOutput(fileName, args);
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.SysProxy namespace ServiceLib.Handler.SysProxy;
{
public class ProxySettingOSX public class ProxySettingOSX
{ {
private static readonly string _proxySetFileName = $"{Global.ProxySetOSXShellFileName.Replace(Global.NamespaceSample, "")}.sh"; private static readonly string _proxySetFileName = $"{Global.ProxySetOSXShellFileName.Replace(Global.NamespaceSample, "")}.sh";
@ -35,4 +35,3 @@ namespace ServiceLib.Handler.SysProxy
await Utils.GetCliWrapOutput(fileName, args); await Utils.GetCliWrapOutput(fileName, args);
} }
} }
}

View file

@ -1,8 +1,8 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using static ServiceLib.Handler.SysProxy.ProxySettingWindows.InternetConnectionOption; using static ServiceLib.Handler.SysProxy.ProxySettingWindows.InternetConnectionOption;
namespace ServiceLib.Handler.SysProxy namespace ServiceLib.Handler.SysProxy;
{
public class ProxySettingWindows public class ProxySettingWindows
{ {
private const string _regPath = @"Software\Microsoft\Windows\CurrentVersion\Internet Settings"; private const string _regPath = @"Software\Microsoft\Windows\CurrentVersion\Internet Settings";
@ -357,4 +357,3 @@ namespace ServiceLib.Handler.SysProxy
); );
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler.SysProxy namespace ServiceLib.Handler.SysProxy;
{
public static class SysProxyHandler public static class SysProxyHandler
{ {
private static readonly string _tag = "SysProxyHandler"; private static readonly string _tag = "SysProxyHandler";
@ -96,4 +96,3 @@
ProxySettingWindows.SetProxy(strProxy, "", 4); ProxySettingWindows.SetProxy(strProxy, "", 4);
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Handler namespace ServiceLib.Handler;
{
public class TaskHandler public class TaskHandler
{ {
private static readonly Lazy<TaskHandler> _instance = new(() => new()); private static readonly Lazy<TaskHandler> _instance = new(() => new());
@ -95,4 +95,3 @@ namespace ServiceLib.Handler
} }
} }
} }
}

View file

@ -1,8 +1,8 @@
using System.Net; using System.Net;
using WebDav; using WebDav;
namespace ServiceLib.Handler namespace ServiceLib.Handler;
{
public sealed class WebDavHandler public sealed class WebDavHandler
{ {
private static readonly Lazy<WebDavHandler> _instance = new(() => new()); private static readonly Lazy<WebDavHandler> _instance = new(() => new());
@ -179,4 +179,3 @@ namespace ServiceLib.Handler
public string GetLastError() => _lastDescription ?? string.Empty; public string GetLastError() => _lastDescription ?? string.Empty;
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
public class CheckUpdateModel public class CheckUpdateModel
{ {
public bool? IsSelected { get; set; } public bool? IsSelected { get; set; }
@ -8,4 +8,3 @@
public string? FileName { get; set; } public string? FileName { get; set; }
public bool? IsFinished { get; set; } public bool? IsFinished { get; set; }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
public class ClashConnectionModel public class ClashConnectionModel
{ {
public string? Id { get; set; } public string? Id { get; set; }
@ -14,4 +14,3 @@
public string? Elapsed { get; set; } public string? Elapsed { get; set; }
public string? Chain { get; set; } public string? Chain { get; set; }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
public class ClashConnections public class ClashConnections
{ {
public ulong downloadTotal { get; set; } public ulong downloadTotal { get; set; }
@ -34,4 +34,3 @@
public string? processPath { get; set; } public string? processPath { get; set; }
public string? remoteDestination { get; set; } public string? remoteDestination { get; set; }
} }
}

View file

@ -1,7 +1,7 @@
using static ServiceLib.Models.ClashProxies; using static ServiceLib.Models.ClashProxies;
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
public class ClashProviders public class ClashProviders
{ {
public Dictionary<string, ProvidersItem>? providers { get; set; } public Dictionary<string, ProvidersItem>? providers { get; set; }
@ -14,4 +14,3 @@ namespace ServiceLib.Models
public string? vehicleType { get; set; } public string? vehicleType { get; set; }
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
public class ClashProxies public class ClashProxies
{ {
public Dictionary<string, ProxiesItem>? proxies { get; set; } public Dictionary<string, ProxiesItem>? proxies { get; set; }
@ -21,4 +21,3 @@
public int delay { get; set; } public int delay { get; set; }
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
[Serializable] [Serializable]
public class ClashProxyModel public class ClashProxyModel
{ {
@ -15,4 +15,3 @@
public bool IsActive { get; set; } public bool IsActive { get; set; }
} }
}

View file

@ -1,8 +1,7 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
public class CmdItem public class CmdItem
{ {
public string? Cmd { get; set; } public string? Cmd { get; set; }
public List<string>? Arguments { get; set; } public List<string>? Arguments { get; set; }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
public class ComboItem public class ComboItem
{ {
public string? ID public string? ID
@ -12,4 +12,3 @@
get; set; get; set;
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
/// <summary> /// <summary>
/// 本软件配置文件实体类 /// 本软件配置文件实体类
/// </summary> /// </summary>
@ -54,4 +54,3 @@
#endregion other entities #endregion other entities
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
[Serializable] [Serializable]
public class CoreBasicItem public class CoreBasicItem
{ {
@ -245,4 +245,3 @@ namespace ServiceLib.Models
public string? Length { get; set; } public string? Length { get; set; }
public string? Interval { get; set; } public string? Interval { get; set; }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
[Serializable] [Serializable]
public class CoreInfo public class CoreInfo
{ {
@ -18,4 +18,3 @@ namespace ServiceLib.Models
public string? VersionArg { get; set; } public string? VersionArg { get; set; }
public bool AbsolutePath { get; set; } public bool AbsolutePath { get; set; }
} }
}

View file

@ -1,7 +1,7 @@
using SQLite; using SQLite;
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
[Serializable] [Serializable]
public class DNSItem public class DNSItem
{ {
@ -17,4 +17,3 @@ namespace ServiceLib.Models
public string? DomainStrategy4Freedom { get; set; } public string? DomainStrategy4Freedom { get; set; }
public string? DomainDNSAddress { get; set; } public string? DomainDNSAddress { get; set; }
} }
}

View file

@ -1,7 +1,7 @@
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
public class GitHubReleaseAsset public class GitHubReleaseAsset
{ {
[JsonPropertyName("url")] public string? Url { get; set; } [JsonPropertyName("url")] public string? Url { get; set; }
@ -65,4 +65,3 @@ namespace ServiceLib.Models
[JsonPropertyName("body")] public string? Body { get; set; } [JsonPropertyName("body")] public string? Body { get; set; }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
internal class IPAPIInfo internal class IPAPIInfo
{ {
public string? ip { get; set; } public string? ip { get; set; }
@ -10,4 +10,3 @@
public string? country_name { get; set; } public string? country_name { get; set; }
public string? country_code { get; set; } public string? country_code { get; set; }
} }
}

View file

@ -1,7 +1,7 @@
using SQLite; using SQLite;
namespace ServiceLib.Models namespace ServiceLib.Models;
{
[Serializable] [Serializable]
public class ProfileExItem public class ProfileExItem
{ {
@ -13,4 +13,3 @@ namespace ServiceLib.Models
public int Sort { get; set; } public int Sort { get; set; }
public string? Message { get; set; } public string? Message { get; set; }
} }
}

View file

@ -1,7 +1,7 @@
using SQLite; using SQLite;
namespace ServiceLib.Models namespace ServiceLib.Models;
{
[Serializable] [Serializable]
public class ProfileItem public class ProfileItem
{ {
@ -64,6 +64,7 @@ namespace ServiceLib.Models
[PrimaryKey] [PrimaryKey]
public string IndexId { get; set; } public string IndexId { get; set; }
public EConfigType ConfigType { get; set; } public EConfigType ConfigType { get; set; }
public int ConfigVersion { get; set; } public int ConfigVersion { get; set; }
public string Address { get; set; } public string Address { get; set; }
@ -93,4 +94,3 @@ namespace ServiceLib.Models
public string SpiderX { get; set; } public string SpiderX { get; set; }
public string Extra { get; set; } public string Extra { get; set; }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
[Serializable] [Serializable]
public class ProfileItemModel : ProfileItem public class ProfileItemModel : ProfileItem
{ {
@ -15,4 +15,3 @@
public string TotalUp { get; set; } public string TotalUp { get; set; }
public string TotalDown { get; set; } public string TotalDown { get; set; }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
public class RetResult public class RetResult
{ {
public bool Success { get; set; } public bool Success { get; set; }
@ -24,4 +24,3 @@
Data = data; Data = data;
} }
} }
}

View file

@ -1,7 +1,7 @@
using SQLite; using SQLite;
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
[Serializable] [Serializable]
public class RoutingItem public class RoutingItem
{ {
@ -20,4 +20,3 @@ namespace ServiceLib.Models
public string DomainStrategy4Singbox { get; set; } public string DomainStrategy4Singbox { get; set; }
public int Sort { get; set; } public int Sort { get; set; }
} }
}

View file

@ -1,8 +1,7 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
[Serializable] [Serializable]
public class RoutingItemModel : RoutingItem public class RoutingItemModel : RoutingItem
{ {
public bool IsActive { get; set; } public bool IsActive { get; set; }
} }
}

View file

@ -1,9 +1,8 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
[Serializable] [Serializable]
public class RoutingTemplate public class RoutingTemplate
{ {
public string Version { get; set; } public string Version { get; set; }
public RoutingItem[] RoutingItems { get; set; } public RoutingItem[] RoutingItems { get; set; }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
[Serializable] [Serializable]
public class RulesItem public class RulesItem
{ {
@ -16,4 +16,3 @@
public bool Enabled { get; set; } = true; public bool Enabled { get; set; } = true;
public string? Remarks { get; set; } public string? Remarks { get; set; }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
[Serializable] [Serializable]
public class RulesItemModel : RulesItem public class RulesItemModel : RulesItem
{ {
@ -8,4 +8,3 @@
public string Domains { get; set; } public string Domains { get; set; }
public string Protocols { get; set; } public string Protocols { get; set; }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
[Serializable] [Serializable]
public class ServerSpeedItem : ServerStatItem public class ServerSpeedItem : ServerStatItem
{ {
@ -19,4 +19,3 @@
public ulong Down { get; set; } public ulong Down { get; set; }
} }
}

View file

@ -1,7 +1,7 @@
using SQLite; using SQLite;
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
[Serializable] [Serializable]
public class ServerStatItem public class ServerStatItem
{ {
@ -18,4 +18,3 @@ namespace ServiceLib.Models
public long DateNow { get; set; } public long DateNow { get; set; }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
[Serializable] [Serializable]
public class ServerTestItem public class ServerTestItem
{ {
@ -10,4 +10,3 @@ namespace ServiceLib.Models
public bool AllowTest { get; set; } public bool AllowTest { get; set; }
public int QueueNum { get; set; } public int QueueNum { get; set; }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
public class SingboxConfig public class SingboxConfig
{ {
public Log4Sbox log { get; set; } public Log4Sbox log { get; set; }
@ -254,4 +254,3 @@ namespace ServiceLib.Models
public string? download_detour { get; set; } public string? download_detour { get; set; }
public string? update_interval { get; set; } public string? update_interval { get; set; }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
[Serializable] [Serializable]
public class SpeedTestResult public class SpeedTestResult
{ {
@ -9,4 +9,3 @@
public string? Speed { get; set; } public string? Speed { get; set; }
} }
}

View file

@ -1,5 +1,5 @@
namespace ServiceLib.Models namespace ServiceLib.Models;
{
public class SsSIP008 public class SsSIP008
{ {
public List<SsServer>? servers { get; set; } public List<SsServer>? servers { get; set; }
@ -15,4 +15,3 @@
public string? password { get; set; } public string? password { get; set; }
public string? plugin { get; set; } public string? plugin { get; set; }
} }
}

View file

@ -1,7 +1,7 @@
using SQLite; using SQLite;
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
[Serializable] [Serializable]
public class SubItem public class SubItem
{ {
@ -36,4 +36,3 @@ namespace ServiceLib.Models
public string? Memo { get; set; } public string? Memo { get; set; }
} }
}

View file

@ -1,7 +1,7 @@
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
namespace ServiceLib.Models namespace ServiceLib.Models;
{
public class V2rayConfig public class V2rayConfig
{ {
public Log4Ray log { get; set; } public Log4Ray log { get; set; }
@ -434,4 +434,3 @@ namespace ServiceLib.Models
public string? length { get; set; } public string? length { get; set; }
public string? interval { get; set; } public string? interval { get; set; }
} }
}

View file

@ -1,12 +1,11 @@
using System.Collections; using System.Collections;
namespace ServiceLib.Models;
namespace ServiceLib.Models
{
internal class V2rayMetricsVars internal class V2rayMetricsVars
{ {
public V2rayMetricsVarsStats? stats { get; set; } public V2rayMetricsVarsStats? stats { get; set; }
} }
}
public class V2rayMetricsVarsStats public class V2rayMetricsVarsStats
{ {

Some files were not shown because too many files have changed in this diff Show more