Merge branch 'master' into master

This commit is contained in:
2dust 2024-10-14 17:50:36 +08:00 committed by GitHub
commit e15a55dbbe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
56 changed files with 841 additions and 958 deletions

View file

@ -36,7 +36,7 @@ namespace ServiceLib.Common
} }
}; };
using var downloader = new Downloader.DownloadService(downloadOpt); await using var downloader = new Downloader.DownloadService(downloadOpt);
downloader.DownloadFileCompleted += (sender, value) => downloader.DownloadFileCompleted += (sender, value) =>
{ {
if (value.Error != null) if (value.Error != null)
@ -46,12 +46,12 @@ namespace ServiceLib.Common
}; };
using var cts = new CancellationTokenSource(); using var cts = new CancellationTokenSource();
using var stream = await downloader.DownloadFileTaskAsync(address: url, cts.Token).WaitAsync(TimeSpan.FromSeconds(timeout), cts.Token); await using var stream = await downloader.DownloadFileTaskAsync(address: url, cts.Token).WaitAsync(TimeSpan.FromSeconds(timeout), cts.Token);
using StreamReader reader = new(stream); using StreamReader reader = new(stream);
downloadOpt = null; downloadOpt = null;
return reader.ReadToEnd(); return await reader.ReadToEndAsync(cts.Token);
} }
public async Task DownloadDataAsync4Speed(IWebProxy webProxy, string url, IProgress<string> progress, int timeout) public async Task DownloadDataAsync4Speed(IWebProxy webProxy, string url, IProgress<string> progress, int timeout)
@ -72,11 +72,11 @@ namespace ServiceLib.Common
} }
}; };
DateTime totalDatetime = DateTime.Now; var totalDatetime = DateTime.Now;
int totalSecond = 0; var totalSecond = 0;
var hasValue = false; var hasValue = false;
double maxSpeed = 0; double maxSpeed = 0;
using var downloader = new Downloader.DownloadService(downloadOpt); await using var downloader = new Downloader.DownloadService(downloadOpt);
//downloader.DownloadStarted += (sender, value) => //downloader.DownloadStarted += (sender, value) =>
//{ //{
// if (progress != null) // if (progress != null)
@ -86,7 +86,7 @@ namespace ServiceLib.Common
//}; //};
downloader.DownloadProgressChanged += (sender, value) => downloader.DownloadProgressChanged += (sender, value) =>
{ {
TimeSpan ts = (DateTime.Now - totalDatetime); var ts = (DateTime.Now - totalDatetime);
if (progress != null && ts.Seconds > totalSecond) if (progress != null && ts.Seconds > totalSecond)
{ {
hasValue = true; hasValue = true;
@ -112,7 +112,7 @@ namespace ServiceLib.Common
//progress.Report("......"); //progress.Report("......");
using var cts = new CancellationTokenSource(); using var cts = new CancellationTokenSource();
cts.CancelAfter(timeout * 1000); cts.CancelAfter(timeout * 1000);
using var stream = await downloader.DownloadFileTaskAsync(address: url, cts.Token); await using var stream = await downloader.DownloadFileTaskAsync(address: url, cts.Token);
downloadOpt = null; downloadOpt = null;
} }
@ -145,7 +145,7 @@ namespace ServiceLib.Common
var progressPercentage = 0; var progressPercentage = 0;
var hasValue = false; var hasValue = false;
using var downloader = new Downloader.DownloadService(downloadOpt); await using var downloader = new Downloader.DownloadService(downloadOpt);
downloader.DownloadStarted += (sender, value) => downloader.DownloadStarted += (sender, value) =>
{ {
progress?.Report(0); progress?.Report(0);

View file

@ -23,7 +23,7 @@ namespace ServiceLib.Common
{ {
try try
{ {
using FileStream fs = File.Create(fileName); using var fs = File.Create(fileName);
using GZipStream input = new(new MemoryStream(content), CompressionMode.Decompress, false); using GZipStream input = new(new MemoryStream(content), CompressionMode.Decompress, false);
input.CopyTo(fs); input.CopyTo(fs);
} }
@ -38,8 +38,8 @@ namespace ServiceLib.Common
try try
{ {
FileInfo fileInfo = new(fileName); FileInfo fileInfo = new(fileName);
using FileStream originalFileStream = fileInfo.OpenRead(); using var originalFileStream = fileInfo.OpenRead();
using FileStream decompressedFileStream = File.Create(toName != null ? Path.Combine(toPath, toName) : toPath); using var decompressedFileStream = File.Create(toName != null ? Path.Combine(toPath, toName) : toPath);
using GZipStream decompressionStream = new(originalFileStream, CompressionMode.Decompress); using GZipStream decompressionStream = new(originalFileStream, CompressionMode.Decompress);
decompressionStream.CopyTo(decompressedFileStream); decompressionStream.CopyTo(decompressedFileStream);
} }
@ -54,7 +54,7 @@ namespace ServiceLib.Common
return NonExclusiveReadAllText(path, Encoding.Default); return NonExclusiveReadAllText(path, Encoding.Default);
} }
public static string NonExclusiveReadAllText(string path, Encoding encoding) private static string NonExclusiveReadAllText(string path, Encoding encoding)
{ {
try try
{ {
@ -73,8 +73,8 @@ namespace ServiceLib.Common
{ {
try try
{ {
using ZipArchive archive = ZipFile.OpenRead(fileName); using var archive = ZipFile.OpenRead(fileName);
foreach (ZipArchiveEntry entry in archive.Entries) foreach (var entry in archive.Entries)
{ {
if (entry.Length == 0) if (entry.Length == 0)
{ {
@ -110,7 +110,7 @@ namespace ServiceLib.Common
} }
try try
{ {
using ZipArchive archive = ZipFile.OpenRead(fileName); using var archive = ZipFile.OpenRead(fileName);
return archive.Entries.Select(entry => entry.FullName).ToList(); return archive.Entries.Select(entry => entry.FullName).ToList();
} }
catch (Exception ex) catch (Exception ex)
@ -149,13 +149,13 @@ namespace ServiceLib.Common
throw new DirectoryNotFoundException($"Source directory not found: {dir.FullName}"); throw new DirectoryNotFoundException($"Source directory not found: {dir.FullName}");
// Cache directories before we start copying // Cache directories before we start copying
DirectoryInfo[] dirs = dir.GetDirectories(); var dirs = dir.GetDirectories();
// Create the destination directory // Create the destination directory
Directory.CreateDirectory(destinationDir); Directory.CreateDirectory(destinationDir);
// Get the files in the source directory and copy to the destination directory // Get the files in the source directory and copy to the destination directory
foreach (FileInfo file in dir.GetFiles()) foreach (var file in dir.GetFiles())
{ {
if (Utils.IsNotEmpty(ignoredName) && file.Name.Contains(ignoredName)) if (Utils.IsNotEmpty(ignoredName) && file.Name.Contains(ignoredName))
{ {
@ -165,16 +165,16 @@ namespace ServiceLib.Common
{ {
continue; continue;
} }
string targetFilePath = Path.Combine(destinationDir, file.Name); var targetFilePath = Path.Combine(destinationDir, file.Name);
file.CopyTo(targetFilePath); file.CopyTo(targetFilePath);
} }
// If recursive and copying subdirectories, recursively call this method // If recursive and copying subdirectories, recursively call this method
if (recursive) if (recursive)
{ {
foreach (DirectoryInfo subDir in dirs) foreach (var subDir in dirs)
{ {
string newDestinationDir = Path.Combine(destinationDir, subDir.Name); var newDestinationDir = Path.Combine(destinationDir, subDir.Name);
CopyDirectory(subDir.FullName, newDestinationDir, true, ignoredName); CopyDirectory(subDir.FullName, newDestinationDir, true, ignoredName);
} }
} }

View file

@ -27,7 +27,7 @@ namespace ServiceLib.Common
try try
{ {
HttpResponseMessage response = await httpClient.GetAsync(url); var response = await httpClient.GetAsync(url);
return await response.Content.ReadAsStringAsync(); return await response.Content.ReadAsStringAsync();
} }
catch catch
@ -84,8 +84,8 @@ namespace ServiceLib.Common
var total = response.Content.Headers.ContentLength ?? -1L; var total = response.Content.Headers.ContentLength ?? -1L;
var canReportProgress = total != -1 && progress != null; var canReportProgress = total != -1 && progress != null;
using var stream = await response.Content.ReadAsStreamAsync(token); await using var stream = await response.Content.ReadAsStreamAsync(token);
using var file = File.Create(fileName); await using var file = File.Create(fileName);
var totalRead = 0L; var totalRead = 0L;
var buffer = new byte[1024 * 1024]; var buffer = new byte[1024 * 1024];
var progressPercentage = 0; var progressPercentage = 0;
@ -98,7 +98,7 @@ namespace ServiceLib.Common
totalRead += read; totalRead += read;
if (read == 0) break; if (read == 0) break;
file.Write(buffer, 0, read); await file.WriteAsync(buffer, 0, read, token);
if (canReportProgress) if (canReportProgress)
{ {
@ -133,13 +133,13 @@ namespace ServiceLib.Common
//var total = response.Content.Headers.ContentLength.HasValue ? response.Content.Headers.ContentLength.Value : -1L; //var total = response.Content.Headers.ContentLength.HasValue ? response.Content.Headers.ContentLength.Value : -1L;
//var canReportProgress = total != -1 && progress != null; //var canReportProgress = total != -1 && progress != null;
using var stream = await response.Content.ReadAsStreamAsync(token); await using var stream = await response.Content.ReadAsStreamAsync(token);
var totalRead = 0L; var totalRead = 0L;
var buffer = new byte[1024 * 64]; var buffer = new byte[1024 * 64];
var isMoreToRead = true; var isMoreToRead = true;
string progressSpeed = string.Empty; var progressSpeed = string.Empty;
DateTime totalDatetime = DateTime.Now; var totalDatetime = DateTime.Now;
int totalSecond = 0; var totalSecond = 0;
do do
{ {
@ -168,7 +168,7 @@ namespace ServiceLib.Common
totalRead += read; totalRead += read;
TimeSpan ts = (DateTime.Now - totalDatetime); var ts = (DateTime.Now - totalDatetime);
if (progress != null && ts.Seconds > totalSecond) if (progress != null && ts.Seconds > totalSecond)
{ {
totalSecond = ts.Seconds; totalSecond = ts.Seconds;

View file

@ -8,7 +8,7 @@ namespace ServiceLib.Common
* 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
*/ */
public class Job : IDisposable public sealed class Job : IDisposable
{ {
private IntPtr handle = IntPtr.Zero; private IntPtr handle = IntPtr.Zero;
@ -73,7 +73,7 @@ namespace ServiceLib.Common
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
} }
protected virtual void Dispose(bool disposing) private void Dispose(bool disposing)
{ {
if (disposed) return; if (disposed) return;
disposed = true; disposed = true;

View file

@ -69,7 +69,7 @@ namespace ServiceLib.Common
/// <returns></returns> /// <returns></returns>
public static string Serialize(object? obj, bool indented = true) public static string Serialize(object? obj, bool indented = true)
{ {
string result = string.Empty; var result = string.Empty;
try try
{ {
if (obj == null) if (obj == null)
@ -112,7 +112,7 @@ namespace ServiceLib.Common
} }
try try
{ {
using FileStream file = File.Create(filePath); using var file = File.Create(filePath);
var options = new JsonSerializerOptions var options = new JsonSerializerOptions
{ {

View file

@ -7,7 +7,7 @@ namespace ServiceLib.Common
public static byte[]? GenQRCode(string? url) public static byte[]? GenQRCode(string? url)
{ {
using QRCodeGenerator qrGenerator = new(); using QRCodeGenerator qrGenerator = new();
using QRCodeData qrCodeData = qrGenerator.CreateQrCode(url ?? string.Empty, QRCodeGenerator.ECCLevel.Q); using var qrCodeData = qrGenerator.CreateQrCode(url ?? string.Empty, QRCodeGenerator.ECCLevel.Q);
using PngByteQRCode qrCode = new(qrCodeData); using PngByteQRCode qrCode = new(qrCodeData);
return qrCode.GetGraphic(20); return qrCode.GetGraphic(20);
} }

View file

@ -17,7 +17,7 @@ namespace ServiceLib.Common
private static IOrderedQueryable<T> _OrderBy<T>(IQueryable<T> query, string propertyName, bool isDesc) private static IOrderedQueryable<T> _OrderBy<T>(IQueryable<T> query, string propertyName, bool isDesc)
{ {
string methodname = (isDesc) ? "OrderByDescendingInternal" : "OrderByInternal"; var methodname = (isDesc) ? "OrderByDescendingInternal" : "OrderByInternal";
var memberProp = typeof(T).GetProperty(propertyName); var memberProp = typeof(T).GetProperty(propertyName);

View file

@ -28,14 +28,14 @@
} }
this.version = version.RemovePrefix('v'); this.version = version.RemovePrefix('v');
string[] parts = this.version.Split('.'); var parts = this.version.Split('.');
if (parts.Length == 2) if (parts.Length == 2)
{ {
this.major = int.Parse(parts[0]); this.major = int.Parse(parts[0]);
this.minor = int.Parse(parts[1]); this.minor = int.Parse(parts[1]);
this.patch = 0; this.patch = 0;
} }
else if (parts.Length == 3 || parts.Length == 4) else if (parts.Length is 3 or 4)
{ {
this.major = int.Parse(parts[0]); this.major = int.Parse(parts[0]);
this.minor = int.Parse(parts[1]); this.minor = int.Parse(parts[1]);

View file

@ -11,7 +11,7 @@ namespace ServiceLib.Common
private SQLiteConnection _db; private SQLiteConnection _db;
private SQLiteAsyncConnection _dbAsync; private SQLiteAsyncConnection _dbAsync;
private static readonly object objLock = new(); private static readonly object objLock = new();
public readonly string _configDB = "guiNDB.db"; private readonly string _configDB = "guiNDB.db";
public SQLiteHelper() public SQLiteHelper()
{ {

View file

@ -25,21 +25,14 @@ namespace ServiceLib.Common
return chars.Contains(s[0]); return chars.Contains(s[0]);
} }
public static bool IsWhiteSpace(this string value) private static bool IsWhiteSpace(this string value)
{ {
foreach (char c in value) return value.All(char.IsWhiteSpace);
{
if (char.IsWhiteSpace(c)) continue;
return false;
}
return true;
} }
public static IEnumerable<string> NonWhiteSpaceLines(this TextReader reader) public static IEnumerable<string> NonWhiteSpaceLines(this TextReader reader)
{ {
string? line; while (reader.ReadLine() is { } line)
while ((line = reader.ReadLine()) != null)
{ {
if (line.IsWhiteSpace()) continue; if (line.IsWhiteSpace()) continue;
yield return line; yield return line;
@ -53,26 +46,12 @@ namespace ServiceLib.Common
public static string RemovePrefix(this string value, char prefix) public static string RemovePrefix(this string value, char prefix)
{ {
if (value.StartsWith(prefix)) return value.StartsWith(prefix) ? value[1..] : value;
{
return value.Substring(1);
}
else
{
return value;
}
} }
public static string RemovePrefix(this string value, string prefix) public static string RemovePrefix(this string value, string prefix)
{ {
if (value.StartsWith(prefix)) return value.StartsWith(prefix) ? value[prefix.Length..] : value;
{
return value.Substring(prefix.Length);
}
else
{
return value;
}
} }
public static string UpperFirstChar(this string value) public static string UpperFirstChar(this string value)
@ -82,17 +61,12 @@ namespace ServiceLib.Common
return string.Empty; return string.Empty;
} }
return char.ToUpper(value[0]) + value.Substring(1); return char.ToUpper(value[0]) + value[1..];
} }
public static string AppendQuotes(this string value) public static string AppendQuotes(this string value)
{ {
if (string.IsNullOrEmpty(value)) return string.IsNullOrEmpty(value) ? string.Empty : $"\"{value}\"";
{
return string.Empty;
}
return $"\"{value}\"";
} }
} }
} }

View file

@ -2,7 +2,6 @@
using CliWrap.Buffered; using CliWrap.Buffered;
using System.Collections.Specialized; using System.Collections.Specialized;
using System.Diagnostics; using System.Diagnostics;
using System.IO.Compression;
using System.Net; using System.Net;
using System.Net.NetworkInformation; using System.Net.NetworkInformation;
using System.Net.Sockets; using System.Net.Sockets;
@ -11,13 +10,12 @@ using System.Runtime.InteropServices;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Security.Principal; using System.Security.Principal;
using System.Text; using System.Text;
using System.Text.RegularExpressions;
namespace ServiceLib.Common namespace ServiceLib.Common
{ {
public class Utils public class Utils
{ {
#region Json操 #region
/// <summary> /// <summary>
/// 获取嵌入文本资源 /// 获取嵌入文本资源
@ -26,12 +24,12 @@ namespace ServiceLib.Common
/// <returns></returns> /// <returns></returns>
public static string GetEmbedText(string res) public static string GetEmbedText(string res)
{ {
string result = string.Empty; var result = string.Empty;
try try
{ {
Assembly assembly = Assembly.GetExecutingAssembly(); var assembly = Assembly.GetExecutingAssembly();
using Stream? stream = assembly.GetManifestResourceStream(res); using var stream = assembly.GetManifestResourceStream(res);
ArgumentNullException.ThrowIfNull(stream); ArgumentNullException.ThrowIfNull(stream);
using StreamReader reader = new(stream); using StreamReader reader = new(stream);
result = reader.ReadToEnd(); result = reader.ReadToEnd();
@ -51,11 +49,10 @@ namespace ServiceLib.Common
{ {
try try
{ {
if (!File.Exists(res)) if (File.Exists(res))
{ {
return null; return File.ReadAllText(res);
} }
return File.ReadAllText(res);
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -64,14 +61,15 @@ namespace ServiceLib.Common
return null; return null;
} }
#endregion Json操 #endregion
#region #region
/// <summary> /// <summary>
/// List<string>转逗号分隔的字符串 /// 转逗号分隔的字符串
/// </summary> /// </summary>
/// <param name="lst"></param> /// <param name="lst"></param>
/// <param name="wrap"></param>
/// <returns></returns> /// <returns></returns>
public static string List2String(List<string>? lst, bool wrap = false) public static string List2String(List<string>? lst, bool wrap = false)
{ {
@ -93,35 +91,40 @@ namespace ServiceLib.Common
catch (Exception ex) catch (Exception ex)
{ {
Logging.SaveLog(ex.Message, ex); Logging.SaveLog(ex.Message, ex);
return string.Empty;
} }
return string.Empty;
} }
/// <summary> /// <summary>
/// 逗号分隔的字符串,转List<string> /// 逗号分隔的字符串
/// </summary> /// </summary>
/// <param name="str"></param> /// <param name="str"></param>
/// <returns></returns> /// <returns></returns>
public static List<string> String2List(string str) public static List<string>? String2List(string? str)
{ {
try try
{ {
if (str == null)
{
return null;
}
str = str.Replace(Environment.NewLine, ""); str = str.Replace(Environment.NewLine, "");
return new List<string>(str.Split(',', StringSplitOptions.RemoveEmptyEntries)); return new List<string>(str.Split(',', StringSplitOptions.RemoveEmptyEntries));
} }
catch (Exception ex) catch (Exception ex)
{ {
Logging.SaveLog(ex.Message, ex); Logging.SaveLog(ex.Message, ex);
return [];
} }
return null;
} }
/// <summary> /// <summary>
/// 逗号分隔的字符串,先排序后转List<string> /// 逗号分隔的字符串,先排序后转List
/// </summary> /// </summary>
/// <param name="str"></param> /// <param name="str"></param>
/// <returns></returns> /// <returns></returns>
public static List<string> String2ListSorted(string str) public static List<string>? String2ListSorted(string str)
{ {
try try
{ {
@ -133,8 +136,8 @@ namespace ServiceLib.Common
catch (Exception ex) catch (Exception ex)
{ {
Logging.SaveLog(ex.Message, ex); Logging.SaveLog(ex.Message, ex);
return [];
} }
return null;
} }
/// <summary> /// <summary>
@ -146,14 +149,14 @@ namespace ServiceLib.Common
{ {
try try
{ {
byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText); var plainTextBytes = Encoding.UTF8.GetBytes(plainText);
return Convert.ToBase64String(plainTextBytes); return Convert.ToBase64String(plainTextBytes);
} }
catch (Exception ex) catch (Exception ex)
{ {
Logging.SaveLog("Base64Encode", ex); Logging.SaveLog("Base64Encode", ex);
return string.Empty;
} }
return string.Empty;
} }
/// <summary> /// <summary>
@ -179,30 +182,24 @@ namespace ServiceLib.Common
plainText = plainText.PadRight(plainText.Length + 4 - plainText.Length % 4, '='); plainText = plainText.PadRight(plainText.Length + 4 - plainText.Length % 4, '=');
} }
byte[] data = Convert.FromBase64String(plainText); var data = Convert.FromBase64String(plainText);
return Encoding.UTF8.GetString(data); return Encoding.UTF8.GetString(data);
} }
catch (Exception ex) catch (Exception ex)
{ {
Logging.SaveLog("Base64Decode", ex); Logging.SaveLog("Base64Decode", ex);
return string.Empty;
} }
return string.Empty;
} }
/// <summary>
/// 转Int
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public static int ToInt(object? obj) public static int ToInt(object? obj)
{ {
try try
{ {
return Convert.ToInt32(obj ?? string.Empty); return Convert.ToInt32(obj ?? string.Empty);
} }
catch //(Exception ex) catch
{ {
//SaveLog(ex.Message, ex);
return 0; return 0;
} }
} }
@ -213,50 +210,47 @@ namespace ServiceLib.Common
{ {
return Convert.ToBoolean(obj); return Convert.ToBoolean(obj);
} }
catch //(Exception ex) catch
{ {
//SaveLog(ex.Message, ex);
return false; return false;
} }
} }
public static string ToString(object obj) public static string ToString(object? obj)
{ {
try try
{ {
return obj?.ToString() ?? string.Empty; return obj?.ToString() ?? string.Empty;
} }
catch// (Exception ex) catch
{ {
//SaveLog(ex.Message, ex);
return string.Empty; return string.Empty;
} }
} }
/// <summary> /// <summary>
/// byte 转成 有两位小数点的 方便阅读的数据 /// byte 转成 有两位小数点的 方便阅读的数据 比如 2.50 MB
/// 比如 2.50 MB
/// </summary> /// </summary>
/// <param name="amount">bytes</param> /// <param name="amount">bytes</param>
/// <param name="result">转换之后的数据</param> /// <param name="result">转换之后的数据</param>
/// <param name="unit">单位</param> /// <param name="unit">单位</param>
public static void ToHumanReadable(long amount, out double result, out string unit) private static void ToHumanReadable(long amount, out double result, out string unit)
{ {
uint factor = 1024u; var factor = 1024u;
//long KBs = amount / factor; //long KBs = amount / factor;
long KBs = amount; var KBs = amount;
if (KBs > 0) if (KBs > 0)
{ {
// multi KB // multi KB
long MBs = KBs / factor; var MBs = KBs / factor;
if (MBs > 0) if (MBs > 0)
{ {
// multi MB // multi MB
long GBs = MBs / factor; var GBs = MBs / factor;
if (GBs > 0) if (GBs > 0)
{ {
// multi GB // multi GB
long TBs = GBs / factor; var TBs = GBs / factor;
if (TBs > 0) if (TBs > 0)
{ {
result = TBs + ((GBs % factor) / (factor + 0.0)); result = TBs + ((GBs % factor) / (factor + 0.0));
@ -284,20 +278,18 @@ namespace ServiceLib.Common
public static string HumanFy(long amount) public static string HumanFy(long amount)
{ {
ToHumanReadable(amount, out double result, out string unit); ToHumanReadable(amount, out var result, out var unit);
return $"{string.Format("{0:f1}", result)} {unit}"; return $"{result:f1} {unit}";
} }
public static string UrlEncode(string url) public static string UrlEncode(string url)
{ {
return Uri.EscapeDataString(url); return Uri.EscapeDataString(url);
//return HttpUtility.UrlEncode(url);
} }
public static string UrlDecode(string url) public static string UrlDecode(string url)
{ {
return Uri.UnescapeDataString(url); return Uri.UnescapeDataString(url);
//return HttpUtility.UrlDecode(url);
} }
public static NameValueCollection ParseQueryString(string query) public static NameValueCollection ParseQueryString(string query)
@ -308,10 +300,10 @@ namespace ServiceLib.Common
return result; return result;
} }
var parts = query[1..].Split(new[] { '&' }, StringSplitOptions.RemoveEmptyEntries); var parts = query[1..].Split('&', StringSplitOptions.RemoveEmptyEntries);
foreach (var part in parts) foreach (var part in parts)
{ {
var keyValue = part.Split(['=']); var keyValue = part.Split('=');
if (keyValue.Length != 2) if (keyValue.Length != 2)
{ {
continue; continue;
@ -328,12 +320,12 @@ namespace ServiceLib.Common
return result; return result;
} }
public static string GetMD5(string str) public static string GetMd5(string str)
{ {
byte[] byteOld = Encoding.UTF8.GetBytes(str); var byteOld = Encoding.UTF8.GetBytes(str);
byte[] byteNew = MD5.HashData(byteOld); var byteNew = MD5.HashData(byteOld);
StringBuilder sb = new(32); StringBuilder sb = new(32);
foreach (byte b in byteNew) foreach (var b in byteNew)
{ {
sb.Append(b.ToString("x2")); sb.Append(b.ToString("x2"));
} }
@ -373,12 +365,12 @@ namespace ServiceLib.Common
{ {
if (plainText.IsNullOrEmpty()) return false; if (plainText.IsNullOrEmpty()) return false;
var buffer = new Span<byte>(new byte[plainText.Length]); var buffer = new Span<byte>(new byte[plainText.Length]);
return Convert.TryFromBase64String(plainText, buffer, out int _); return Convert.TryFromBase64String(plainText, buffer, out var _);
} }
public static string Convert2Comma(string text) public static string Convert2Comma(string text)
{ {
if (Utils.IsNullOrEmpty(text)) if (IsNullOrEmpty(text))
{ {
return text; return text;
} }
@ -396,16 +388,7 @@ namespace ServiceLib.Common
/// <returns></returns> /// <returns></returns>
public static bool IsNumeric(string oText) public static bool IsNumeric(string oText)
{ {
try return oText.All(char.IsNumber);
{
int var1 = ToInt(oText);
return true;
}
catch (Exception ex)
{
Logging.SaveLog(ex.Message, ex);
return false;
}
} }
public static bool IsNullOrEmpty(string? text) public static bool IsNullOrEmpty(string? text)
@ -414,11 +397,7 @@ namespace ServiceLib.Common
{ {
return true; return true;
} }
if (text == "null") return text == "null";
{
return true;
}
return false;
} }
public static bool IsNotEmpty(string? text) public static bool IsNotEmpty(string? text)
@ -426,41 +405,6 @@ namespace ServiceLib.Common
return !string.IsNullOrEmpty(text); return !string.IsNullOrEmpty(text);
} }
/// <summary>
/// 验证IP地址是否合法
/// </summary>
/// <param name="ip"></param>
public static bool IsIP(string ip)
{
//如果为空
if (IsNullOrEmpty(ip))
{
return false;
}
//清除要验证字符串中的空格
//ip = ip.TrimEx();
//可能是CIDR
if (ip.IndexOf(@"/") > 0)
{
string[] cidr = ip.Split('/');
if (cidr.Length == 2)
{
if (!IsNumeric(cidr[0]))
{
return false;
}
ip = cidr[0];
}
}
//模式字符串
string pattern = @"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$";
//验证
return IsMatch(ip, pattern);
}
/// <summary> /// <summary>
/// 验证Domain地址是否合法 /// 验证Domain地址是否合法
/// </summary> /// </summary>
@ -476,19 +420,9 @@ namespace ServiceLib.Common
return Uri.CheckHostName(domain) == UriHostNameType.Dns; return Uri.CheckHostName(domain) == UriHostNameType.Dns;
} }
/// <summary>
/// 验证输入字符串是否与模式字符串匹配匹配返回true
/// </summary>
/// <param name="input">输入字符串</param>
/// <param name="pattern">模式字符串</param>
public static bool IsMatch(string input, string pattern)
{
return Regex.IsMatch(input, pattern, RegexOptions.IgnoreCase);
}
public static bool IsIpv6(string ip) public static bool IsIpv6(string ip)
{ {
if (IPAddress.TryParse(ip, out IPAddress? address)) if (IPAddress.TryParse(ip, out var address))
{ {
return address.AddressFamily switch return address.AddressFamily switch
{ {
@ -504,43 +438,20 @@ namespace ServiceLib.Common
#region #region
public static void SetSecurityProtocol(bool enableSecurityProtocolTls13) private static bool PortInUse(int port)
{ {
if (enableSecurityProtocolTls13)
{
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13;
}
else
{
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
}
ServicePointManager.DefaultConnectionLimit = 256;
}
public static bool PortInUse(int port)
{
bool inUse = false;
try try
{ {
IPGlobalProperties ipProperties = IPGlobalProperties.GetIPGlobalProperties(); var ipProperties = IPGlobalProperties.GetIPGlobalProperties();
IPEndPoint[] ipEndPoints = ipProperties.GetActiveTcpListeners(); var ipEndPoints = ipProperties.GetActiveTcpListeners();
//var lstIpEndPoints = new List<IPEndPoint>(IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpListeners());
var lstIpEndPoints = new List<IPEndPoint>(IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpListeners()); return ipEndPoints.Any(endPoint => endPoint.Port == port);
foreach (IPEndPoint endPoint in ipEndPoints)
{
if (endPoint.Port == port)
{
inUse = true;
break;
}
}
} }
catch (Exception ex) catch (Exception ex)
{ {
Logging.SaveLog(ex.Message, ex); Logging.SaveLog(ex.Message, ex);
} }
return inUse; return false;
} }
public static int GetFreePort(int defaultPort = 9090) public static int GetFreePort(int defaultPort = 9090)
@ -554,7 +465,7 @@ namespace ServiceLib.Common
TcpListener l = new(IPAddress.Loopback, 0); TcpListener l = new(IPAddress.Loopback, 0);
l.Start(); l.Start();
int port = ((IPEndPoint)l.LocalEndpoint).Port; var port = ((IPEndPoint)l.LocalEndpoint).Port;
l.Stop(); l.Stop();
return port; return port;
} }
@ -578,23 +489,18 @@ namespace ServiceLib.Common
{ {
if (blFull) if (blFull)
{ {
return string.Format("{0} - V{1} - {2}", return $"{Global.AppName} - V{GetVersionInfo()} - {File.GetLastWriteTime(GetExePath()):yyyy/MM/dd}";
Global.AppName,
GetVersionInfo(),
File.GetLastWriteTime(GetExePath()).ToString("yyyy/MM/dd"));
} }
else else
{ {
return string.Format("{0}/{1}", return $"{Global.AppName}/{GetVersionInfo()}";
Global.AppName,
GetVersionInfo());
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
Logging.SaveLog(ex.Message, ex); Logging.SaveLog(ex.Message, ex);
return Global.AppName;
} }
return Global.AppName;
} }
public static string GetVersionInfo() public static string GetVersionInfo()
@ -614,7 +520,7 @@ namespace ServiceLib.Common
/// 取得GUID /// 取得GUID
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public static string GetGUID(bool full = true) public static string GetGuid(bool full = true)
{ {
try try
{ {
@ -634,14 +540,6 @@ namespace ServiceLib.Common
return string.Empty; return string.Empty;
} }
public static string GetDownloadFileName(string url)
{
var fileName = Path.GetFileName(url);
fileName += "_temp";
return fileName;
}
public static bool IsGuidByParse(string strSrc) public static bool IsGuidByParse(string strSrc)
{ {
return Guid.TryParse(strSrc, out _); return Guid.TryParse(strSrc, out _);
@ -667,12 +565,12 @@ namespace ServiceLib.Common
public static Dictionary<string, string> GetSystemHosts() public static Dictionary<string, string> GetSystemHosts()
{ {
var systemHosts = new Dictionary<string, string>(); var systemHosts = new Dictionary<string, string>();
var hostfile = @"C:\Windows\System32\drivers\etc\hosts"; var hostFile = @"C:\Windows\System32\drivers\etc\hosts";
try try
{ {
if (File.Exists(hostfile)) if (File.Exists(hostFile))
{ {
var hosts = File.ReadAllText(hostfile).Replace("\r", ""); var hosts = File.ReadAllText(hostFile).Replace("\r", "");
var hostsList = hosts.Split(new[] { '\n' }, StringSplitOptions.RemoveEmptyEntries); var hostsList = hosts.Split(new[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
foreach (var host in hostsList) foreach (var host in hostsList)
@ -693,10 +591,10 @@ namespace ServiceLib.Common
public static async Task<string?> GetCliWrapOutput(string filePath, string? arg) public static async Task<string?> GetCliWrapOutput(string filePath, string? arg)
{ {
return await GetCliWrapOutput(filePath, arg != null ? [arg] : null); return await GetCliWrapOutput(filePath, arg != null ? new List<string>() { arg } : null);
} }
public static async Task<string?> GetCliWrapOutput(string filePath, IEnumerable<string>? args) private static async Task<string?> GetCliWrapOutput(string filePath, IEnumerable<string>? args)
{ {
try try
{ {
@ -736,7 +634,7 @@ namespace ServiceLib.Common
/// <returns></returns> /// <returns></returns>
public static string GetPath(string fileName) public static string GetPath(string fileName)
{ {
string startupPath = StartupPath(); var startupPath = StartupPath();
if (IsNullOrEmpty(fileName)) if (IsNullOrEmpty(fileName))
{ {
return startupPath; return startupPath;
@ -760,113 +658,104 @@ namespace ServiceLib.Common
public static string GetTempPath(string filename = "") public static string GetTempPath(string filename = "")
{ {
string _tempPath = Path.Combine(StartupPath(), "guiTemps"); var tempPath = Path.Combine(StartupPath(), "guiTemps");
if (!Directory.Exists(_tempPath)) if (!Directory.Exists(tempPath))
{ {
Directory.CreateDirectory(_tempPath); Directory.CreateDirectory(tempPath);
} }
if (Utils.IsNullOrEmpty(filename)) if (IsNullOrEmpty(filename))
{ {
return _tempPath; return tempPath;
} }
else else
{ {
return Path.Combine(_tempPath, filename); return Path.Combine(tempPath, filename);
} }
} }
public static string UnGzip(byte[] buf)
{
using MemoryStream sb = new();
using GZipStream input = new(new MemoryStream(buf), CompressionMode.Decompress, false);
input.CopyTo(sb);
sb.Position = 0;
return new StreamReader(sb, Encoding.UTF8).ReadToEnd();
}
public static string GetBackupPath(string filename) public static string GetBackupPath(string filename)
{ {
string _tempPath = Path.Combine(StartupPath(), "guiBackups"); var tempPath = Path.Combine(StartupPath(), "guiBackups");
if (!Directory.Exists(_tempPath)) if (!Directory.Exists(tempPath))
{ {
Directory.CreateDirectory(_tempPath); Directory.CreateDirectory(tempPath);
} }
return Path.Combine(_tempPath, filename); return Path.Combine(tempPath, filename);
} }
public static string GetConfigPath(string filename = "") public static string GetConfigPath(string filename = "")
{ {
string _tempPath = Path.Combine(StartupPath(), "guiConfigs"); var tempPath = Path.Combine(StartupPath(), "guiConfigs");
if (!Directory.Exists(_tempPath)) if (!Directory.Exists(tempPath))
{ {
Directory.CreateDirectory(_tempPath); Directory.CreateDirectory(tempPath);
} }
if (Utils.IsNullOrEmpty(filename)) if (Utils.IsNullOrEmpty(filename))
{ {
return _tempPath; return tempPath;
} }
else else
{ {
return Path.Combine(_tempPath, filename); return Path.Combine(tempPath, filename);
} }
} }
public static string GetBinPath(string filename, string? coreType = null) public static string GetBinPath(string filename, string? coreType = null)
{ {
string _tempPath = Path.Combine(StartupPath(), "bin"); var tempPath = Path.Combine(StartupPath(), "bin");
if (!Directory.Exists(_tempPath)) if (!Directory.Exists(tempPath))
{ {
Directory.CreateDirectory(_tempPath); Directory.CreateDirectory(tempPath);
} }
if (coreType != null) if (coreType != null)
{ {
_tempPath = Path.Combine(_tempPath, coreType.ToString()); tempPath = Path.Combine(tempPath, coreType.ToString());
if (!Directory.Exists(_tempPath)) if (!Directory.Exists(tempPath))
{ {
Directory.CreateDirectory(_tempPath); Directory.CreateDirectory(tempPath);
} }
} }
if (Utils.IsNullOrEmpty(filename)) if (IsNullOrEmpty(filename))
{ {
return _tempPath; return tempPath;
} }
else else
{ {
return Path.Combine(_tempPath, filename); return Path.Combine(tempPath, filename);
} }
} }
public static string GetLogPath(string filename = "") public static string GetLogPath(string filename = "")
{ {
string _tempPath = Path.Combine(StartupPath(), "guiLogs"); var tempPath = Path.Combine(StartupPath(), "guiLogs");
if (!Directory.Exists(_tempPath)) if (!Directory.Exists(tempPath))
{ {
Directory.CreateDirectory(_tempPath); Directory.CreateDirectory(tempPath);
} }
if (Utils.IsNullOrEmpty(filename)) if (Utils.IsNullOrEmpty(filename))
{ {
return _tempPath; return tempPath;
} }
else else
{ {
return Path.Combine(_tempPath, filename); return Path.Combine(tempPath, filename);
} }
} }
public static string GetFontsPath(string filename = "") public static string GetFontsPath(string filename = "")
{ {
string _tempPath = Path.Combine(StartupPath(), "guiFonts"); var tempPath = Path.Combine(StartupPath(), "guiFonts");
if (!Directory.Exists(_tempPath)) if (!Directory.Exists(tempPath))
{ {
Directory.CreateDirectory(_tempPath); Directory.CreateDirectory(tempPath);
} }
if (Utils.IsNullOrEmpty(filename)) if (Utils.IsNullOrEmpty(filename))
{ {
return _tempPath; return tempPath;
} }
else else
{ {
return Path.Combine(_tempPath, filename); return Path.Combine(tempPath, filename);
} }
} }
@ -882,14 +771,7 @@ namespace ServiceLib.Common
public static string GetExeName(string name) public static string GetExeName(string name)
{ {
if (IsWindows()) return IsWindows() ? $"{name}.exe" : name;
{
return $"{name}.exe";
}
else
{
return name;
}
} }
public static bool IsAdministrator() public static bool IsAdministrator()
@ -901,7 +783,7 @@ namespace ServiceLib.Common
else else
{ {
var id = GetLinuxUserId().Result ?? "1000"; var id = GetLinuxUserId().Result ?? "1000";
if (int.TryParse(id, out int userId)) if (int.TryParse(id, out var userId))
{ {
return userId == 0; return userId == 0;
} }
@ -914,7 +796,8 @@ namespace ServiceLib.Common
private static async Task<string?> GetLinuxUserId() private static async Task<string?> GetLinuxUserId()
{ {
return await GetCliWrapOutput("/bin/bash", ["-c", "id -u"]); var arg = new List<string>() { "-c", "id -u" };
return await GetCliWrapOutput("/bin/bash", arg);
} }
#endregion Platform #endregion Platform

View file

@ -21,7 +21,7 @@ namespace ServiceLib.Common
.Build(); .Build();
try try
{ {
T obj = deserializer.Deserialize<T>(str); var obj = deserializer.Deserialize<T>(str);
return obj; return obj;
} }
catch (Exception ex) catch (Exception ex)
@ -36,9 +36,9 @@ namespace ServiceLib.Common
/// </summary> /// </summary>
/// <param name="obj"></param> /// <param name="obj"></param>
/// <returns></returns> /// <returns></returns>
public static string ToYaml(Object? obj) public static string ToYaml(object? obj)
{ {
string result = string.Empty; var result = string.Empty;
if (obj == null) if (obj == null)
{ {
return result; return result;

View file

@ -2,11 +2,14 @@
{ {
public sealed class AppHandler public sealed class AppHandler
{ {
#region Property
private static readonly Lazy<AppHandler> _instance = new(() => new()); private static readonly Lazy<AppHandler> _instance = new(() => new());
private Config _config; private Config _config;
private int? _statePort; private int? _statePort;
private int? _statePort2; private int? _statePort2;
private Job? _processJob; private Job? _processJob;
private bool? _isAdministrator;
public static AppHandler Instance => _instance.Value; public static AppHandler Instance => _instance.Value;
public Config Config => _config; public Config Config => _config;
@ -28,6 +31,17 @@
} }
} }
public bool IsAdministrator
{
get
{
_isAdministrator ??= Utils.IsAdministrator();
return _isAdministrator.Value;
}
}
#endregion Property
#region Init #region Init
public AppHandler() public AppHandler()

View file

@ -1,6 +1,5 @@
using System.Data; using System.Data;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Web;
namespace ServiceLib.Handler namespace ServiceLib.Handler
{ {
@ -494,7 +493,7 @@ namespace ServiceLib.Handler
return -1; return -1;
} }
var ext = Path.GetExtension(fileName); var ext = Path.GetExtension(fileName);
string newFileName = $"{Utils.GetGUID()}{ext}"; string newFileName = $"{Utils.GetGuid()}{ext}";
//newFileName = Path.Combine(Utile.GetTempPath(), newFileName); //newFileName = Path.Combine(Utile.GetTempPath(), newFileName);
try try
@ -934,7 +933,7 @@ namespace ServiceLib.Handler
var maxSort = -1; var maxSort = -1;
if (Utils.IsNullOrEmpty(profileItem.indexId)) if (Utils.IsNullOrEmpty(profileItem.indexId))
{ {
profileItem.indexId = Utils.GetGUID(false); profileItem.indexId = Utils.GetGuid(false);
maxSort = ProfileExHandler.Instance.GetMaxSort(); maxSort = ProfileExHandler.Instance.GetMaxSort();
} }
if (!toFile && maxSort < 0) if (!toFile && maxSort < 0)
@ -1002,7 +1001,7 @@ namespace ServiceLib.Handler
public static int AddCustomServer4Multiple(Config config, List<ProfileItem> selecteds, ECoreType coreType, out string indexId) public static int AddCustomServer4Multiple(Config config, List<ProfileItem> selecteds, ECoreType coreType, out string indexId)
{ {
indexId = Utils.GetMD5(Global.CoreMultipleLoadConfigFileName); indexId = Utils.GetMd5(Global.CoreMultipleLoadConfigFileName);
string configPath = Utils.GetConfigPath(Global.CoreMultipleLoadConfigFileName); string configPath = Utils.GetConfigPath(Global.CoreMultipleLoadConfigFileName);
if (CoreConfigHandler.GenerateClientMultipleLoadConfig(config, configPath, selecteds, coreType, out string msg) != 0) if (CoreConfigHandler.GenerateClientMultipleLoadConfig(config, configPath, selecteds, coreType, out string msg) != 0)
{ {
@ -1341,7 +1340,7 @@ namespace ServiceLib.Handler
try try
{ {
var uri = new Uri(url); var uri = new Uri(url);
var queryVars = HttpUtility.ParseQueryString(uri.Query); var queryVars = Utils.ParseQueryString(uri.Query);
subItem.remarks = queryVars["remarks"] ?? "import_sub"; subItem.remarks = queryVars["remarks"] ?? "import_sub";
} }
catch (UriFormatException) catch (UriFormatException)
@ -1378,7 +1377,7 @@ namespace ServiceLib.Handler
if (Utils.IsNullOrEmpty(item.id)) if (Utils.IsNullOrEmpty(item.id))
{ {
item.id = Utils.GetGUID(false); item.id = Utils.GetGuid(false);
if (item.sort <= 0) if (item.sort <= 0)
{ {
@ -1461,7 +1460,7 @@ namespace ServiceLib.Handler
{ {
if (Utils.IsNullOrEmpty(item.id)) if (Utils.IsNullOrEmpty(item.id))
{ {
item.id = Utils.GetGUID(false); item.id = Utils.GetGuid(false);
} }
if (SQLiteHelper.Instance.Replace(item) > 0) if (SQLiteHelper.Instance.Replace(item) > 0)
@ -1495,14 +1494,14 @@ namespace ServiceLib.Handler
foreach (var item in lstRules) foreach (var item in lstRules)
{ {
item.id = Utils.GetGUID(false); item.id = Utils.GetGuid(false);
} }
routingItem.ruleNum = lstRules.Count; routingItem.ruleNum = lstRules.Count;
routingItem.ruleSet = JsonUtils.Serialize(lstRules, false); routingItem.ruleSet = JsonUtils.Serialize(lstRules, false);
if (Utils.IsNullOrEmpty(routingItem.id)) if (Utils.IsNullOrEmpty(routingItem.id))
{ {
routingItem.id = Utils.GetGUID(false); routingItem.id = Utils.GetGuid(false);
} }
if (SQLiteHelper.Instance.Replace(routingItem) > 0) if (SQLiteHelper.Instance.Replace(routingItem) > 0)
@ -1711,7 +1710,7 @@ namespace ServiceLib.Handler
{ {
if (Utils.IsNullOrEmpty(item.id)) if (Utils.IsNullOrEmpty(item.id))
{ {
item.id = Utils.GetGUID(false); item.id = Utils.GetGuid(false);
} }
if (SQLiteHelper.Instance.Replace(item) > 0) if (SQLiteHelper.Instance.Replace(item) > 0)

View file

@ -197,7 +197,7 @@ namespace ServiceLib.Handler.Fmt
protected static string WriteAllText(string strData, string ext = "json") protected static string WriteAllText(string strData, string ext = "json")
{ {
var fileName = Utils.GetTempPath($"{Utils.GetGUID(false)}.{ext}"); var fileName = Utils.GetTempPath($"{Utils.GetGuid(false)}.{ext}");
File.WriteAllText(fileName, strData); File.WriteAllText(fileName, strData);
return fileName; return fileName;
} }

View file

@ -70,12 +70,12 @@
item.network = Global.DefaultNetwork; item.network = Global.DefaultNetwork;
item.headerType = Global.None; item.headerType = Global.None;
item.configVersion = Utils.ToInt(vmessQRCode.v); item.configVersion = vmessQRCode.v;
item.remarks = Utils.ToString(vmessQRCode.ps); item.remarks = Utils.ToString(vmessQRCode.ps);
item.address = Utils.ToString(vmessQRCode.add); item.address = Utils.ToString(vmessQRCode.add);
item.port = Utils.ToInt(vmessQRCode.port); item.port = vmessQRCode.port;
item.id = Utils.ToString(vmessQRCode.id); item.id = Utils.ToString(vmessQRCode.id);
item.alterId = Utils.ToInt(vmessQRCode.aid); item.alterId = vmessQRCode.aid;
item.security = Utils.ToString(vmessQRCode.scy); item.security = Utils.ToString(vmessQRCode.scy);
item.security = Utils.IsNotEmpty(vmessQRCode.scy) ? vmessQRCode.scy : Global.DefaultSecurity; item.security = Utils.IsNotEmpty(vmessQRCode.scy) ? vmessQRCode.scy : Global.DefaultSecurity;

View file

@ -58,7 +58,7 @@ namespace ServiceLib.Models
return summary; return summary;
} }
public List<string> GetAlpn() public List<string>? GetAlpn()
{ {
if (Utils.IsNullOrEmpty(alpn)) if (Utils.IsNullOrEmpty(alpn))
{ {

View file

@ -120,10 +120,10 @@
public string? version { get; set; } public string? version { get; set; }
public string? network { get; set; } public string? network { get; set; }
public string? packet_encoding { get; set; } public string? packet_encoding { get; set; }
public string[]? local_address { get; set; } public List<string>? local_address { get; set; }
public string? private_key { get; set; } public string? private_key { get; set; }
public string? peer_public_key { get; set; } public string? peer_public_key { get; set; }
public int[]? reserved { get; set; } public List<int>? reserved { get; set; }
public int? mtu { get; set; } public int? mtu { get; set; }
public string? plugin { get; set; } public string? plugin { get; set; }
public string? plugin_opts { get; set; } public string? plugin_opts { get; set; }
@ -138,11 +138,11 @@
public class Tls4Sbox public class Tls4Sbox
{ {
public bool enabled { get; set; } public bool enabled { get; set; }
public string server_name { get; set; } public string? server_name { get; set; }
public bool? insecure { get; set; } public bool? insecure { get; set; }
public List<string> alpn { get; set; } public List<string>? alpn { get; set; }
public Utls4Sbox utls { get; set; } public Utls4Sbox? utls { get; set; }
public Reality4Sbox reality { get; set; } public Reality4Sbox? reality { get; set; }
} }
public class Multiplex4Sbox public class Multiplex4Sbox

View file

@ -647,12 +647,12 @@ namespace ServiceLib.Models
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string path { get; set; } public string? path { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public List<string> host { get; set; } public List<string>? host { get; set; }
} }
public class QuicSettings4Ray public class QuicSettings4Ray

View file

@ -678,8 +678,8 @@ namespace ServiceLib.Services.CoreConfig
{ {
outbound.private_key = node.id; outbound.private_key = node.id;
outbound.peer_public_key = node.publicKey; outbound.peer_public_key = node.publicKey;
outbound.reserved = Utils.String2List(node.path).Select(int.Parse).ToArray(); outbound.reserved = Utils.String2List(node.path)?.Select(int.Parse).ToList();
outbound.local_address = [.. Utils.String2List(node.requestHost)]; outbound.local_address = Utils.String2List(node.requestHost);
outbound.mtu = Utils.ToInt(node.shortId.IsNullOrEmpty() ? Global.TunMtus.FirstOrDefault() : node.shortId); outbound.mtu = Utils.ToInt(node.shortId.IsNullOrEmpty() ? Global.TunMtus.FirstOrDefault() : node.shortId);
break; break;
} }
@ -732,7 +732,7 @@ namespace ServiceLib.Services.CoreConfig
} }
else if (Utils.IsNotEmpty(node.requestHost)) else if (Utils.IsNotEmpty(node.requestHost))
{ {
server_name = Utils.String2List(node.requestHost)[0]; server_name = Utils.String2List(node.requestHost)?.First();
} }
var tls = new Tls4Sbox() var tls = new Tls4Sbox()
{ {

View file

@ -829,7 +829,7 @@ namespace ServiceLib.Services.CoreConfig
} }
else if (Utils.IsNotEmpty(host)) else if (Utils.IsNotEmpty(host))
{ {
tlsSettings.serverName = Utils.String2List(host)[0]; tlsSettings.serverName = Utils.String2List(host)?.First();
} }
streamSettings.tlsSettings = tlsSettings; streamSettings.tlsSettings = tlsSettings;
} }

View file

@ -30,7 +30,7 @@ namespace ServiceLib.Services
{ {
try try
{ {
Utils.SetSecurityProtocol(AppHandler.Instance.Config.guiItem.enableSecurityProtocolTls13); SetSecurityProtocol(AppHandler.Instance.Config.guiItem.enableSecurityProtocolTls13);
var progress = new Progress<string>(); var progress = new Progress<string>();
progress.ProgressChanged += (sender, value) => progress.ProgressChanged += (sender, value) =>
@ -62,7 +62,7 @@ namespace ServiceLib.Services
{ {
try try
{ {
Utils.SetSecurityProtocol(AppHandler.Instance.Config.guiItem.enableSecurityProtocolTls13); SetSecurityProtocol(AppHandler.Instance.Config.guiItem.enableSecurityProtocolTls13);
UpdateCompleted?.Invoke(this, new ResultEventArgs(false, $"{ResUI.Downloading} {url}")); UpdateCompleted?.Invoke(this, new ResultEventArgs(false, $"{ResUI.Downloading} {url}"));
var progress = new Progress<double>(); var progress = new Progress<double>();
@ -92,7 +92,7 @@ namespace ServiceLib.Services
public async Task<string?> UrlRedirectAsync(string url, bool blProxy) public async Task<string?> UrlRedirectAsync(string url, bool blProxy)
{ {
Utils.SetSecurityProtocol(AppHandler.Instance.Config.guiItem.enableSecurityProtocolTls13); SetSecurityProtocol(AppHandler.Instance.Config.guiItem.enableSecurityProtocolTls13);
var webRequestHandler = new SocketsHttpHandler var webRequestHandler = new SocketsHttpHandler
{ {
AllowAutoRedirect = false, AllowAutoRedirect = false,
@ -181,7 +181,7 @@ namespace ServiceLib.Services
{ {
try try
{ {
Utils.SetSecurityProtocol(AppHandler.Instance.Config.guiItem.enableSecurityProtocolTls13); SetSecurityProtocol(AppHandler.Instance.Config.guiItem.enableSecurityProtocolTls13);
var webProxy = GetWebProxy(blProxy); var webProxy = GetWebProxy(blProxy);
var client = new HttpClient(new SocketsHttpHandler() var client = new HttpClient(new SocketsHttpHandler()
{ {
@ -226,7 +226,7 @@ namespace ServiceLib.Services
{ {
try try
{ {
Utils.SetSecurityProtocol(AppHandler.Instance.Config.guiItem.enableSecurityProtocolTls13); SetSecurityProtocol(AppHandler.Instance.Config.guiItem.enableSecurityProtocolTls13);
var webProxy = GetWebProxy(blProxy); var webProxy = GetWebProxy(blProxy);
@ -337,5 +337,18 @@ namespace ServiceLib.Services
return false; return false;
} }
} }
private static void SetSecurityProtocol(bool enableSecurityProtocolTls13)
{
if (enableSecurityProtocolTls13)
{
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13;
}
else
{
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
}
ServicePointManager.DefaultConnectionLimit = 256;
}
} }
} }

View file

@ -56,7 +56,7 @@ namespace ServiceLib.Services
_updateFunc?.Invoke(false, args.Msg); _updateFunc?.Invoke(false, args.Msg);
url = args.Url; url = args.Url;
fileName = Utils.GetTempPath(Utils.GetGUID()); fileName = Utils.GetTempPath(Utils.GetGuid());
await downloadHandle.DownloadFileAsync(url, fileName, true, _timeout); await downloadHandle.DownloadFileAsync(url, fileName, true, _timeout);
} }
else else
@ -108,7 +108,7 @@ namespace ServiceLib.Services
url = args.Url; url = args.Url;
var ext = Path.GetExtension(url); var ext = Path.GetExtension(url);
fileName = Utils.GetTempPath(Utils.GetGUID() + ext); fileName = Utils.GetTempPath(Utils.GetGuid() + ext);
await downloadHandle.DownloadFileAsync(url, fileName, true, _timeout); await downloadHandle.DownloadFileAsync(url, fileName, true, _timeout);
} }
else else
@ -450,9 +450,10 @@ namespace ServiceLib.Services
{ {
_config = config; _config = config;
_updateFunc = updateFunc; _updateFunc = updateFunc;
var geoUrl = !String.IsNullOrEmpty(config?.guiItem.geoSourceUrl) ? config.guiItem.geoSourceUrl : Global.GeoUrl; var geoUrl = !String.IsNullOrEmpty(config?.guiItem.geoSourceUrl) ? config.guiItem.geoSourceUrl : Global.GeoUrl;
var url = string.Format(geoUrl, geoName); var url = string.Format(Global.GeoUrl, geoName);
var fileName = Utils.GetTempPath(Utils.GetGUID()); var fileName = Utils.GetTempPath(Utils.GetGuid());
DownloadService downloadHandle = new(); DownloadService downloadHandle = new();
downloadHandle.UpdateCompleted += (sender2, args) => downloadHandle.UpdateCompleted += (sender2, args) =>

View file

@ -85,7 +85,7 @@ namespace ServiceLib.ViewModels
private async Task RemoteRestore() private async Task RemoteRestore()
{ {
DisplayOperationMsg(); DisplayOperationMsg();
var fileName = Utils.GetTempPath(Utils.GetGUID()); var fileName = Utils.GetTempPath(Utils.GetGuid());
var result = await WebDavHandler.Instance.GetRawFile(fileName); var result = await WebDavHandler.Instance.GetRawFile(fileName);
if (result) if (result)
{ {

View file

@ -414,7 +414,7 @@ namespace ServiceLib.ViewModels
var ret = await _updateView?.Invoke(EViewAction.OptionSettingWindow, null); var ret = await _updateView?.Invoke(EViewAction.OptionSettingWindow, null);
if (ret == true) if (ret == true)
{ {
Locator.Current.GetService<StatusBarViewModel>()?.InboundDisplayStaus(); Locator.Current.GetService<StatusBarViewModel>()?.InboundDisplayStatus();
Reload(); Reload();
} }
} }

View file

@ -34,7 +34,7 @@ namespace ServiceLib.ViewModels
if (rulesItem.id.IsNullOrEmpty()) if (rulesItem.id.IsNullOrEmpty())
{ {
rulesItem.id = Utils.GetGUID(false); rulesItem.id = Utils.GetGuid(false);
rulesItem.outboundTag = Global.ProxyTag; rulesItem.outboundTag = Global.ProxyTag;
rulesItem.enabled = true; rulesItem.enabled = true;
SelectedSource = rulesItem; SelectedSource = rulesItem;

View file

@ -232,7 +232,7 @@ namespace ServiceLib.ViewModels
var item = SelectedRouting; var item = SelectedRouting;
foreach (var it in _rules) foreach (var it in _rules)
{ {
it.id = Utils.GetGUID(false); it.id = Utils.GetGuid(false);
} }
item.ruleNum = _rules.Count; item.ruleNum = _rules.Count;
item.ruleSet = JsonUtils.Serialize(_rules, false); item.ruleSet = JsonUtils.Serialize(_rules, false);
@ -322,7 +322,7 @@ namespace ServiceLib.ViewModels
} }
foreach (var rule in lstRules) foreach (var rule in lstRules)
{ {
rule.id = Utils.GetGUID(false); rule.id = Utils.GetGuid(false);
} }
if (blReplace) if (blReplace)

View file

@ -10,8 +10,6 @@ namespace ServiceLib.ViewModels
{ {
public class StatusBarViewModel : MyReactiveObject public class StatusBarViewModel : MyReactiveObject
{ {
private bool _isAdministrator { get; set; }
#region ObservableCollection #region ObservableCollection
private IObservableCollection<RoutingItem> _routingItems = new ObservableCollectionExtended<RoutingItem>(); private IObservableCollection<RoutingItem> _routingItems = new ObservableCollectionExtended<RoutingItem>();
@ -108,19 +106,16 @@ namespace ServiceLib.ViewModels
public StatusBarViewModel(Func<EViewAction, object?, Task<bool>>? updateView) public StatusBarViewModel(Func<EViewAction, object?, Task<bool>>? updateView)
{ {
_config = AppHandler.Instance.Config; _config = AppHandler.Instance.Config;
_updateView = updateView;
if (_updateView != null) if (updateView != null)
{ {
MessageBus.Current.Listen<string>(EMsgCommand.RefreshProfiles.ToString()) Init(updateView);
.Subscribe(async x => await _updateView?.Invoke(EViewAction.DispatcherRefreshServersBiz, null));
} }
SelectedRouting = new(); SelectedRouting = new();
SelectedServer = new(); SelectedServer = new();
_isAdministrator = Utils.IsAdministrator(); if (_config.tunModeItem.enableTun && AppHandler.Instance.IsAdministrator)
if (_config.tunModeItem.enableTun && _isAdministrator)
{ {
EnableTun = true; EnableTun = true;
} }
@ -130,7 +125,7 @@ namespace ServiceLib.ViewModels
} }
RefreshRoutingsMenu(); RefreshRoutingsMenu();
InboundDisplayStaus(); InboundDisplayStatus();
ChangeSystemProxyAsync(_config.systemProxyItem.sysProxyType, true); ChangeSystemProxyAsync(_config.systemProxyItem.sysProxyType, true);
#region WhenAnyValue && ReactiveCommand #region WhenAnyValue && ReactiveCommand
@ -414,7 +409,7 @@ namespace ServiceLib.ViewModels
{ {
_config.tunModeItem.enableTun = EnableTun; _config.tunModeItem.enableTun = EnableTun;
// When running as a non-administrator, reboot to administrator mode // When running as a non-administrator, reboot to administrator mode
if (EnableTun && !_isAdministrator) if (EnableTun && !AppHandler.Instance.IsAdministrator)
{ {
_config.tunModeItem.enableTun = false; _config.tunModeItem.enableTun = false;
Locator.Current.GetService<MainWindowViewModel>()?.RebootAsAdmin(); Locator.Current.GetService<MainWindowViewModel>()?.RebootAsAdmin();
@ -429,19 +424,12 @@ namespace ServiceLib.ViewModels
#region UI #region UI
public void InboundDisplayStaus() public void InboundDisplayStatus()
{ {
StringBuilder sb = new(); StringBuilder sb = new();
sb.Append($"[{EInboundProtocol.socks}:{AppHandler.Instance.GetLocalPort(EInboundProtocol.socks)}]"); sb.Append($"[{EInboundProtocol.socks}:{AppHandler.Instance.GetLocalPort(EInboundProtocol.socks)}]");
sb.Append(" | "); sb.Append(" | ");
//if (_config.systemProxyItem.sysProxyType == ESysProxyType.ForcedChange)
//{
// sb.Append($"[{Global.InboundHttp}({ResUI.SystemProxy}):{LazyConfig.Instance.GetLocalPort(Global.InboundHttp)}]");
//}
//else
//{
sb.Append($"[{EInboundProtocol.http}:{AppHandler.Instance.GetLocalPort(EInboundProtocol.http)}]"); sb.Append($"[{EInboundProtocol.http}:{AppHandler.Instance.GetLocalPort(EInboundProtocol.http)}]");
//}
InboundDisplay = $"{ResUI.LabLocal}:{sb}"; InboundDisplay = $"{ResUI.LabLocal}:{sb}";
if (_config.inbound[0].allowLANConn) if (_config.inbound[0].allowLANConn)

View file

@ -43,7 +43,7 @@ public partial class App : Application
private void OnStartup(string[]? Args) private void OnStartup(string[]? Args)
{ {
var exePathKey = Utils.GetMD5(Utils.GetExePath()); var exePathKey = Utils.GetMd5(Utils.GetExePath());
var rebootas = (Args ?? new string[] { }).Any(t => t == Global.RebootAs); var rebootas = (Args ?? new string[] { }).Any(t => t == Global.RebootAs);
//ProgramStarted = new EventWaitHandle(false, EventResetMode.AutoReset, exePathKey, out bool bCreatedNew); //ProgramStarted = new EventWaitHandle(false, EventResetMode.AutoReset, exePathKey, out bool bCreatedNew);

View file

@ -272,7 +272,7 @@ namespace v2rayN.Desktop.Views
private void btnGUID_Click(object? sender, RoutedEventArgs e) private void btnGUID_Click(object? sender, RoutedEventArgs e)
{ {
txtId.Text = txtId.Text =
txtId5.Text = Utils.GetGUID(); txtId5.Text = Utils.GetGuid();
} }
private void SetHeaderType() private void SetHeaderType()

View file

@ -80,30 +80,35 @@ namespace v2rayN.Desktop.Views
this.BindCommand(ViewModel, vm => vm.ReloadCmd, v => v.menuReload).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.ReloadCmd, v => v.menuReload).DisposeWith(disposables);
this.OneWayBind(ViewModel, vm => vm.BlReloadEnabled, v => v.menuReload.IsEnabled).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.BlReloadEnabled, v => v.menuReload.IsEnabled).DisposeWith(disposables);
if (_config.uiItem.mainGirdOrientation == EGirdOrientation.Horizontal) switch (_config.uiItem.mainGirdOrientation)
{ {
gridMain.IsVisible = true; case EGirdOrientation.Horizontal:
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashProxies.IsVisible).DisposeWith(disposables); gridMain.IsVisible = true;
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashConnections.IsVisible).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabMsgView.IsVisible).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.TabMainSelectedIndex, v => v.tabMain.SelectedIndex).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashProxies.IsVisible).DisposeWith(disposables);
} this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashConnections.IsVisible).DisposeWith(disposables);
else if (_config.uiItem.mainGirdOrientation == EGirdOrientation.Vertical) this.Bind(ViewModel, vm => vm.TabMainSelectedIndex, v => v.tabMain.SelectedIndex).DisposeWith(disposables);
{ break;
gridMain1.IsVisible = true;
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashProxies1.IsVisible).DisposeWith(disposables); case EGirdOrientation.Vertical:
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashConnections1.IsVisible).DisposeWith(disposables); gridMain1.IsVisible = true;
this.Bind(ViewModel, vm => vm.TabMainSelectedIndex, v => v.tabMain1.SelectedIndex).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabMsgView1.IsVisible).DisposeWith(disposables);
} this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashProxies1.IsVisible).DisposeWith(disposables);
else this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashConnections1.IsVisible).DisposeWith(disposables);
{ this.Bind(ViewModel, vm => vm.TabMainSelectedIndex, v => v.tabMain1.SelectedIndex).DisposeWith(disposables);
gridMain2.IsVisible = true; break;
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashProxies2.IsVisible).DisposeWith(disposables);
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashConnections2.IsVisible).DisposeWith(disposables); case EGirdOrientation.Tab:
this.Bind(ViewModel, vm => vm.TabMainSelectedIndex, v => v.tabMain2.SelectedIndex).DisposeWith(disposables); default:
gridMain2.IsVisible = true;
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashProxies2.IsVisible).DisposeWith(disposables);
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashConnections2.IsVisible).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.TabMainSelectedIndex, v => v.tabMain2.SelectedIndex).DisposeWith(disposables);
break;
} }
}); });
this.Title = $"{Utils.GetVersion()} - {(Utils.IsAdministrator() ? ResUI.RunAsAdmin : ResUI.NotRunAsAdmin)}"; this.Title = $"{Utils.GetVersion()} - {(AppHandler.Instance.IsAdministrator ? ResUI.RunAsAdmin : ResUI.NotRunAsAdmin)}";
if (Utils.IsWindows()) if (Utils.IsWindows())
{ {
menuGlobalHotkeySetting.IsVisible = false; menuGlobalHotkeySetting.IsVisible = false;
@ -115,26 +120,29 @@ namespace v2rayN.Desktop.Views
menuGlobalHotkeySetting.IsVisible = false; menuGlobalHotkeySetting.IsVisible = false;
} }
if (_config.uiItem.mainGirdOrientation == EGirdOrientation.Horizontal) switch (_config.uiItem.mainGirdOrientation)
{ {
tabProfiles.Content ??= new ProfilesView(this); case EGirdOrientation.Horizontal:
tabMsgView.Content ??= new MsgView(); tabProfiles.Content ??= new ProfilesView(this);
tabClashProxies.Content ??= new ClashProxiesView(); tabMsgView.Content ??= new MsgView();
tabClashConnections.Content ??= new ClashConnectionsView(); tabClashProxies.Content ??= new ClashProxiesView();
} tabClashConnections.Content ??= new ClashConnectionsView();
else if (_config.uiItem.mainGirdOrientation == EGirdOrientation.Vertical) break;
{
tabProfiles1.Content ??= new ProfilesView(this); case EGirdOrientation.Vertical:
tabMsgView1.Content ??= new MsgView(); tabProfiles1.Content ??= new ProfilesView(this);
tabClashProxies1.Content ??= new ClashProxiesView(); tabMsgView1.Content ??= new MsgView();
tabClashConnections1.Content ??= new ClashConnectionsView(); tabClashProxies1.Content ??= new ClashProxiesView();
} tabClashConnections1.Content ??= new ClashConnectionsView();
else break;
{
tabProfiles2.Content ??= new ProfilesView(this); case EGirdOrientation.Tab:
tabMsgView2.Content ??= new MsgView(); default:
tabClashProxies2.Content ??= new ClashProxiesView(); tabProfiles2.Content ??= new ProfilesView(this);
tabClashConnections2.Content ??= new ClashConnectionsView(); tabMsgView2.Content ??= new MsgView();
tabClashProxies2.Content ??= new ClashProxiesView();
tabClashConnections2.Content ??= new ClashConnectionsView();
break;
} }
conTheme.Content ??= new ThemeSettingView(); conTheme.Content ??= new ThemeSettingView();

View file

@ -24,23 +24,47 @@
<conv:InverseBooleanConverter x:Key="InverseBooleanConverter" /> <conv:InverseBooleanConverter x:Key="InverseBooleanConverter" />
<Thickness <Thickness
x:Key="ServerItemMargin" x:Key="Margin4"
Bottom="4" Bottom="4"
Left="4" Left="4"
Right="4" Right="4"
Top="4" /> Top="4" />
<Thickness <Thickness
x:Key="SettingItemMargin" x:Key="Margin8"
Bottom="8" Bottom="8"
Left="8" Left="8"
Right="8" Right="8"
Top="8" /> Top="8" />
<Thickness <Thickness
x:Key="OutlinedTextBoxDefaultPadding" x:Key="OutlinedTextBoxDefaultPadding"
Bottom="12" Bottom="8"
Left="16" Left="8"
Right="12" Right="8"
Top="12" /> Top="8" />
<Thickness
x:Key="MarginLeftRight4"
Bottom="0"
Left="4"
Right="4"
Top="0" />
<Thickness
x:Key="MarginLeftRight8"
Bottom="0"
Left="8"
Right="8"
Top="0" />
<Thickness
x:Key="MarginLeft8"
Bottom="0"
Left="8"
Right="0"
Top="0" />
<Thickness
x:Key="MarginRight8"
Bottom="0"
Left="0"
Right="8"
Top="0" />
<Style <Style
x:Key="ModuleTitle" x:Key="ModuleTitle"
BasedOn="{StaticResource MaterialDesignTextBlock}" BasedOn="{StaticResource MaterialDesignTextBlock}"

View file

@ -26,7 +26,7 @@ namespace v2rayN
/// <param name="e"></param> /// <param name="e"></param>
protected override void OnStartup(StartupEventArgs e) protected override void OnStartup(StartupEventArgs e)
{ {
var exePathKey = Utils.GetMD5(Utils.GetExePath()); var exePathKey = Utils.GetMd5(Utils.GetExePath());
var rebootas = (e.Args ?? new string[] { }).Any(t => t == Global.RebootAs); var rebootas = (e.Args ?? new string[] { }).Any(t => t == Global.RebootAs);
ProgramStarted = new EventWaitHandle(false, EventResetMode.AutoReset, exePathKey, out bool bCreatedNew); ProgramStarted = new EventWaitHandle(false, EventResetMode.AutoReset, exePathKey, out bool bCreatedNew);

View file

@ -218,7 +218,7 @@ namespace v2rayN
{ {
try try
{ {
var autoRunName = $"{AutoRunName}_{Utils.GetMD5(Utils.StartupPath())}"; var autoRunName = $"{AutoRunName}_{Utils.GetMd5(Utils.StartupPath())}";
//delete first //delete first
RegWriteValue(AutoRunRegPath, autoRunName, ""); RegWriteValue(AutoRunRegPath, autoRunName, "");
if (Utils.IsAdministrator()) if (Utils.IsAdministrator())

View file

@ -22,9 +22,9 @@
TextElement.Foreground="{DynamicResource MaterialDesignBody}" TextElement.Foreground="{DynamicResource MaterialDesignBody}"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<DockPanel Margin="8"> <DockPanel Margin="{StaticResource Margin8}">
<StackPanel <StackPanel
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Center" HorizontalAlignment="Center"
DockPanel.Dock="Bottom" DockPanel.Dock="Bottom"
Orientation="Horizontal"> Orientation="Horizontal">
@ -37,7 +37,7 @@
<Button <Button
x:Name="btnCancel" x:Name="btnCancel"
Width="100" Width="100"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
Content="{x:Static resx:ResUI.TbCancel}" Content="{x:Static resx:ResUI.TbCancel}"
Cursor="Hand" Cursor="Hand"
IsCancel="true" IsCancel="true"
@ -72,14 +72,14 @@
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
Style="{StaticResource ModuleTitle}" Style="{StaticResource ModuleTitle}"
Text="{x:Static resx:ResUI.menuServers}" /> Text="{x:Static resx:ResUI.menuServers}" />
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbRemarks}" /> Text="{x:Static resx:ResUI.TbRemarks}" />
@ -89,7 +89,7 @@
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Top" VerticalAlignment="Top"
AcceptsReturn="True" AcceptsReturn="True"
Style="{StaticResource MyOutlinedTextBox}" /> Style="{StaticResource MyOutlinedTextBox}" />
@ -97,7 +97,7 @@
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbAddress}" /> Text="{x:Static resx:ResUI.TbAddress}" />
@ -106,7 +106,7 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Top" VerticalAlignment="Top"
AcceptsReturn="True" AcceptsReturn="True"
IsReadOnly="True" IsReadOnly="True"
@ -118,12 +118,12 @@
Orientation="Horizontal"> Orientation="Horizontal">
<Button <Button
x:Name="btnBrowse" x:Name="btnBrowse"
Margin="2,0" Margin="{StaticResource MarginLeftRight4}"
Content="{x:Static resx:ResUI.TbBrowse}" Content="{x:Static resx:ResUI.TbBrowse}"
Style="{StaticResource DefButton}" /> Style="{StaticResource DefButton}" />
<Button <Button
x:Name="btnEdit" x:Name="btnEdit"
Margin="2,0" Margin="{StaticResource MarginLeftRight4}"
Content="{x:Static resx:ResUI.TbEdit}" Content="{x:Static resx:ResUI.TbEdit}"
Style="{StaticResource DefButton}" /> Style="{StaticResource DefButton}" />
</StackPanel> </StackPanel>
@ -131,7 +131,7 @@
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbCoreType}" /> Text="{x:Static resx:ResUI.TbCoreType}" />
@ -140,7 +140,7 @@
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
MaxDropDownHeight="1000" MaxDropDownHeight="1000"
Style="{StaticResource MyOutlinedTextComboBox}" /> Style="{StaticResource MyOutlinedTextComboBox}" />
@ -148,18 +148,18 @@
<TextBlock <TextBlock
Grid.Row="4" Grid.Row="4"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbDisplayLog}" /> Text="{x:Static resx:ResUI.TbDisplayLog}" />
<StackPanel <StackPanel
Grid.Row="4" Grid.Row="4"
Grid.Column="1" Grid.Column="1"
Margin="4" Margin="{StaticResource Margin4}"
Orientation="Horizontal"> Orientation="Horizontal">
<ToggleButton x:Name="togDisplayLog" HorizontalAlignment="Left" /> <ToggleButton x:Name="togDisplayLog" HorizontalAlignment="Left" />
<TextBlock <TextBlock
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TipDisplayLog}" /> Text="{x:Static resx:ResUI.TipDisplayLog}" />
@ -168,7 +168,7 @@
<TextBlock <TextBlock
Grid.Row="5" Grid.Row="5"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbPreSocksPort}" /> Text="{x:Static resx:ResUI.TbPreSocksPort}" />
@ -177,7 +177,7 @@
Grid.Row="5" Grid.Row="5"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
AcceptsReturn="True" AcceptsReturn="True"
Style="{StaticResource MyOutlinedTextBox}" /> Style="{StaticResource MyOutlinedTextBox}" />
@ -193,7 +193,7 @@
TextWrapping="Wrap" /> TextWrapping="Wrap" />
<TextBlock <TextBlock
Width="500" Width="500"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.CustomServerTips}" Text="{x:Static resx:ResUI.CustomServerTips}"

View file

@ -22,9 +22,9 @@
TextElement.Foreground="{DynamicResource MaterialDesignBody}" TextElement.Foreground="{DynamicResource MaterialDesignBody}"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<DockPanel Margin="8"> <DockPanel Margin="{StaticResource Margin8}">
<StackPanel <StackPanel
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Center" HorizontalAlignment="Center"
DockPanel.Dock="Bottom" DockPanel.Dock="Bottom"
Orientation="Horizontal"> Orientation="Horizontal">
@ -37,7 +37,7 @@
<Button <Button
x:Name="btnCancel" x:Name="btnCancel"
Width="100" Width="100"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
Content="{x:Static resx:ResUI.TbCancel}" Content="{x:Static resx:ResUI.TbCancel}"
Cursor="Hand" Cursor="Hand"
IsCancel="true" IsCancel="true"
@ -76,7 +76,7 @@
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource ModuleTitle}" Style="{StaticResource ModuleTitle}"
Text="{x:Static resx:ResUI.menuServers}" /> Text="{x:Static resx:ResUI.menuServers}" />
<StackPanel <StackPanel
@ -86,7 +86,7 @@
<ComboBox <ComboBox
x:Name="cmbCoreType" x:Name="cmbCoreType"
Width="100" Width="100"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.TbCoreType}" materialDesign:HintAssist.Hint="{x:Static resx:ResUI.TbCoreType}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
</StackPanel> </StackPanel>
@ -94,7 +94,7 @@
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbRemarks}" /> Text="{x:Static resx:ResUI.TbRemarks}" />
@ -103,13 +103,13 @@
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbAddress}" /> Text="{x:Static resx:ResUI.TbAddress}" />
@ -118,13 +118,13 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbPort}" /> Text="{x:Static resx:ResUI.TbPort}" />
@ -133,7 +133,7 @@
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Width="100" Width="100"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
</Grid> </Grid>
@ -162,7 +162,7 @@
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbId}" /> Text="{x:Static resx:ResUI.TbId}" />
@ -171,20 +171,20 @@
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<Button <Button
x:Name="btnGUID" x:Name="btnGUID"
Grid.Row="1" Grid.Row="1"
Grid.Column="2" Grid.Column="2"
Margin="4,0" Margin="{StaticResource MarginLeftRight4}"
Content="{x:Static resx:ResUI.TbGUID}" Content="{x:Static resx:ResUI.TbGUID}"
Style="{StaticResource DefButton}" /> Style="{StaticResource DefButton}" />
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbAlterId}" /> Text="{x:Static resx:ResUI.TbAlterId}" />
@ -193,14 +193,14 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Width="100" Width="100"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSecurity}" /> Text="{x:Static resx:ResUI.TbSecurity}" />
@ -209,7 +209,7 @@
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
</Grid> </Grid>
<Grid <Grid
@ -230,7 +230,7 @@
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbId3}" /> Text="{x:Static resx:ResUI.TbId3}" />
@ -239,13 +239,13 @@
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSecurity3}" /> Text="{x:Static resx:ResUI.TbSecurity3}" />
@ -254,7 +254,7 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Width="300" Width="300"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
</Grid> </Grid>
<Grid <Grid
@ -275,7 +275,7 @@
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSecurity4}" /> Text="{x:Static resx:ResUI.TbSecurity4}" />
@ -284,13 +284,13 @@
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbId4}" /> Text="{x:Static resx:ResUI.TbId4}" />
@ -299,7 +299,7 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
</Grid> </Grid>
<Grid <Grid
@ -321,7 +321,7 @@
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbId5}" /> Text="{x:Static resx:ResUI.TbId5}" />
@ -330,20 +330,20 @@
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<Button <Button
x:Name="btnGUID5" x:Name="btnGUID5"
Grid.Row="1" Grid.Row="1"
Grid.Column="2" Grid.Column="2"
Margin="4,0" Margin="{StaticResource MarginLeftRight4}"
Content="{x:Static resx:ResUI.TbGUID}" Content="{x:Static resx:ResUI.TbGUID}"
Style="{StaticResource DefButton}" /> Style="{StaticResource DefButton}" />
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbFlow5}" /> Text="{x:Static resx:ResUI.TbFlow5}" />
@ -352,13 +352,13 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSecurity5}" /> Text="{x:Static resx:ResUI.TbSecurity5}" />
@ -367,7 +367,7 @@
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
</Grid> </Grid>
@ -389,7 +389,7 @@
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbId3}" /> Text="{x:Static resx:ResUI.TbId3}" />
@ -398,13 +398,13 @@
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbFlow5}" /> Text="{x:Static resx:ResUI.TbFlow5}" />
@ -413,7 +413,7 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
</Grid> </Grid>
<Grid <Grid
@ -434,7 +434,7 @@
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbId3}" /> Text="{x:Static resx:ResUI.TbId3}" />
@ -443,13 +443,13 @@
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbPath7}" /> Text="{x:Static resx:ResUI.TbPath7}" />
@ -458,7 +458,7 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
</Grid> </Grid>
<Grid <Grid
@ -479,7 +479,7 @@
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbId}" /> Text="{x:Static resx:ResUI.TbId}" />
@ -488,13 +488,13 @@
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbId3}" /> Text="{x:Static resx:ResUI.TbId3}" />
@ -503,13 +503,13 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbHeaderType8}" /> Text="{x:Static resx:ResUI.TbHeaderType8}" />
@ -518,7 +518,7 @@
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Width="100" Width="100"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
</Grid> </Grid>
<Grid <Grid
@ -541,7 +541,7 @@
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbPrivateKey}" /> Text="{x:Static resx:ResUI.TbPrivateKey}" />
@ -550,13 +550,13 @@
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbPublicKey}" /> Text="{x:Static resx:ResUI.TbPublicKey}" />
@ -565,14 +565,14 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbReserved}" /> Text="{x:Static resx:ResUI.TbReserved}" />
@ -581,13 +581,13 @@
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="4" Grid.Row="4"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbLocalAddress}" /> Text="{x:Static resx:ResUI.TbLocalAddress}" />
@ -596,13 +596,13 @@
Grid.Row="4" Grid.Row="4"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="5" Grid.Row="5"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="Mtu" /> Text="Mtu" />
@ -611,7 +611,7 @@
Grid.Row="5" Grid.Row="5"
Grid.Column="1" Grid.Column="1"
Width="100" Width="100"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
</Grid> </Grid>
@ -642,14 +642,14 @@
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
Grid.ColumnSpan="2" Grid.ColumnSpan="2"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource ModuleTitle}" Style="{StaticResource ModuleTitle}"
Text="{x:Static resx:ResUI.GbTransport}" /> Text="{x:Static resx:ResUI.GbTransport}" />
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbNetwork}" /> Text="{x:Static resx:ResUI.TbNetwork}" />
@ -658,12 +658,12 @@
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Width="100" Width="100"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="2" Grid.Column="2"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TipNetwork}" /> Text="{x:Static resx:ResUI.TipNetwork}" />
@ -672,7 +672,7 @@
x:Name="labHeaderType" x:Name="labHeaderType"
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbHeaderType}" /> Text="{x:Static resx:ResUI.TbHeaderType}" />
@ -681,13 +681,13 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Width="100" Width="100"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
<TextBlock <TextBlock
x:Name="tipHeaderType" x:Name="tipHeaderType"
Grid.Row="2" Grid.Row="2"
Grid.Column="2" Grid.Column="2"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbHeaderType}" /> Text="{x:Static resx:ResUI.TbHeaderType}" />
@ -695,7 +695,7 @@
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbRequestHost}" /> Text="{x:Static resx:ResUI.TbRequestHost}" />
@ -704,13 +704,13 @@
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
x:Name="tipRequestHost" x:Name="tipRequestHost"
Grid.Row="3" Grid.Row="3"
Grid.Column="2" Grid.Column="2"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbRequestHost}" /> Text="{x:Static resx:ResUI.TbRequestHost}" />
@ -718,7 +718,7 @@
<TextBlock <TextBlock
Grid.Row="4" Grid.Row="4"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbPath}" /> Text="{x:Static resx:ResUI.TbPath}" />
@ -727,13 +727,13 @@
Grid.Row="4" Grid.Row="4"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
x:Name="tipPath" x:Name="tipPath"
Grid.Row="4" Grid.Row="4"
Grid.Column="2" Grid.Column="2"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbPath}" /> Text="{x:Static resx:ResUI.TbPath}" />
@ -760,7 +760,7 @@
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbStreamSecurity}" /> Text="{x:Static resx:ResUI.TbStreamSecurity}" />
@ -769,7 +769,7 @@
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Width="100" Width="100"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
</Grid> </Grid>
<Grid <Grid
@ -791,7 +791,7 @@
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSNI}" /> Text="{x:Static resx:ResUI.TbSNI}" />
@ -800,14 +800,14 @@
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbFingerprint}" /> Text="{x:Static resx:ResUI.TbFingerprint}" />
@ -816,14 +816,14 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
IsEditable="True" IsEditable="True"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbAlpn}" /> Text="{x:Static resx:ResUI.TbAlpn}" />
@ -832,13 +832,13 @@
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
<TextBlock <TextBlock
Grid.Row="4" Grid.Row="4"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbAllowInsecure}" /> Text="{x:Static resx:ResUI.TbAllowInsecure}" />
@ -847,7 +847,7 @@
Grid.Row="4" Grid.Row="4"
Grid.Column="1" Grid.Column="1"
Width="100" Width="100"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
</Grid> </Grid>
<Grid <Grid
@ -869,7 +869,7 @@
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSNI}" /> Text="{x:Static resx:ResUI.TbSNI}" />
@ -878,14 +878,14 @@
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbFingerprint}" /> Text="{x:Static resx:ResUI.TbFingerprint}" />
@ -894,14 +894,14 @@
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
IsEditable="True" IsEditable="True"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbPublicKey}" /> Text="{x:Static resx:ResUI.TbPublicKey}" />
@ -910,14 +910,14 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbShortId}" /> Text="{x:Static resx:ResUI.TbShortId}" />
@ -926,14 +926,14 @@
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="4" Grid.Row="4"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSpiderX}" /> Text="{x:Static resx:ResUI.TbSpiderX}" />
@ -942,7 +942,7 @@
Grid.Row="4" Grid.Row="4"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
Margin="{StaticResource ServerItemMargin}" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
</Grid> </Grid>

View file

@ -267,7 +267,7 @@ namespace v2rayN.Views
private void btnGUID_Click(object sender, RoutedEventArgs e) private void btnGUID_Click(object sender, RoutedEventArgs e)
{ {
txtId.Text = txtId.Text =
txtId5.Text = Utils.GetGUID(); txtId5.Text = Utils.GetGuid();
} }
private void SetHeaderType() private void SetHeaderType()

View file

@ -21,11 +21,11 @@
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>
</UserControl.Resources> </UserControl.Resources>
<DockPanel Margin="16"> <DockPanel Margin="{StaticResource Margin8}">
<DockPanel Margin="8" DockPanel.Dock="Bottom"> <DockPanel Margin="{StaticResource Margin8}" DockPanel.Dock="Bottom">
<Button <Button
Width="100" Width="100"
Margin="8" Margin="{StaticResource Margin8}"
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
Content="{x:Static resx:ResUI.menuClose}" Content="{x:Static resx:ResUI.menuClose}"
DockPanel.Dock="Right" DockPanel.Dock="Right"
@ -35,14 +35,14 @@
<TextBlock <TextBlock
x:Name="txtMsg" x:Name="txtMsg"
Margin="8" Margin="{StaticResource Margin8}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Style="{StaticResource ToolbarTextBlock}" /> Style="{StaticResource ToolbarTextBlock}" />
</DockPanel> </DockPanel>
<StackPanel> <StackPanel>
<materialDesign:Card Width="Auto" Margin="8"> <materialDesign:Card Width="Auto" Margin="{StaticResource Margin8}">
<Grid Margin="8"> <Grid Margin="{StaticResource Margin8}">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@ -56,14 +56,14 @@
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
Grid.Column="0" Grid.Column="0"
Margin="8" Margin="{StaticResource Margin8}"
Style="{StaticResource ModuleTitle}" Style="{StaticResource ModuleTitle}"
Text="{x:Static resx:ResUI.menuLocalBackupAndRestore}" /> Text="{x:Static resx:ResUI.menuLocalBackupAndRestore}" />
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.menuLocalBackup}" /> Text="{x:Static resx:ResUI.menuLocalBackup}" />
@ -71,7 +71,7 @@
x:Name="menuLocalBackup" x:Name="menuLocalBackup"
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Content="{x:Static resx:ResUI.menuLocalBackup}" Content="{x:Static resx:ResUI.menuLocalBackup}"
Style="{StaticResource DefButton}" /> Style="{StaticResource DefButton}" />
@ -84,7 +84,7 @@
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"
Grid.Column="0" Grid.Column="0"
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.menuLocalRestore}" /> Text="{x:Static resx:ResUI.menuLocalRestore}" />
@ -92,14 +92,14 @@
x:Name="menuLocalRestore" x:Name="menuLocalRestore"
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Content="{x:Static resx:ResUI.menuLocalRestore}" Content="{x:Static resx:ResUI.menuLocalRestore}"
Style="{StaticResource DefButton}" /> Style="{StaticResource DefButton}" />
</Grid> </Grid>
</materialDesign:Card> </materialDesign:Card>
<materialDesign:Card Width="Auto" Margin="8"> <materialDesign:Card Width="Auto" Margin="{StaticResource Margin8}">
<Grid Margin="8"> <Grid Margin="{StaticResource Margin8}">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@ -115,7 +115,7 @@
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
Grid.Column="0" Grid.Column="0"
Margin="8" Margin="{StaticResource Margin8}"
Style="{StaticResource ModuleTitle}" Style="{StaticResource ModuleTitle}"
Text="{x:Static resx:ResUI.menuRemoteBackupAndRestore}" /> Text="{x:Static resx:ResUI.menuRemoteBackupAndRestore}" />
@ -124,7 +124,7 @@
HorizontalAlignment="Right" HorizontalAlignment="Right"
StaysOpen="True" StaysOpen="True"
Style="{StaticResource MaterialDesignToolForegroundPopupBox}"> Style="{StaticResource MaterialDesignToolForegroundPopupBox}">
<StackPanel Margin="16"> <StackPanel Margin="{StaticResource Margin8}">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@ -140,7 +140,7 @@
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
Grid.Column="0" Grid.Column="0"
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvWebDavUrl}" /> Text="{x:Static resx:ResUI.LvWebDavUrl}" />
@ -149,7 +149,7 @@
x:Name="txtWebDavUrl" x:Name="txtWebDavUrl"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource DefTextBox}" Style="{StaticResource DefTextBox}"
TextWrapping="Wrap" /> TextWrapping="Wrap" />
@ -157,7 +157,7 @@
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvWebDavUserName}" /> Text="{x:Static resx:ResUI.LvWebDavUserName}" />
@ -166,14 +166,14 @@
x:Name="txtWebDavUserName" x:Name="txtWebDavUserName"
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvWebDavPassword}" /> Text="{x:Static resx:ResUI.LvWebDavPassword}" />
@ -182,14 +182,14 @@
x:Name="txtWebDavPassword" x:Name="txtWebDavPassword"
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"
Grid.Column="0" Grid.Column="0"
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvWebDavDirName}" /> Text="{x:Static resx:ResUI.LvWebDavDirName}" />
@ -198,7 +198,7 @@
x:Name="txtWebDavDirName" x:Name="txtWebDavDirName"
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
@ -206,7 +206,7 @@
x:Name="menuWebDavCheck" x:Name="menuWebDavCheck"
Grid.Row="4" Grid.Row="4"
Grid.Column="1" Grid.Column="1"
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Content="{x:Static resx:ResUI.LvWebDavCheck}" Content="{x:Static resx:ResUI.LvWebDavCheck}"
Style="{StaticResource DefButton}" /> Style="{StaticResource DefButton}" />
@ -218,7 +218,7 @@
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.menuRemoteBackup}" /> Text="{x:Static resx:ResUI.menuRemoteBackup}" />
@ -226,7 +226,7 @@
x:Name="menuRemoteBackup" x:Name="menuRemoteBackup"
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Content="{x:Static resx:ResUI.menuRemoteBackup}" Content="{x:Static resx:ResUI.menuRemoteBackup}"
Style="{StaticResource DefButton}" /> Style="{StaticResource DefButton}" />
@ -238,7 +238,7 @@
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"
Grid.Column="0" Grid.Column="0"
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.menuRemoteRestore}" /> Text="{x:Static resx:ResUI.menuRemoteRestore}" />
@ -246,7 +246,7 @@
x:Name="menuRemoteRestore" x:Name="menuRemoteRestore"
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Content="{x:Static resx:ResUI.menuRemoteRestore}" Content="{x:Static resx:ResUI.menuRemoteRestore}"
Style="{StaticResource DefButton}" /> Style="{StaticResource DefButton}" />

View file

@ -15,27 +15,27 @@
Style="{StaticResource ViewGlobal}" Style="{StaticResource ViewGlobal}"
mc:Ignorable="d"> mc:Ignorable="d">
<DockPanel Margin="16"> <DockPanel Margin="{StaticResource Margin8}">
<StackPanel <StackPanel
Margin="8" Margin="{StaticResource Margin8}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
DockPanel.Dock="Bottom" DockPanel.Dock="Bottom"
Orientation="Horizontal"> Orientation="Horizontal">
<TextBlock <TextBlock
Margin="{StaticResource SettingItemMargin}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsEnableCheckPreReleaseUpdate}" /> Text="{x:Static resx:ResUI.TbSettingsEnableCheckPreReleaseUpdate}" />
<ToggleButton <ToggleButton
x:Name="togEnableCheckPreReleaseUpdate" x:Name="togEnableCheckPreReleaseUpdate"
Margin="{StaticResource SettingItemMargin}" Margin="{StaticResource Margin8}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
<Button <Button
x:Name="btnCheckUpdate" x:Name="btnCheckUpdate"
Width="100" Width="100"
Margin="8" Margin="{StaticResource Margin8}"
Content="{x:Static resx:ResUI.menuCheckUpdate}" Content="{x:Static resx:ResUI.menuCheckUpdate}"
IsCancel="True" IsCancel="True"
IsDefault="True" IsDefault="True"
@ -43,7 +43,7 @@
<Button <Button
Width="100" Width="100"
Margin="8" Margin="{StaticResource Margin8}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
Content="{x:Static resx:ResUI.menuClose}" Content="{x:Static resx:ResUI.menuClose}"
@ -67,7 +67,7 @@
<Border <Border
Width="500" Width="500"
Height="50" Height="50"
Margin="8" Margin="{StaticResource Margin8}"
Padding="0" Padding="0"
VerticalAlignment="Center"> VerticalAlignment="Center">
<Grid> <Grid>
@ -82,7 +82,7 @@
<ToggleButton <ToggleButton
x:Name="togAutoRefresh" x:Name="togAutoRefresh"
Grid.Column="0" Grid.Column="0"
Margin="8" Margin="{StaticResource Margin8}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
IsChecked="{Binding IsSelected}" /> IsChecked="{Binding IsSelected}" />
<TextBlock <TextBlock

View file

@ -13,9 +13,9 @@
x:TypeArguments="vms:ClashConnectionsViewModel" x:TypeArguments="vms:ClashConnectionsViewModel"
mc:Ignorable="d"> mc:Ignorable="d">
<DockPanel Margin="2"> <DockPanel Margin="{StaticResource Margin4}">
<WrapPanel <WrapPanel
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
DockPanel.Dock="Top" DockPanel.Dock="Top"
Orientation="Horizontal"> Orientation="Horizontal">
@ -23,21 +23,21 @@
<TextBox <TextBox
x:Name="txtHostFilter" x:Name="txtHostFilter"
Width="200" Width="200"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.ConnectionsHostFilterTitle}" materialDesign:HintAssist.Hint="{x:Static resx:ResUI.ConnectionsHostFilterTitle}"
materialDesign:TextFieldAssist.HasClearButton="True" materialDesign:TextFieldAssist.HasClearButton="True"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSorting}" /> Text="{x:Static resx:ResUI.TbSorting}" />
<ComboBox <ComboBox
x:Name="cmbSorting" x:Name="cmbSorting"
Width="100" Width="100"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
Style="{StaticResource DefComboBox}"> Style="{StaticResource DefComboBox}">
<ComboBoxItem Content="{x:Static resx:ResUI.TbSortingUpSpeed}" /> <ComboBoxItem Content="{x:Static resx:ResUI.TbSortingUpSpeed}" />
<ComboBoxItem Content="{x:Static resx:ResUI.TbSortingDownSpeed}" /> <ComboBoxItem Content="{x:Static resx:ResUI.TbSortingDownSpeed}" />
@ -51,20 +51,20 @@
x:Name="btnConnectionCloseAll" x:Name="btnConnectionCloseAll"
Width="24" Width="24"
Height="24" Height="24"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
ToolTip="{x:Static resx:ResUI.menuConnectionCloseAll}"> ToolTip="{x:Static resx:ResUI.menuConnectionCloseAll}">
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Close" /> <materialDesign:PackIcon VerticalAlignment="Center" Kind="Close" />
</Button> </Button>
<TextBlock <TextBlock
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbAutoRefresh}" /> Text="{x:Static resx:ResUI.TbAutoRefresh}" />
<ToggleButton <ToggleButton
x:Name="togAutoRefresh" x:Name="togAutoRefresh"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
</WrapPanel> </WrapPanel>

View file

@ -20,22 +20,22 @@
<converters:DelayColorConverter x:Key="DelayColorConverter" /> <converters:DelayColorConverter x:Key="DelayColorConverter" />
</UserControl.Resources> </UserControl.Resources>
<DockPanel Margin="2"> <DockPanel Margin="{StaticResource Margin4}">
<WrapPanel <WrapPanel
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
DockPanel.Dock="Top" DockPanel.Dock="Top"
Orientation="Horizontal"> Orientation="Horizontal">
<TextBlock <TextBlock
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.menuRulemode}" /> Text="{x:Static resx:ResUI.menuRulemode}" />
<ComboBox <ComboBox
x:Name="cmbRulemode" x:Name="cmbRulemode"
Width="80" Width="80"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
Style="{StaticResource DefComboBox}"> Style="{StaticResource DefComboBox}">
<ComboBoxItem Content="{x:Static resx:ResUI.menuModeRule}" /> <ComboBoxItem Content="{x:Static resx:ResUI.menuModeRule}" />
<ComboBoxItem Content="{x:Static resx:ResUI.menuModeGlobal}" /> <ComboBoxItem Content="{x:Static resx:ResUI.menuModeGlobal}" />
@ -43,14 +43,14 @@
</ComboBox> </ComboBox>
<TextBlock <TextBlock
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSorting}" /> Text="{x:Static resx:ResUI.TbSorting}" />
<ComboBox <ComboBox
x:Name="cmbSorting" x:Name="cmbSorting"
Width="60" Width="60"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
Style="{StaticResource DefComboBox}"> Style="{StaticResource DefComboBox}">
<ComboBoxItem Content="{x:Static resx:ResUI.TbSortingDelay}" /> <ComboBoxItem Content="{x:Static resx:ResUI.TbSortingDelay}" />
<ComboBoxItem Content="{x:Static resx:ResUI.TbSortingName}" /> <ComboBoxItem Content="{x:Static resx:ResUI.TbSortingName}" />
@ -61,7 +61,7 @@
x:Name="menuProxiesReload" x:Name="menuProxiesReload"
Width="24" Width="24"
Height="24" Height="24"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
ToolTip="{x:Static resx:ResUI.menuProxiesReload}"> ToolTip="{x:Static resx:ResUI.menuProxiesReload}">
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Reload" /> <materialDesign:PackIcon VerticalAlignment="Center" Kind="Reload" />
@ -71,26 +71,26 @@
x:Name="menuProxiesDelaytest" x:Name="menuProxiesDelaytest"
Width="24" Width="24"
Height="24" Height="24"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
ToolTip="{x:Static resx:ResUI.menuProxiesDelaytest}"> ToolTip="{x:Static resx:ResUI.menuProxiesDelaytest}">
<materialDesign:PackIcon VerticalAlignment="Center" Kind="LightningBolt" /> <materialDesign:PackIcon VerticalAlignment="Center" Kind="LightningBolt" />
</Button> </Button>
<TextBlock <TextBlock
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbAutoRefresh}" /> Text="{x:Static resx:ResUI.TbAutoRefresh}" />
<ToggleButton <ToggleButton
x:Name="togAutoRefresh" x:Name="togAutoRefresh"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
</WrapPanel> </WrapPanel>
<DockPanel> <DockPanel>
<ListView <ListView
x:Name="lstProxyGroups" x:Name="lstProxyGroups"
Margin="0,0,5,0" Margin="{StaticResource MarginRight8}"
BorderThickness="0" BorderThickness="0"
DockPanel.Dock="Left" DockPanel.Dock="Left"
ItemContainerStyle="{StaticResource lvItemSelected}" ItemContainerStyle="{StaticResource lvItemSelected}"
@ -106,10 +106,10 @@
<DataTemplate> <DataTemplate>
<Border <Border
Width="160" Width="160"
Margin="4,0" Margin="{StaticResource MarginLeftRight4}"
Padding="0"> Padding="0">
<DockPanel> <DockPanel>
<Grid Grid.Column="0" Margin="4"> <Grid Grid.Column="0" Margin="{StaticResource Margin4}">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition /> <RowDefinition />
<RowDefinition /> <RowDefinition />
@ -162,7 +162,7 @@
CornerRadius="4" CornerRadius="4"
DockPanel.Dock="Left" DockPanel.Dock="Left"
Visibility="{Binding Path=isActive, Converter={StaticResource BoolToVisConverter}}" /> Visibility="{Binding Path=isActive, Converter={StaticResource BoolToVisConverter}}" />
<Grid Margin="4"> <Grid Margin="{StaticResource Margin4}">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="2*" /> <RowDefinition Height="2*" />
<RowDefinition Height="1*" /> <RowDefinition Height="1*" />

View file

@ -22,9 +22,9 @@
TextElement.Foreground="{DynamicResource MaterialDesignBody}" TextElement.Foreground="{DynamicResource MaterialDesignBody}"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<DockPanel Margin="8"> <DockPanel Margin="{StaticResource Margin8}">
<StackPanel <StackPanel
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Center" HorizontalAlignment="Center"
DockPanel.Dock="Bottom" DockPanel.Dock="Bottom"
Orientation="Horizontal"> Orientation="Horizontal">
@ -37,7 +37,7 @@
<Button <Button
x:Name="btnCancel" x:Name="btnCancel"
Width="100" Width="100"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
Content="{x:Static resx:ResUI.TbCancel}" Content="{x:Static resx:ResUI.TbCancel}"
Cursor="Hand" Cursor="Hand"
IsCancel="true" IsCancel="true"
@ -47,15 +47,15 @@
<TabControl HorizontalContentAlignment="Left"> <TabControl HorizontalContentAlignment="Left">
<TabItem Header="{x:Static resx:ResUI.TbSettingsCoreDns}"> <TabItem Header="{x:Static resx:ResUI.TbSettingsCoreDns}">
<DockPanel Margin="{StaticResource SettingItemMargin}"> <DockPanel Margin="{StaticResource Margin8}">
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal"> <StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
<TextBlock <TextBlock
Margin="{StaticResource SettingItemMargin}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsRemoteDNS}" /> Text="{x:Static resx:ResUI.TbSettingsRemoteDNS}" />
<TextBlock <TextBlock
Margin="{StaticResource SettingItemMargin}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"> Style="{StaticResource ToolbarTextBlock}">
<Hyperlink Click="linkDnsObjectDoc_Click"> <Hyperlink Click="linkDnsObjectDoc_Click">
@ -65,7 +65,7 @@
</TextBlock> </TextBlock>
<Button <Button
x:Name="btnImportDefConfig4V2ray" x:Name="btnImportDefConfig4V2ray"
Margin="{StaticResource SettingItemMargin}" Margin="{StaticResource Margin8}"
Content="{x:Static resx:ResUI.TbSettingDnsImportDefConfig}" Content="{x:Static resx:ResUI.TbSettingDnsImportDefConfig}"
Cursor="Hand" Cursor="Hand"
Style="{StaticResource DefButton}" /> Style="{StaticResource DefButton}" />
@ -74,39 +74,39 @@
<WrapPanel DockPanel.Dock="Bottom" Orientation="Horizontal"> <WrapPanel DockPanel.Dock="Bottom" Orientation="Horizontal">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock <TextBlock
Margin="{StaticResource SettingItemMargin}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsUseSystemHosts}" /> Text="{x:Static resx:ResUI.TbSettingsUseSystemHosts}" />
<ToggleButton <ToggleButton
x:Name="togUseSystemHosts" x:Name="togUseSystemHosts"
Margin="{StaticResource SettingItemMargin}" Margin="{StaticResource Margin8}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock <TextBlock
Margin="{StaticResource SettingItemMargin}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsDomainStrategy4Freedom}" /> Text="{x:Static resx:ResUI.TbSettingsDomainStrategy4Freedom}" />
<ComboBox <ComboBox
x:Name="cmbdomainStrategy4Freedom" x:Name="cmbdomainStrategy4Freedom"
Width="150" Width="150"
Margin="{StaticResource SettingItemMargin}" Margin="{StaticResource Margin8}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock <TextBlock
Margin="{StaticResource SettingItemMargin}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsDomainDNSAddress}" /> Text="{x:Static resx:ResUI.TbSettingsDomainDNSAddress}" />
<ComboBox <ComboBox
x:Name="cmbdomainDNSAddress" x:Name="cmbdomainDNSAddress"
Width="150" Width="150"
Margin="{StaticResource SettingItemMargin}" Margin="{StaticResource Margin8}"
IsEditable="True" IsEditable="True"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
</StackPanel> </StackPanel>
@ -114,7 +114,7 @@
<TextBox <TextBox
x:Name="txtnormalDNS" x:Name="txtnormalDNS"
Margin="{StaticResource SettingItemMargin}" Margin="{StaticResource Margin8}"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
materialDesign:HintAssist.Hint="HTTP/SOCKS" materialDesign:HintAssist.Hint="HTTP/SOCKS"
AcceptsReturn="True" AcceptsReturn="True"
@ -126,10 +126,10 @@
</TabItem> </TabItem>
<TabItem Header="{x:Static resx:ResUI.TbSettingsCoreDnsSingbox}"> <TabItem Header="{x:Static resx:ResUI.TbSettingsCoreDnsSingbox}">
<DockPanel Margin="{StaticResource SettingItemMargin}"> <DockPanel Margin="{StaticResource Margin8}">
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal"> <StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
<TextBlock <TextBlock
Margin="{StaticResource SettingItemMargin}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"> Style="{StaticResource ToolbarTextBlock}">
<Hyperlink Click="linkDnsSingboxObjectDoc_Click"> <Hyperlink Click="linkDnsSingboxObjectDoc_Click">
@ -139,7 +139,7 @@
</TextBlock> </TextBlock>
<Button <Button
x:Name="btnImportDefConfig4Singbox" x:Name="btnImportDefConfig4Singbox"
Margin="{StaticResource SettingItemMargin}" Margin="{StaticResource Margin8}"
Content="{x:Static resx:ResUI.TbSettingDnsImportDefConfig}" Content="{x:Static resx:ResUI.TbSettingDnsImportDefConfig}"
Cursor="Hand" Cursor="Hand"
Style="{StaticResource DefButton}" /> Style="{StaticResource DefButton}" />
@ -148,33 +148,33 @@
<WrapPanel DockPanel.Dock="Bottom" Orientation="Horizontal"> <WrapPanel DockPanel.Dock="Bottom" Orientation="Horizontal">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock <TextBlock
Margin="{StaticResource SettingItemMargin}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsDomainStrategy4Out}" /> Text="{x:Static resx:ResUI.TbSettingsDomainStrategy4Out}" />
<ComboBox <ComboBox
x:Name="cmbdomainStrategy4Out" x:Name="cmbdomainStrategy4Out"
Width="150" Width="150"
Margin="{StaticResource SettingItemMargin}" Margin="{StaticResource Margin8}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock <TextBlock
Margin="{StaticResource SettingItemMargin}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsDomainDNSAddress}" /> Text="{x:Static resx:ResUI.TbSettingsDomainDNSAddress}" />
<ComboBox <ComboBox
x:Name="cmbdomainDNSAddress2" x:Name="cmbdomainDNSAddress2"
Width="150" Width="150"
Margin="{StaticResource SettingItemMargin}" Margin="{StaticResource Margin8}"
IsEditable="True" IsEditable="True"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
</StackPanel> </StackPanel>
</WrapPanel> </WrapPanel>
<Grid Margin="{StaticResource SettingItemMargin}"> <Grid Margin="{StaticResource Margin8}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" /> <ColumnDefinition Width="1*" />
<ColumnDefinition Width="10" /> <ColumnDefinition Width="10" />

View file

@ -23,16 +23,16 @@
TextElement.Foreground="{DynamicResource MaterialDesignBody}" TextElement.Foreground="{DynamicResource MaterialDesignBody}"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<DockPanel Margin="8"> <DockPanel Margin="{StaticResource Margin8}">
<StackPanel <StackPanel
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Center" HorizontalAlignment="Center"
DockPanel.Dock="Bottom" DockPanel.Dock="Bottom"
Orientation="Horizontal"> Orientation="Horizontal">
<Button <Button
x:Name="btnReset" x:Name="btnReset"
Width="100" Width="100"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
Content="{x:Static resx:ResUI.TbReset}" Content="{x:Static resx:ResUI.TbReset}"
Style="{StaticResource DefButton}" /> Style="{StaticResource DefButton}" />
<Button <Button
@ -44,7 +44,7 @@
<Button <Button
x:Name="btnCancel" x:Name="btnCancel"
Width="100" Width="100"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
Content="{x:Static resx:ResUI.TbCancel}" Content="{x:Static resx:ResUI.TbCancel}"
Cursor="Hand" Cursor="Hand"
IsCancel="true" IsCancel="true"
@ -77,14 +77,14 @@
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
Style="{StaticResource ModuleTitle}" Style="{StaticResource ModuleTitle}"
Text="{x:Static resx:ResUI.TbGlobalHotkeySetting}" /> Text="{x:Static resx:ResUI.TbGlobalHotkeySetting}" />
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbDisplayGUI}" /> Text="{x:Static resx:ResUI.TbDisplayGUI}" />
@ -93,7 +93,7 @@
x:Name="txtGlobalHotkey0" x:Name="txtGlobalHotkey0"
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Top" VerticalAlignment="Top"
AcceptsReturn="True" AcceptsReturn="True"
IsReadOnly="True" IsReadOnly="True"
@ -103,7 +103,7 @@
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbClearSystemProxy}" /> Text="{x:Static resx:ResUI.TbClearSystemProxy}" />
@ -111,7 +111,7 @@
x:Name="txtGlobalHotkey1" x:Name="txtGlobalHotkey1"
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Top" VerticalAlignment="Top"
AcceptsReturn="True" AcceptsReturn="True"
IsReadOnly="True" IsReadOnly="True"
@ -121,7 +121,7 @@
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSetSystemProxy}" /> Text="{x:Static resx:ResUI.TbSetSystemProxy}" />
@ -129,7 +129,7 @@
x:Name="txtGlobalHotkey2" x:Name="txtGlobalHotkey2"
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Top" VerticalAlignment="Top"
AcceptsReturn="True" AcceptsReturn="True"
IsReadOnly="True" IsReadOnly="True"
@ -138,7 +138,7 @@
<TextBlock <TextBlock
Grid.Row="4" Grid.Row="4"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbNotChangeSystemProxy}" /> Text="{x:Static resx:ResUI.TbNotChangeSystemProxy}" />
@ -146,7 +146,7 @@
x:Name="txtGlobalHotkey3" x:Name="txtGlobalHotkey3"
Grid.Row="4" Grid.Row="4"
Grid.Column="1" Grid.Column="1"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Top" VerticalAlignment="Top"
AcceptsReturn="True" AcceptsReturn="True"
IsReadOnly="True" IsReadOnly="True"
@ -155,7 +155,7 @@
<TextBlock <TextBlock
Grid.Row="5" Grid.Row="5"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSystemProxyPac}" /> Text="{x:Static resx:ResUI.TbSystemProxyPac}" />
@ -163,7 +163,7 @@
x:Name="txtGlobalHotkey4" x:Name="txtGlobalHotkey4"
Grid.Row="5" Grid.Row="5"
Grid.Column="1" Grid.Column="1"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Top" VerticalAlignment="Top"
AcceptsReturn="True" AcceptsReturn="True"
IsReadOnly="True" IsReadOnly="True"
@ -173,7 +173,7 @@
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbGlobalHotkeySettingTip}" /> Text="{x:Static resx:ResUI.TbGlobalHotkeySettingTip}" />

View file

@ -50,7 +50,7 @@
<MenuItem.Header> <MenuItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="Server" /> Kind="Server" />
<TextBlock Text="{x:Static resx:ResUI.menuServers}" /> <TextBlock Text="{x:Static resx:ResUI.menuServers}" />
@ -114,7 +114,7 @@
<MenuItem.Header> <MenuItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="BookClockOutline" /> Kind="BookClockOutline" />
<TextBlock Text="{x:Static resx:ResUI.menuSubscription}" /> <TextBlock Text="{x:Static resx:ResUI.menuSubscription}" />
@ -149,7 +149,7 @@
<MenuItem.Header> <MenuItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="SettingsOutline" /> Kind="SettingsOutline" />
<TextBlock Text="{x:Static resx:ResUI.menuSetting}" /> <TextBlock Text="{x:Static resx:ResUI.menuSetting}" />
@ -201,7 +201,7 @@
<MenuItem.Header> <MenuItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="Reload" /> Kind="Reload" />
<TextBlock Text="{x:Static resx:ResUI.menuReload}" /> <TextBlock Text="{x:Static resx:ResUI.menuReload}" />
@ -215,7 +215,7 @@
<MenuItem.Header> <MenuItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="Update" /> Kind="Update" />
<TextBlock Text="{x:Static resx:ResUI.menuCheckUpdate}" /> <TextBlock Text="{x:Static resx:ResUI.menuCheckUpdate}" />
@ -229,7 +229,7 @@
<MenuItem.Header> <MenuItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="HelpCircleOutline" /> Kind="HelpCircleOutline" />
<TextBlock Text="{x:Static resx:ResUI.menuHelp}" /> <TextBlock Text="{x:Static resx:ResUI.menuHelp}" />
@ -243,7 +243,7 @@
<MenuItem.Header> <MenuItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="VolumeHigh" /> Kind="VolumeHigh" />
<TextBlock Text="{x:Static resx:ResUI.menuPromotion}" /> <TextBlock Text="{x:Static resx:ResUI.menuPromotion}" />
@ -257,7 +257,7 @@
<MenuItem.Header> <MenuItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="Minimize" /> Kind="Minimize" />
<TextBlock Text="{x:Static resx:ResUI.menuClose}" /> <TextBlock Text="{x:Static resx:ResUI.menuClose}" />
@ -313,11 +313,7 @@
<TabItem x:Name="tabMsgView1"> <TabItem x:Name="tabMsgView1">
<TabItem.Header> <TabItem.Header>
<StackPanel> <StackPanel>
<materialDesign:PackIcon <materialDesign:PackIcon HorizontalAlignment="Center" Kind="MessageTextOutline" />
Width="24"
Height="24"
HorizontalAlignment="Center"
Kind="MessageTextOutline" />
<TextBlock <TextBlock
HorizontalAlignment="Center" HorizontalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
@ -328,11 +324,7 @@
<TabItem x:Name="tabClashProxies1"> <TabItem x:Name="tabClashProxies1">
<TabItem.Header> <TabItem.Header>
<StackPanel> <StackPanel>
<materialDesign:PackIcon <materialDesign:PackIcon HorizontalAlignment="Center" Kind="ArrowDecisionOutline" />
Width="24"
Height="24"
HorizontalAlignment="Center"
Kind="ArrowDecisionOutline" />
<TextBlock <TextBlock
HorizontalAlignment="Center" HorizontalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
@ -343,11 +335,7 @@
<TabItem x:Name="tabClashConnections1"> <TabItem x:Name="tabClashConnections1">
<TabItem.Header> <TabItem.Header>
<StackPanel> <StackPanel>
<materialDesign:PackIcon <materialDesign:PackIcon HorizontalAlignment="Center" Kind="LanConnect" />
Width="24"
Height="24"
HorizontalAlignment="Center"
Kind="LanConnect" />
<TextBlock <TextBlock
HorizontalAlignment="Center" HorizontalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
@ -366,11 +354,7 @@
<TabItem x:Name="tabProfiles2"> <TabItem x:Name="tabProfiles2">
<TabItem.Header> <TabItem.Header>
<StackPanel> <StackPanel>
<materialDesign:PackIcon <materialDesign:PackIcon HorizontalAlignment="Center" Kind="Server" />
Width="24"
Height="24"
HorizontalAlignment="Center"
Kind="Server" />
<TextBlock <TextBlock
HorizontalAlignment="Center" HorizontalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
@ -381,11 +365,7 @@
<TabItem x:Name="tabMsgView2"> <TabItem x:Name="tabMsgView2">
<TabItem.Header> <TabItem.Header>
<StackPanel> <StackPanel>
<materialDesign:PackIcon <materialDesign:PackIcon HorizontalAlignment="Center" Kind="MessageTextOutline" />
Width="24"
Height="24"
HorizontalAlignment="Center"
Kind="MessageTextOutline" />
<TextBlock <TextBlock
HorizontalAlignment="Center" HorizontalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
@ -396,11 +376,7 @@
<TabItem x:Name="tabClashProxies2"> <TabItem x:Name="tabClashProxies2">
<TabItem.Header> <TabItem.Header>
<StackPanel> <StackPanel>
<materialDesign:PackIcon <materialDesign:PackIcon HorizontalAlignment="Center" Kind="ArrowDecisionOutline" />
Width="24"
Height="24"
HorizontalAlignment="Center"
Kind="ArrowDecisionOutline" />
<TextBlock <TextBlock
HorizontalAlignment="Center" HorizontalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
@ -411,11 +387,7 @@
<TabItem x:Name="tabClashConnections2"> <TabItem x:Name="tabClashConnections2">
<TabItem.Header> <TabItem.Header>
<StackPanel> <StackPanel>
<materialDesign:PackIcon <materialDesign:PackIcon HorizontalAlignment="Center" Kind="LanConnect" />
Width="24"
Height="24"
HorizontalAlignment="Center"
Kind="LanConnect" />
<TextBlock <TextBlock
HorizontalAlignment="Center" HorizontalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"

View file

@ -41,26 +41,29 @@ namespace v2rayN.Views
Locator.CurrentMutable.RegisterLazySingleton(() => ViewModel, typeof(MainWindowViewModel)); Locator.CurrentMutable.RegisterLazySingleton(() => ViewModel, typeof(MainWindowViewModel));
WindowsHandler.Instance.RegisterGlobalHotkey(_config, OnHotkeyHandler, null); WindowsHandler.Instance.RegisterGlobalHotkey(_config, OnHotkeyHandler, null);
if (_config.uiItem.mainGirdOrientation == EGirdOrientation.Horizontal) switch (_config.uiItem.mainGirdOrientation)
{ {
tabProfiles.Content ??= new ProfilesView(); case EGirdOrientation.Horizontal:
tabMsgView.Content ??= new MsgView(); tabProfiles.Content ??= new ProfilesView();
tabClashProxies.Content ??= new ClashProxiesView(); tabMsgView.Content ??= new MsgView();
tabClashConnections.Content ??= new ClashConnectionsView(); tabClashProxies.Content ??= new ClashProxiesView();
} tabClashConnections.Content ??= new ClashConnectionsView();
else if (_config.uiItem.mainGirdOrientation == EGirdOrientation.Vertical) break;
{
tabProfiles1.Content ??= new ProfilesView(); case EGirdOrientation.Vertical:
tabMsgView1.Content ??= new MsgView(); tabProfiles1.Content ??= new ProfilesView();
tabClashProxies1.Content ??= new ClashProxiesView(); tabMsgView1.Content ??= new MsgView();
tabClashConnections1.Content ??= new ClashConnectionsView(); tabClashProxies1.Content ??= new ClashProxiesView();
} tabClashConnections1.Content ??= new ClashConnectionsView();
else break;
{
tabProfiles2.Content ??= new ProfilesView(); case EGirdOrientation.Tab:
tabMsgView2.Content ??= new MsgView(); default:
tabClashProxies2.Content ??= new ClashProxiesView(); tabProfiles2.Content ??= new ProfilesView();
tabClashConnections2.Content ??= new ClashConnectionsView(); tabMsgView2.Content ??= new MsgView();
tabClashProxies2.Content ??= new ClashProxiesView();
tabClashConnections2.Content ??= new ClashConnectionsView();
break;
} }
pbTheme.Content ??= new ThemeSettingView(); pbTheme.Content ??= new ThemeSettingView();
@ -99,30 +102,35 @@ namespace v2rayN.Views
this.BindCommand(ViewModel, vm => vm.ReloadCmd, v => v.menuReload).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.ReloadCmd, v => v.menuReload).DisposeWith(disposables);
this.OneWayBind(ViewModel, vm => vm.BlReloadEnabled, v => v.menuReload.IsEnabled).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.BlReloadEnabled, v => v.menuReload.IsEnabled).DisposeWith(disposables);
if (_config.uiItem.mainGirdOrientation == EGirdOrientation.Horizontal) switch (_config.uiItem.mainGirdOrientation)
{ {
gridMain.Visibility = Visibility.Visible; case EGirdOrientation.Horizontal:
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashProxies.Visibility).DisposeWith(disposables); gridMain.Visibility = Visibility.Visible;
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashConnections.Visibility).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabMsgView.Visibility).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.TabMainSelectedIndex, v => v.tabMain.SelectedIndex).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashProxies.Visibility).DisposeWith(disposables);
} this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashConnections.Visibility).DisposeWith(disposables);
else if (_config.uiItem.mainGirdOrientation == EGirdOrientation.Vertical) this.Bind(ViewModel, vm => vm.TabMainSelectedIndex, v => v.tabMain.SelectedIndex).DisposeWith(disposables);
{ break;
gridMain1.Visibility = Visibility.Visible;
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashProxies1.Visibility).DisposeWith(disposables); case EGirdOrientation.Vertical:
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashConnections1.Visibility).DisposeWith(disposables); gridMain1.Visibility = Visibility.Visible;
this.Bind(ViewModel, vm => vm.TabMainSelectedIndex, v => v.tabMain1.SelectedIndex).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabMsgView1.Visibility).DisposeWith(disposables);
} this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashProxies1.Visibility).DisposeWith(disposables);
else this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashConnections1.Visibility).DisposeWith(disposables);
{ this.Bind(ViewModel, vm => vm.TabMainSelectedIndex, v => v.tabMain1.SelectedIndex).DisposeWith(disposables);
gridMain2.Visibility = Visibility.Visible; break;
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashProxies2.Visibility).DisposeWith(disposables);
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashConnections2.Visibility).DisposeWith(disposables); case EGirdOrientation.Tab:
this.Bind(ViewModel, vm => vm.TabMainSelectedIndex, v => v.tabMain2.SelectedIndex).DisposeWith(disposables); default:
gridMain2.Visibility = Visibility.Visible;
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashProxies2.Visibility).DisposeWith(disposables);
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashConnections2.Visibility).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.TabMainSelectedIndex, v => v.tabMain2.SelectedIndex).DisposeWith(disposables);
break;
} }
}); });
this.Title = $"{Utils.GetVersion()} - {(Utils.IsAdministrator() ? ResUI.RunAsAdmin : ResUI.NotRunAsAdmin)}"; this.Title = $"{Utils.GetVersion()} - {(AppHandler.Instance.IsAdministrator ? ResUI.RunAsAdmin : ResUI.NotRunAsAdmin)}";
if (!_config.guiItem.enableHWA) if (!_config.guiItem.enableHWA)
{ {

View file

@ -13,9 +13,9 @@
x:TypeArguments="vms:MsgViewModel" x:TypeArguments="vms:MsgViewModel"
Style="{StaticResource ViewGlobal}" Style="{StaticResource ViewGlobal}"
mc:Ignorable="d"> mc:Ignorable="d">
<DockPanel Margin="2"> <DockPanel Margin="{StaticResource Margin4}">
<WrapPanel <WrapPanel
Margin="8" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
DockPanel.Dock="Top" DockPanel.Dock="Top"
Orientation="Horizontal"> Orientation="Horizontal">
@ -23,7 +23,7 @@
<ComboBox <ComboBox
x:Name="cmbMsgFilter" x:Name="cmbMsgFilter"
Width="200" Width="200"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.MsgFilterTitle}" materialDesign:HintAssist.Hint="{x:Static resx:ResUI.MsgFilterTitle}"
materialDesign:TextFieldAssist.HasClearButton="True" materialDesign:TextFieldAssist.HasClearButton="True"
IsEditable="True" IsEditable="True"
@ -32,7 +32,7 @@
x:Name="btnCopy" x:Name="btnCopy"
Width="24" Width="24"
Height="24" Height="24"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
ToolTip="{x:Static resx:ResUI.menuMsgViewCopyAll}"> ToolTip="{x:Static resx:ResUI.menuMsgViewCopyAll}">
<materialDesign:PackIcon VerticalAlignment="Center" Kind="ContentCopy" /> <materialDesign:PackIcon VerticalAlignment="Center" Kind="ContentCopy" />
@ -41,29 +41,29 @@
x:Name="btnClear" x:Name="btnClear"
Width="24" Width="24"
Height="24" Height="24"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
ToolTip="{x:Static resx:ResUI.menuMsgViewClear}"> ToolTip="{x:Static resx:ResUI.menuMsgViewClear}">
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Delete" /> <materialDesign:PackIcon VerticalAlignment="Center" Kind="Delete" />
</Button> </Button>
<TextBlock <TextBlock
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbAutoRefresh}" /> Text="{x:Static resx:ResUI.TbAutoRefresh}" />
<ToggleButton <ToggleButton
x:Name="togAutoRefresh" x:Name="togAutoRefresh"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
IsChecked="True" /> IsChecked="True" />
<TextBlock <TextBlock
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbAutoScrollToEnd}" /> Text="{x:Static resx:ResUI.TbAutoScrollToEnd}" />
<ToggleButton <ToggleButton
x:Name="togScrollToEnd" x:Name="togScrollToEnd"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
IsChecked="True" /> IsChecked="True" />
</WrapPanel> </WrapPanel>

