Modern namespaces and typos fixed

This commit is contained in:
UMMANCODE 2024-07-18 17:52:32 +04:00
parent 70ea21fca2
commit 9b01195f29
35 changed files with 3518 additions and 3556 deletions

View file

@ -1,7 +1,7 @@
using ProtosLib.Statistics; using ProtosLib.Statistics;
namespace ProtosLib namespace ProtosLib;
{
public class Tests public class Tests
{ {
private StatsService.StatsServiceClient client_; private StatsService.StatsServiceClient client_;
@ -10,4 +10,3 @@ namespace ProtosLib
{ {
} }
} }
}

View file

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

View file

@ -2,8 +2,8 @@
using System.IO; using System.IO;
using System.Net; using System.Net;
namespace v2rayN namespace v2rayN;
{
internal class DownloaderHelper internal class DownloaderHelper
{ {
private static readonly Lazy<DownloaderHelper> _instance = new(() => new()); private static readonly Lazy<DownloaderHelper> _instance = new(() => new());
@ -178,4 +178,3 @@ namespace v2rayN
downloadOpt = null; downloadOpt = null;
} }
} }
}

View file

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

View file

@ -4,8 +4,8 @@ using System.Net.Http.Headers;
using System.Net.Mime; using System.Net.Mime;
using System.Text; using System.Text;
namespace v2rayN namespace v2rayN;
{
/// <summary> /// <summary>
/// </summary> /// </summary>
public class HttpClientHelper public class HttpClientHelper
@ -185,4 +185,3 @@ namespace v2rayN
} 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 v2rayN namespace v2rayN;
{
/* /*
* 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
@ -173,4 +172,3 @@ namespace v2rayN
} }
#endregion Helper classes #endregion Helper classes
}

View file

@ -3,8 +3,8 @@ 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 v2rayN namespace v2rayN;
{
internal class JsonUtils internal class JsonUtils
{ {
/// <summary> /// <summary>
@ -131,4 +131,3 @@ namespace v2rayN
} }
} }
} }
}

View file

@ -3,8 +3,8 @@ using NLog.Config;
using NLog.Targets; using NLog.Targets;
using System.IO; using System.IO;
namespace v2rayN namespace v2rayN;
{
public class Logging public class Logging
{ {
public static void Setup() public static void Setup()
@ -75,4 +75,3 @@ namespace v2rayN
} }
} }
} }
}

View file

@ -1,8 +1,8 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using static v2rayN.Common.ProxySetting.InternetConnectionOption; using static v2rayN.Common.ProxySetting.InternetConnectionOption;
namespace v2rayN.Common namespace v2rayN.Common;
{
internal class ProxySetting internal class ProxySetting
{ {
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 v2rayN.Common
); );
} }
} }
}

View file

@ -9,8 +9,8 @@ using ZXing.Common;
using ZXing.QrCode; using ZXing.QrCode;
using ZXing.Windows.Compatibility; using ZXing.Windows.Compatibility;
namespace v2rayN namespace v2rayN;
{
/// <summary> /// <summary>
/// 含有QR码的描述类和包装编码和渲染 /// 含有QR码的描述类和包装编码和渲染
/// </summary> /// </summary>
@ -101,4 +101,3 @@ namespace v2rayN
return new(96 / g.DpiX, 96 / g.DpiY); return new(96 / g.DpiX, 96 / g.DpiY);
} }
} }
}

View file

@ -1,8 +1,8 @@
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Reflection; using System.Reflection;
namespace v2rayN namespace v2rayN;
{
public static class QueryableExtension public static class QueryableExtension
{ {
public static IOrderedQueryable<T> OrderBy<T>(this IQueryable<T> query, string propertyName) public static IOrderedQueryable<T> OrderBy<T>(this IQueryable<T> query, string propertyName)
@ -47,4 +47,3 @@ namespace v2rayN
return lambda; return lambda;
} }
} }
}

View file

@ -1,5 +1,5 @@
namespace v2rayN namespace v2rayN;
{
public class SemanticVersion public class SemanticVersion
{ {
private int major; private int major;
@ -177,4 +177,3 @@
#endregion Private #endregion Private
} }
}

View file

@ -1,8 +1,8 @@
using SQLite; using SQLite;
using System.Collections; using System.Collections;
namespace v2rayN namespace v2rayN;
{
public sealed class SQLiteHelper public sealed class SQLiteHelper
{ {
private static readonly Lazy<SQLiteHelper> _instance = new(() => new()); private static readonly Lazy<SQLiteHelper> _instance = new(() => new());
@ -120,4 +120,3 @@ namespace v2rayN
return _dbAsync.Table<T>(); return _dbAsync.Table<T>();
} }
} }
}

View file

@ -1,8 +1,8 @@
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.IO; using System.IO;
namespace v2rayN namespace v2rayN;
{
internal static class StringEx internal static class StringEx
{ {
public static bool IsNullOrEmpty([NotNullWhen(false)] this string? value) public static bool IsNullOrEmpty([NotNullWhen(false)] this string? value)
@ -91,4 +91,3 @@ namespace v2rayN
return $"\"{value}\""; return $"\"{value}\"";
} }
} }
}

View file

@ -1,8 +1,8 @@
using Microsoft.Win32; using Microsoft.Win32;
using System.Windows; using System.Windows;
namespace v2rayN namespace v2rayN;
{
internal class UI internal class UI
{ {
private static readonly string caption = "v2rayN"; private static readonly string caption = "v2rayN";
@ -36,4 +36,3 @@ namespace v2rayN
return true; return true;
} }
} }
}

View file

@ -19,8 +19,8 @@ using System.Windows.Interop;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
namespace v2rayN namespace v2rayN;
{
internal class Utils internal class Utils
{ {
#region Json操作 #region Json操作
@ -1127,4 +1127,3 @@ namespace v2rayN
#endregion Windows API #endregion Windows API
} }
}

View file

@ -1,8 +1,8 @@
using YamlDotNet.Serialization; using YamlDotNet.Serialization;
using YamlDotNet.Serialization.NamingConventions; using YamlDotNet.Serialization.NamingConventions;
namespace v2rayN.Common namespace v2rayN.Common;
{
internal class YamlUtils internal class YamlUtils
{ {
#region YAML #region YAML
@ -55,4 +55,3 @@ namespace v2rayN.Common
#endregion YAML #endregion YAML
} }
}

View file

@ -1,8 +1,8 @@
using System.Windows.Data; using System.Windows.Data;
using System.Windows.Media; 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) public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
@ -22,4 +22,3 @@ namespace v2rayN.Converters
return null; return null;
} }
} }
}

View file

@ -1,8 +1,8 @@
using System.Globalization; using System.Globalization;
using System.Windows.Data; using System.Windows.Data;
namespace v2rayN.Converters namespace v2rayN.Converters;
{
[ValueConversion(typeof(bool), typeof(bool))] [ValueConversion(typeof(bool), typeof(bool))]
public class InverseBooleanConverter : IValueConverter public class InverseBooleanConverter : IValueConverter
{ {
@ -21,4 +21,3 @@ namespace v2rayN.Converters
throw new NotImplementedException(); throw new NotImplementedException();
} }
} }
}

View file

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

View file

@ -1,5 +1,5 @@
namespace v2rayN.Enums namespace v2rayN.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 v2rayN.Enums namespace v2rayN.Enums;
{
public enum ECoreType public enum ECoreType
{ {
v2fly = 1, v2fly = 1,
@ -17,4 +17,3 @@
hysteria2 = 26, hysteria2 = 26,
v2rayN = 99 v2rayN = 99
} }
}

View file

@ -1,5 +1,5 @@
namespace v2rayN.Enums namespace v2rayN.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 v2rayN.Enums namespace v2rayN.Enums;
{
public enum EInboundProtocol public enum EInboundProtocol
{ {
socks = 0, socks = 0,
@ -11,4 +11,3 @@
api2, api2,
speedtest = 21 speedtest = 21
} }
}

View file

@ -1,5 +1,5 @@
namespace v2rayN.Enums namespace v2rayN.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 v2rayN.Enums namespace v2rayN.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 v2rayN.Enums namespace v2rayN.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 v2rayN.Enums namespace v2rayN.Enums;
{
public enum ESpeedActionType public enum ESpeedActionType
{ {
Tcping, Tcping,
@ -7,4 +7,3 @@
Speedtest, Speedtest,
Mixedtest Mixedtest
} }
}

View file

@ -1,5 +1,5 @@
namespace v2rayN.Enums namespace v2rayN.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 v2rayN.Enums namespace v2rayN.Enums;
{
public enum ETransport public enum ETransport
{ {
tcp, tcp,
@ -12,4 +12,3 @@
quic, quic,
grpc grpc
} }
}

View file

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

View file

@ -1,7 +1,7 @@
using v2rayN.Enums; using v2rayN.Enums;
namespace v2rayN namespace v2rayN;
{
internal class Global internal class Global
{ {
#region const #region const
@ -194,4 +194,3 @@ namespace v2rayN
#endregion const #endregion const
} }
}

View file

@ -8,8 +8,7 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace v2rayN.Properties { namespace v2rayN.Properties;
using System;
/// <summary> /// <summary>
@ -220,4 +219,3 @@ namespace v2rayN.Properties {
} }
} }
} }
}

View file

@ -5,8 +5,8 @@ using System.IO.Compression;
using System.Text; using System.Text;
using System.Windows.Forms; 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 readonly string defaultFilename = "v2ray-windows.zip";
@ -144,4 +144,3 @@ namespace v2rayUpgrade
return Path.Combine(startupPath, fileName); return Path.Combine(startupPath, fileName);
} }
} }
}

View file

@ -1,8 +1,8 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
namespace v2rayUpgrade namespace v2rayUpgrade;
{
internal static class Program internal static class Program
{ {
/// <summary> /// <summary>
@ -18,4 +18,3 @@ namespace v2rayUpgrade
Application.Run(new MainForm(args)); Application.Run(new MainForm(args));
} }
} }
}