File diff suppressed because it is too large Load diff

View file

@ -21,7 +21,7 @@
</UserControl.Resources> </UserControl.Resources>
<Grid> <Grid>
<DockPanel> <DockPanel>
<WrapPanel Margin="2" DockPanel.Dock="Top"> <WrapPanel Margin="{StaticResource Margin4}" DockPanel.Dock="Top">
<ListBox <ListBox
x:Name="lstGroup" x:Name="lstGroup"
MaxHeight="200" MaxHeight="200"
@ -39,7 +39,7 @@
x:Name="btnEditSub" x:Name="btnEditSub"
Width="30" Width="30"
Height="30" Height="30"
Margin="4,0" Margin="{StaticResource MarginLeftRight4}"
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
ToolTip="{x:Static resx:ResUI.menuSubEdit}"> ToolTip="{x:Static resx:ResUI.menuSubEdit}">
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Edit" /> <materialDesign:PackIcon VerticalAlignment="Center" Kind="Edit" />
@ -48,7 +48,7 @@
x:Name="btnAddSub" x:Name="btnAddSub"
Width="30" Width="30"
Height="30" Height="30"
Margin="4,0" Margin="{StaticResource MarginLeftRight4}"
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
ToolTip="{x:Static resx:ResUI.menuSubAdd}"> ToolTip="{x:Static resx:ResUI.menuSubAdd}">
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Plus" /> <materialDesign:PackIcon VerticalAlignment="Center" Kind="Plus" />
@ -58,7 +58,7 @@
x:Name="btnAutofitColumnWidth" x:Name="btnAutofitColumnWidth"
Width="30" Width="30"
Height="30" Height="30"
Margin="20,0" Margin="{StaticResource MarginLeftRight8}"
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
ToolTip="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}"> ToolTip="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}">
<materialDesign:PackIcon VerticalAlignment="Center" Kind="ArrowSplitVertical" /> <materialDesign:PackIcon VerticalAlignment="Center" Kind="ArrowSplitVertical" />
@ -66,7 +66,7 @@
<TextBox <TextBox
x:Name="txtServerFilter" x:Name="txtServerFilter"
Width="200" Width="200"
Margin="4,0" Margin="{StaticResource MarginLeftRight4}"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.MsgServerTitle}" materialDesign:HintAssist.Hint="{x:Static resx:ResUI.MsgServerTitle}"
materialDesign:TextFieldAssist.HasClearButton="True" materialDesign:TextFieldAssist.HasClearButton="True"

View file

@ -10,7 +10,7 @@
d:DesignWidth="300" d:DesignWidth="300"
Style="{StaticResource ViewGlobal}" Style="{StaticResource ViewGlobal}"
mc:Ignorable="d"> mc:Ignorable="d">
<Grid Margin="30"> <Grid Margin="32">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@ -38,7 +38,7 @@
<Button <Button
Grid.Row="2" Grid.Row="2"
Width="100" Width="100"
Margin="8" Margin="{StaticResource Margin8}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
Content="{x:Static resx:ResUI.TbConfirm}" Content="{x:Static resx:ResUI.TbConfirm}"

View file

@ -23,7 +23,7 @@
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<DockPanel> <DockPanel>
<Grid Margin="8" DockPanel.Dock="Top"> <Grid Margin="{StaticResource Margin8}" DockPanel.Dock="Top">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@ -41,7 +41,7 @@
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvRemarks}" /> Text="{x:Static resx:ResUI.LvRemarks}" />
@ -50,20 +50,20 @@
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<ToggleButton <ToggleButton
x:Name="togEnabled" x:Name="togEnabled"
Grid.Row="0" Grid.Row="0"
Grid.Column="2" Grid.Column="2"
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="outboundTag" /> Text="outboundTag" />
@ -72,13 +72,13 @@
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="4" Margin="{StaticResource Margin4}"
MaxDropDownHeight="1000" MaxDropDownHeight="1000"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="2" Grid.Column="2"
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbRuleMatchingTips}" /> Text="{x:Static resx:ResUI.TbRuleMatchingTips}" />
@ -86,7 +86,7 @@
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="port" /> Text="port" />
@ -95,13 +95,13 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.Column="2" Grid.Column="2"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"> Style="{StaticResource ToolbarTextBlock}">
<Hyperlink Click="linkRuleobjectDoc_Click"> <Hyperlink Click="linkRuleobjectDoc_Click">
@ -113,7 +113,7 @@
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="protocol" /> Text="protocol" />
@ -121,7 +121,7 @@
x:Name="clbProtocol" x:Name="clbProtocol"
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
FontSize="{DynamicResource StdFontSize}" FontSize="{DynamicResource StdFontSize}"
Style="{StaticResource MaterialDesignFilterChipPrimaryListBox}" /> Style="{StaticResource MaterialDesignFilterChipPrimaryListBox}" />
@ -129,7 +129,7 @@
<TextBlock <TextBlock
Grid.Row="4" Grid.Row="4"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="inboundTag" /> Text="inboundTag" />
@ -137,14 +137,14 @@
x:Name="clbInboundTag" x:Name="clbInboundTag"
Grid.Row="4" Grid.Row="4"
Grid.Column="1" Grid.Column="1"
Margin="4" Margin="{StaticResource Margin4}"
FontSize="{DynamicResource StdFontSize}" FontSize="{DynamicResource StdFontSize}"
Style="{StaticResource MaterialDesignFilterChipPrimaryListBox}" /> Style="{StaticResource MaterialDesignFilterChipPrimaryListBox}" />
<TextBlock <TextBlock
Grid.Row="5" Grid.Row="5"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="network" /> Text="network" />
@ -153,21 +153,21 @@
Grid.Row="5" Grid.Row="5"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="4" Margin="{StaticResource Margin4}"
MaxDropDownHeight="1000" MaxDropDownHeight="1000"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
<TextBlock <TextBlock
Grid.Row="5" Grid.Row="5"
Grid.Column="2" Grid.Column="2"
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbRoutingTips}" /> Text="{x:Static resx:ResUI.TbRoutingTips}" />
</Grid> </Grid>
<StackPanel <StackPanel
Margin="8" Margin="{StaticResource Margin8}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
DockPanel.Dock="Bottom" DockPanel.Dock="Bottom"
Orientation="Horizontal"> Orientation="Horizontal">
@ -188,14 +188,14 @@
<Button <Button
x:Name="btnCancel" x:Name="btnCancel"
Width="100" Width="100"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
Content="{x:Static resx:ResUI.TbCancel}" Content="{x:Static resx:ResUI.TbCancel}"
Cursor="Hand" Cursor="Hand"
IsCancel="true" IsCancel="true"
Style="{StaticResource DefButton}" /> Style="{StaticResource DefButton}" />
</StackPanel> </StackPanel>
<Grid Margin="{StaticResource SettingItemMargin}"> <Grid Margin="{StaticResource Margin8}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" /> <ColumnDefinition Width="1*" />
<ColumnDefinition Width="10" /> <ColumnDefinition Width="10" />

View file

@ -32,7 +32,7 @@
<Button x:Name="menuRuleAdd"> <Button x:Name="menuRuleAdd">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="Plus" /> Kind="Plus" />
<TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.menuRuleAdd}" /> <TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.menuRuleAdd}" />
@ -42,7 +42,7 @@
<Button x:Name="menuImportRulesFromFile"> <Button x:Name="menuImportRulesFromFile">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="Import" /> Kind="Import" />
<TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.menuImportRulesFromFile}" /> <TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.menuImportRulesFromFile}" />
@ -52,7 +52,7 @@
<Button x:Name="menuImportRulesFromClipboard"> <Button x:Name="menuImportRulesFromClipboard">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="Import" /> Kind="Import" />
<TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.menuImportRulesFromClipboard}" /> <TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.menuImportRulesFromClipboard}" />
@ -62,7 +62,7 @@
<Button x:Name="menuImportRulesFromUrl"> <Button x:Name="menuImportRulesFromUrl">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="Import" /> Kind="Import" />
<TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.menuImportRulesFromUrl}" /> <TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.menuImportRulesFromUrl}" />
@ -72,7 +72,7 @@
</ToolBarTray> </ToolBarTray>
<StackPanel <StackPanel
Margin="8" Margin="{StaticResource Margin8}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
DockPanel.Dock="Bottom" DockPanel.Dock="Bottom"
Orientation="Horizontal"> Orientation="Horizontal">
@ -85,14 +85,14 @@
<Button <Button
x:Name="btnCancel" x:Name="btnCancel"
Width="100" Width="100"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
Content="{x:Static resx:ResUI.TbCancel}" Content="{x:Static resx:ResUI.TbCancel}"
Cursor="Hand" Cursor="Hand"
IsCancel="true" IsCancel="true"
Style="{StaticResource DefButton}" /> Style="{StaticResource DefButton}" />
</StackPanel> </StackPanel>
<Grid Margin="8" DockPanel.Dock="Top"> <Grid Margin="{StaticResource Margin8}" DockPanel.Dock="Top">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@ -109,7 +109,7 @@
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvRemarks}" /> Text="{x:Static resx:ResUI.LvRemarks}" />
@ -123,7 +123,7 @@
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Width="300" Width="300"
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Top" VerticalAlignment="Top"
AcceptsReturn="True" AcceptsReturn="True"
@ -131,14 +131,14 @@
TextWrapping="Wrap" /> TextWrapping="Wrap" />
<TextBlock <TextBlock
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvSort}" /> Text="{x:Static resx:ResUI.LvSort}" />
<TextBox <TextBox
x:Name="txtSort" x:Name="txtSort"
Width="100" Width="100"
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
AcceptsReturn="True" AcceptsReturn="True"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
@ -147,7 +147,7 @@
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbdomainStrategy}" /> Text="{x:Static resx:ResUI.TbdomainStrategy}" />
@ -158,24 +158,24 @@
<ComboBox <ComboBox
x:Name="cmbdomainStrategy" x:Name="cmbdomainStrategy"
Width="200" Width="200"
Margin="4" Margin="{StaticResource Margin4}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
<TextBlock <TextBlock
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbdomainStrategy4Singbox}" /> Text="{x:Static resx:ResUI.TbdomainStrategy4Singbox}" />
<ComboBox <ComboBox
x:Name="cmbdomainStrategy4Singbox" x:Name="cmbdomainStrategy4Singbox"
Width="200" Width="200"
Margin="4" Margin="{StaticResource Margin4}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
</StackPanel> </StackPanel>
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvUrl}" /> Text="{x:Static resx:ResUI.LvUrl}" />
@ -184,7 +184,7 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Width="600" Width="600"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Top" VerticalAlignment="Top"
AcceptsReturn="True" AcceptsReturn="True"
Style="{StaticResource DefTextBox}" Style="{StaticResource DefTextBox}"
@ -193,7 +193,7 @@
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvCustomIcon}" /> Text="{x:Static resx:ResUI.LvCustomIcon}" />
@ -202,7 +202,7 @@
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Width="600" Width="600"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Top" VerticalAlignment="Top"
AcceptsReturn="True" AcceptsReturn="True"
Style="{StaticResource DefTextBox}" Style="{StaticResource DefTextBox}"
@ -211,14 +211,14 @@
x:Name="btnBrowseCustomIcon" x:Name="btnBrowseCustomIcon"
Grid.Row="3" Grid.Row="3"
Grid.Column="2" Grid.Column="2"
Margin="2,0,8,0" Margin="{StaticResource MarginLeftRight4}"
Content="{x:Static resx:ResUI.TbBrowse}" Content="{x:Static resx:ResUI.TbBrowse}"
Style="{StaticResource DefButton}" /> Style="{StaticResource DefButton}" />
<TextBlock <TextBlock
Grid.Row="4" Grid.Row="4"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"> Style="{StaticResource ToolbarTextBlock}">
<Hyperlink Click="linkCustomRulesetPath4Singbox"> <Hyperlink Click="linkCustomRulesetPath4Singbox">
@ -231,7 +231,7 @@
Grid.Row="4" Grid.Row="4"
Grid.Column="1" Grid.Column="1"
Width="600" Width="600"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Top" VerticalAlignment="Top"
AcceptsReturn="True" AcceptsReturn="True"
Style="{StaticResource DefTextBox}" Style="{StaticResource DefTextBox}"
@ -240,7 +240,7 @@
x:Name="btnBrowseCustomRulesetPath4Singbox" x:Name="btnBrowseCustomRulesetPath4Singbox"
Grid.Row="4" Grid.Row="4"
Grid.Column="2" Grid.Column="2"
Margin="2,0,8,0" Margin="{StaticResource MarginLeftRight4}"
Content="{x:Static resx:ResUI.TbBrowse}" Content="{x:Static resx:ResUI.TbBrowse}"
Style="{StaticResource DefButton}" /> Style="{StaticResource DefButton}" />
</Grid> </Grid>

View file

@ -34,12 +34,12 @@
VerticalAlignment="Center" VerticalAlignment="Center"
ClipToBounds="True" ClipToBounds="True"
Style="{StaticResource MaterialDesignToolBar}"> Style="{StaticResource MaterialDesignToolBar}">
<Menu Margin="0,8" Style="{StaticResource ToolbarMenu}"> <Menu Margin="0,1" Style="{StaticResource ToolbarMenu}">
<MenuItem x:Name="menuRoutingBasic" Padding="8,0"> <MenuItem x:Name="menuRoutingBasic" Padding="8,0">
<MenuItem.Header> <MenuItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="Server" /> Kind="Server" />
<TextBlock Text="{x:Static resx:ResUI.menuRoutingBasic}" /> <TextBlock Text="{x:Static resx:ResUI.menuRoutingBasic}" />
@ -51,12 +51,12 @@
Header="{x:Static resx:ResUI.menuRoutingBasicImportRules}" /> Header="{x:Static resx:ResUI.menuRoutingBasicImportRules}" />
</MenuItem> </MenuItem>
</Menu> </Menu>
<Menu Margin="0,8" Style="{StaticResource ToolbarMenu}"> <Menu Margin="0,1" Style="{StaticResource ToolbarMenu}">
<MenuItem x:Name="menuRoutingAdvanced" Padding="8,0"> <MenuItem x:Name="menuRoutingAdvanced" Padding="8,0">
<MenuItem.Header> <MenuItem.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="Routes" /> Kind="Routes" />
<TextBlock Text="{x:Static resx:ResUI.menuRoutingAdvanced}" /> <TextBlock Text="{x:Static resx:ResUI.menuRoutingAdvanced}" />
@ -74,17 +74,17 @@
</Menu> </Menu>
<Separator /> <Separator />
<TextBlock <TextBlock
Margin="8,0,0,0" Margin="{StaticResource MarginLeft8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbenableRoutingAdvanced}" /> Text="{x:Static resx:ResUI.TbenableRoutingAdvanced}" />
<ToggleButton <ToggleButton
x:Name="togenableRoutingAdvanced" x:Name="togenableRoutingAdvanced"
Margin="8,0,0,0" Margin="{StaticResource MarginLeft8}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
<Separator /> <Separator />
<TextBlock <TextBlock
Margin="8,0,0,0" Margin="{StaticResource MarginLeft8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"> Style="{StaticResource ToolbarTextBlock}">
<Hyperlink Click="linkdomainStrategy_Click"> <Hyperlink Click="linkdomainStrategy_Click">
@ -95,22 +95,22 @@
<ComboBox <ComboBox
x:Name="cmbdomainStrategy" x:Name="cmbdomainStrategy"
Width="110" Width="110"
Margin="8,0,0,0" Margin="{StaticResource MarginLeft8}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
<Separator /> <Separator />
<TextBlock <TextBlock
Margin="8,0,0,0" Margin="{StaticResource MarginLeft8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbdomainMatcher}" /> Text="{x:Static resx:ResUI.TbdomainMatcher}" />
<ComboBox <ComboBox
x:Name="cmbdomainMatcher" x:Name="cmbdomainMatcher"
Width="60" Width="60"
Margin="8,0,0,0" Margin="{StaticResource MarginLeft8}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
<Separator /> <Separator />
<TextBlock <TextBlock
Margin="8,0,0,0" Margin="{StaticResource MarginLeft8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"> Style="{StaticResource ToolbarTextBlock}">
<Hyperlink Click="linkdomainStrategy4Singbox_Click"> <Hyperlink Click="linkdomainStrategy4Singbox_Click">
@ -121,13 +121,13 @@
<ComboBox <ComboBox
x:Name="cmbdomainStrategy4Singbox" x:Name="cmbdomainStrategy4Singbox"
Width="100" Width="100"
Margin="8,0,0,0" Margin="{StaticResource MarginLeft8}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
</ToolBar> </ToolBar>
</ToolBarTray> </ToolBarTray>
<StackPanel <StackPanel
Margin="8" Margin="{StaticResource Margin8}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
DockPanel.Dock="Bottom" DockPanel.Dock="Bottom"
Orientation="Horizontal"> Orientation="Horizontal">
@ -146,7 +146,7 @@
<Button <Button
x:Name="btnCancel" x:Name="btnCancel"
Width="100" Width="100"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
Content="{x:Static resx:ResUI.TbCancel}" Content="{x:Static resx:ResUI.TbCancel}"
Cursor="Hand" Cursor="Hand"
IsCancel="true" IsCancel="true"
@ -158,7 +158,6 @@
<TabItem HorizontalAlignment="Left" Header="{x:Static resx:ResUI.TbRoutingTabRuleList}"> <TabItem HorizontalAlignment="Left" Header="{x:Static resx:ResUI.TbRoutingTabRuleList}">
<DataGrid <DataGrid
x:Name="lstRoutings" x:Name="lstRoutings"
Margin="2,0"
AutoGenerateColumns="False" AutoGenerateColumns="False"
BorderThickness="1" BorderThickness="1"
CanUserAddRows="False" CanUserAddRows="False"
@ -233,7 +232,7 @@
<TabControl x:Name="tabBasic"> <TabControl x:Name="tabBasic">
<TabItem Header="{x:Static resx:ResUI.TbRoutingTabProxy}"> <TabItem Header="{x:Static resx:ResUI.TbRoutingTabProxy}">
<Grid Margin="{StaticResource SettingItemMargin}"> <Grid Margin="{StaticResource Margin8}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" /> <ColumnDefinition Width="1*" />
<ColumnDefinition Width="10" /> <ColumnDefinition Width="10" />
@ -266,7 +265,7 @@
</TabItem> </TabItem>
<TabItem Header="{x:Static resx:ResUI.TbRoutingTabDirect}"> <TabItem Header="{x:Static resx:ResUI.TbRoutingTabDirect}">
<Grid Margin="{StaticResource SettingItemMargin}"> <Grid Margin="{StaticResource Margin8}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" /> <ColumnDefinition Width="1*" />
<ColumnDefinition Width="10" /> <ColumnDefinition Width="10" />
@ -299,7 +298,7 @@
</TabItem> </TabItem>
<TabItem Header="{x:Static resx:ResUI.TbRoutingTabBlock}"> <TabItem Header="{x:Static resx:ResUI.TbRoutingTabBlock}">
<Grid Margin="{StaticResource SettingItemMargin}"> <Grid Margin="{StaticResource Margin8}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" /> <ColumnDefinition Width="1*" />
<ColumnDefinition Width="10" /> <ColumnDefinition Width="10" />

View file

@ -18,46 +18,46 @@
<materialDesign:ColorZone Height="50" Mode="Standard"> <materialDesign:ColorZone Height="50" Mode="Standard">
<DockPanel> <DockPanel>
<StackPanel <StackPanel
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
DockPanel.Dock="Right"> DockPanel.Dock="Right">
<TextBlock x:Name="txtSpeedProxyDisplay" Style="{StaticResource StatusbarItem}" /> <TextBlock x:Name="txtSpeedProxyDisplay" Style="{StaticResource StatusbarItem}" />
<Border Margin="2" /> <Border Margin="{StaticResource Margin4}" />
<TextBlock x:Name="txtSpeedDirectDisplay" Style="{StaticResource StatusbarItem}" /> <TextBlock x:Name="txtSpeedDirectDisplay" Style="{StaticResource StatusbarItem}" />
</StackPanel> </StackPanel>
<StackPanel <StackPanel
Width="240" Width="240"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
DockPanel.Dock="Left"> DockPanel.Dock="Left">
<TextBlock x:Name="txtInboundDisplay" Style="{StaticResource StatusbarItem}" /> <TextBlock x:Name="txtInboundDisplay" Style="{StaticResource StatusbarItem}" />
<Border Margin="2" /> <Border Margin="{StaticResource Margin4}" />
<TextBlock x:Name="txtInboundLanDisplay" Style="{StaticResource StatusbarItem}" /> <TextBlock x:Name="txtInboundLanDisplay" Style="{StaticResource StatusbarItem}" />
</StackPanel> </StackPanel>
<StackPanel <StackPanel
x:Name="spEnableTun" x:Name="spEnableTun"
Width="auto" Width="auto"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
DockPanel.Dock="Left"> DockPanel.Dock="Left">
<TextBlock Text="{x:Static resx:ResUI.TbEnableTunAs}" /> <TextBlock Text="{x:Static resx:ResUI.TbEnableTunAs}" />
<ToggleButton <ToggleButton
x:Name="togEnableTun" x:Name="togEnableTun"
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
</StackPanel> </StackPanel>
<StackPanel <StackPanel
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
DockPanel.Dock="Left" DockPanel.Dock="Left"
Orientation="Horizontal"> Orientation="Horizontal">
<ComboBox <ComboBox
x:Name="cmbSystemProxy" x:Name="cmbSystemProxy"
Width="120" Width="120"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.menuSystemproxy}" materialDesign:HintAssist.Hint="{x:Static resx:ResUI.menuSystemproxy}"
FontSize="{DynamicResource StdFontSize}" FontSize="{DynamicResource StdFontSize}"
Style="{StaticResource MaterialDesignFloatingHintComboBox}"> Style="{StaticResource MaterialDesignFloatingHintComboBox}">
@ -70,16 +70,16 @@
<ComboBox <ComboBox
x:Name="cmbRoutings2" x:Name="cmbRoutings2"
Width="150" Width="150"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.menuRouting}" materialDesign:HintAssist.Hint="{x:Static resx:ResUI.menuRouting}"
DisplayMemberPath="remarks" DisplayMemberPath="remarks"
FontSize="{DynamicResource StdFontSize}" FontSize="{DynamicResource StdFontSize}"
Style="{StaticResource MaterialDesignFloatingHintComboBox}" /> Style="{StaticResource MaterialDesignFloatingHintComboBox}" />
</StackPanel> </StackPanel>
<StackPanel Margin="8,0" VerticalAlignment="Center"> <StackPanel Margin="{StaticResource MarginLeftRight8}" VerticalAlignment="Center">
<TextBlock x:Name="txtRunningServerDisplay" Style="{StaticResource StatusbarItem}" /> <TextBlock x:Name="txtRunningServerDisplay" Style="{StaticResource StatusbarItem}" />
<Border Margin="2" /> <Border Margin="{StaticResource Margin4}" />
<TextBlock x:Name="txtRunningInfoDisplay" Style="{StaticResource StatusbarItem}" /> <TextBlock x:Name="txtRunningInfoDisplay" Style="{StaticResource StatusbarItem}" />
</StackPanel> </StackPanel>
</DockPanel> </DockPanel>
@ -99,7 +99,7 @@
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
x:Name="menuSystemProxyClear2" x:Name="menuSystemProxyClear2"
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="Check" /> Kind="Check" />
<TextBlock Text="{x:Static resx:ResUI.menuSystemProxyClear}" /> <TextBlock Text="{x:Static resx:ResUI.menuSystemProxyClear}" />
@ -111,7 +111,7 @@
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
x:Name="menuSystemProxySet2" x:Name="menuSystemProxySet2"
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="Check" /> Kind="Check" />
<TextBlock Text="{x:Static resx:ResUI.menuSystemProxySet}" /> <TextBlock Text="{x:Static resx:ResUI.menuSystemProxySet}" />
@ -123,7 +123,7 @@
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
x:Name="menuSystemProxyNothing2" x:Name="menuSystemProxyNothing2"
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="Check" /> Kind="Check" />
<TextBlock Text="{x:Static resx:ResUI.menuSystemProxyNothing}" /> <TextBlock Text="{x:Static resx:ResUI.menuSystemProxyNothing}" />
@ -135,7 +135,7 @@
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
x:Name="menuSystemProxyPac2" x:Name="menuSystemProxyPac2"
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="Check" /> Kind="Check" />
<TextBlock Text="{x:Static resx:ResUI.menuSystemProxyPac}" /> <TextBlock Text="{x:Static resx:ResUI.menuSystemProxyPac}" />

View file

@ -29,9 +29,9 @@
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>
</Window.Resources> </Window.Resources>
<DockPanel Margin="8"> <DockPanel Margin="{StaticResource Margin8}">
<StackPanel <StackPanel
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Center" HorizontalAlignment="Center"
DockPanel.Dock="Bottom" DockPanel.Dock="Bottom"
Orientation="Horizontal"> Orientation="Horizontal">
@ -44,7 +44,7 @@
<Button <Button
x:Name="btnCancel" x:Name="btnCancel"
Width="100" Width="100"
Margin="8,0" Margin="{StaticResource MarginLeftRight8}"
Content="{x:Static resx:ResUI.TbCancel}" Content="{x:Static resx:ResUI.TbCancel}"
Cursor="Hand" Cursor="Hand"
IsCancel="true" IsCancel="true"
@ -79,14 +79,14 @@
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
Style="{StaticResource ModuleTitle}" Style="{StaticResource ModuleTitle}"
Text="{x:Static resx:ResUI.menuSubscription}" /> Text="{x:Static resx:ResUI.menuSubscription}" />
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvRemarks}" /> Text="{x:Static resx:ResUI.LvRemarks}" />
@ -95,7 +95,7 @@
x:Name="txtRemarks" x:Name="txtRemarks"
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Top" VerticalAlignment="Top"
AcceptsReturn="True" AcceptsReturn="True"
Style="{StaticResource MyOutlinedTextBox}" Style="{StaticResource MyOutlinedTextBox}"
@ -104,7 +104,7 @@
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvUrl}" /> Text="{x:Static resx:ResUI.LvUrl}" />
@ -112,7 +112,7 @@
x:Name="txtUrl" x:Name="txtUrl"
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Top" VerticalAlignment="Top"
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.SubUrlTips}" materialDesign:HintAssist.Hint="{x:Static resx:ResUI.SubUrlTips}"
AcceptsReturn="True" AcceptsReturn="True"
@ -127,14 +127,14 @@
Style="{StaticResource MaterialDesignToolForegroundPopupBox}"> Style="{StaticResource MaterialDesignToolForegroundPopupBox}">
<StackPanel> <StackPanel>
<TextBlock <TextBlock
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvMoreUrl}" /> Text="{x:Static resx:ResUI.LvMoreUrl}" />
<TextBox <TextBox
x:Name="txtMoreUrl" x:Name="txtMoreUrl"
Width="400" Width="400"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Top" VerticalAlignment="Top"
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.SubUrlTips}" materialDesign:HintAssist.Hint="{x:Static resx:ResUI.SubUrlTips}"
AcceptsReturn="True" AcceptsReturn="True"
@ -147,7 +147,7 @@
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvEnabled}" /> Text="{x:Static resx:ResUI.LvEnabled}" />
@ -155,17 +155,17 @@
<DockPanel <DockPanel
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Margin="4"> Margin="{StaticResource Margin4}">
<ToggleButton <ToggleButton
x:Name="togEnable" x:Name="togEnable"
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
DockPanel.Dock="Left" /> DockPanel.Dock="Left" />
<TextBox <TextBox
x:Name="txtAutoUpdateInterval" x:Name="txtAutoUpdateInterval"
Width="200" Width="200"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Top" VerticalAlignment="Top"
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.SubUrlTips}" materialDesign:HintAssist.Hint="{x:Static resx:ResUI.SubUrlTips}"
AcceptsReturn="True" AcceptsReturn="True"
@ -173,7 +173,7 @@
Style="{StaticResource MyOutlinedTextBox}" /> Style="{StaticResource MyOutlinedTextBox}" />
<TextBlock <TextBlock
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
@ -183,7 +183,7 @@
<TextBlock <TextBlock
Grid.Row="5" Grid.Row="5"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvFilter}" /> Text="{x:Static resx:ResUI.LvFilter}" />
@ -191,7 +191,7 @@
x:Name="txtFilter" x:Name="txtFilter"
Grid.Row="5" Grid.Row="5"
Grid.Column="1" Grid.Column="1"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Top" VerticalAlignment="Top"
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.SubUrlTips}" materialDesign:HintAssist.Hint="{x:Static resx:ResUI.SubUrlTips}"
AcceptsReturn="True" AcceptsReturn="True"
@ -200,7 +200,7 @@
<TextBlock <TextBlock
Grid.Row="6" Grid.Row="6"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvConvertTarget}" /> Text="{x:Static resx:ResUI.LvConvertTarget}" />
@ -208,7 +208,7 @@
x:Name="cmbConvertTarget" x:Name="cmbConvertTarget"
Grid.Row="6" Grid.Row="6"
Grid.Column="1" Grid.Column="1"
Margin="4" Margin="{StaticResource Margin4}"
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.LvConvertTargetTip}" materialDesign:HintAssist.Hint="{x:Static resx:ResUI.LvConvertTargetTip}"
MaxDropDownHeight="1000" MaxDropDownHeight="1000"
Style="{StaticResource MyOutlinedTextComboBox}" /> Style="{StaticResource MyOutlinedTextComboBox}" />
@ -216,14 +216,14 @@
<TextBlock <TextBlock
Grid.Row="7" Grid.Row="7"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="{x:Static resx:ResUI.LvUserAgent}" /> Text="{x:Static resx:ResUI.LvUserAgent}" />
<TextBox <TextBox
x:Name="txtUserAgent" x:Name="txtUserAgent"
Grid.Row="7" Grid.Row="7"
Grid.Column="1" Grid.Column="1"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Top" VerticalAlignment="Top"
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.SubUrlTips}" materialDesign:HintAssist.Hint="{x:Static resx:ResUI.SubUrlTips}"
AcceptsReturn="True" AcceptsReturn="True"
@ -233,7 +233,7 @@
<TextBlock <TextBlock
Grid.Row="8" Grid.Row="8"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvSort}" /> Text="{x:Static resx:ResUI.LvSort}" />
@ -242,7 +242,7 @@
Grid.Row="8" Grid.Row="8"
Grid.Column="1" Grid.Column="1"
Width="100" Width="100"
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Top" VerticalAlignment="Top"
AcceptsReturn="True" AcceptsReturn="True"
@ -251,7 +251,7 @@
<TextBlock <TextBlock
Grid.Row="9" Grid.Row="9"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvPrevProfile}" /> Text="{x:Static resx:ResUI.LvPrevProfile}" />
@ -259,7 +259,7 @@
x:Name="txtPrevProfile" x:Name="txtPrevProfile"
Grid.Row="9" Grid.Row="9"
Grid.Column="1" Grid.Column="1"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Top" VerticalAlignment="Top"
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.LvPrevProfileTip}" materialDesign:HintAssist.Hint="{x:Static resx:ResUI.LvPrevProfileTip}"
AcceptsReturn="True" AcceptsReturn="True"
@ -268,7 +268,7 @@
<TextBlock <TextBlock
Grid.Row="10" Grid.Row="10"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvNextProfile}" /> Text="{x:Static resx:ResUI.LvNextProfile}" />
@ -276,7 +276,7 @@
x:Name="txtNextProfile" x:Name="txtNextProfile"
Grid.Row="10" Grid.Row="10"
Grid.Column="1" Grid.Column="1"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Top" VerticalAlignment="Top"
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.LvPrevProfileTip}" materialDesign:HintAssist.Hint="{x:Static resx:ResUI.LvPrevProfileTip}"
AcceptsReturn="True" AcceptsReturn="True"
@ -285,7 +285,7 @@
<TextBlock <TextBlock
Grid.Row="11" Grid.Row="11"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="{StaticResource Margin4}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbPreSocksPort4Sub}" /> Text="{x:Static resx:ResUI.TbPreSocksPort4Sub}" />
@ -293,7 +293,7 @@
x:Name="txtPreSocksPort" x:Name="txtPreSocksPort"
Grid.Row="11" Grid.Row="11"
Grid.Column="1" Grid.Column="1"
Margin="4" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.TipPreSocksPort}" materialDesign:HintAssist.Hint="{x:Static resx:ResUI.TipPreSocksPort}"
AcceptsReturn="True" AcceptsReturn="True"

View file

@ -36,7 +36,7 @@
<Button x:Name="menuSubAdd"> <Button x:Name="menuSubAdd">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="Plus" /> Kind="Plus" />
<TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.menuSubAdd}" /> <TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.menuSubAdd}" />
@ -46,7 +46,7 @@
<Button x:Name="menuSubDelete"> <Button x:Name="menuSubDelete">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="Delete" /> Kind="Delete" />
<TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.menuSubDelete}" /> <TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.menuSubDelete}" />
@ -56,7 +56,7 @@
<Button x:Name="menuSubEdit"> <Button x:Name="menuSubEdit">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="Edit" /> Kind="Edit" />
<TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.menuSubEdit}" /> <TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.menuSubEdit}" />
@ -66,7 +66,7 @@
<Button x:Name="menuSubShare"> <Button x:Name="menuSubShare">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="QrcodePlus" /> Kind="QrcodePlus" />
<TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.menuSubShare}" /> <TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.menuSubShare}" />
@ -75,7 +75,7 @@
<Button x:Name="menuClose" IsCancel="True"> <Button x:Name="menuClose" IsCancel="True">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon <materialDesign:PackIcon
Margin="0,0,8,0" Margin="{StaticResource MarginRight8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Kind="Close" /> Kind="Close" />
<TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.menuClose}" /> <TextBlock Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.menuClose}" />

View file

@ -12,7 +12,7 @@
x:TypeArguments="vms:ThemeSettingViewModel" x:TypeArguments="vms:ThemeSettingViewModel"
Style="{StaticResource ViewGlobal}" Style="{StaticResource ViewGlobal}"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel Margin="8"> <StackPanel Margin="{StaticResource Margin8}">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@ -35,7 +35,7 @@
x:Name="togDarkMode" x:Name="togDarkMode"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Margin="8" /> Margin="{StaticResource Margin8}" />
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
@ -47,7 +47,7 @@
x:Name="followSystemTheme" x:Name="followSystemTheme"
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Margin="8" /> Margin="{StaticResource Margin8}" />
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
@ -60,7 +60,7 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Width="100" Width="100"
Margin="8" Margin="{StaticResource Margin8}"
DisplayMemberPath="Name" DisplayMemberPath="Name"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
@ -75,7 +75,7 @@
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Width="100" Width="100"
Margin="8" Margin="{StaticResource Margin8}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
<TextBlock <TextBlock
@ -89,7 +89,7 @@
Grid.Row="4" Grid.Row="4"
Grid.Column="1" Grid.Column="1"
Width="100" Width="100"
Margin="8" Margin="{StaticResource Margin8}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
</Grid> </Grid>
</StackPanel> </StackPanel>