Skip to content

Commit 4dd7c1f

Browse files
committed
✨快捷设置网卡
1 parent 794e60c commit 4dd7c1f

File tree

9 files changed

+367
-168
lines changed

9 files changed

+367
-168
lines changed

Modules/Wu.CommTool.Modules.NetworkTool/GlobalUsings.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@
2121
global using Wu.ViewModels;
2222
global using Wu.Wpf.Common;
2323
global using Wu.Wpf.Extensions;
24+
global using Newtonsoft.Json;
25+
global using Microsoft.Win32;
26+
global using System.IO;

Modules/Wu.CommTool.Modules.NetworkTool/Models/ExecuteCmdResult.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ public ExecuteCmdResult(int exitCode, string message)
88
Message = message;
99
}
1010

11+
12+
1113
/// <summary>
1214
/// 状态 false失败 true成功
1315
/// </summary>
Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,39 @@
1-
namespace Wu.CommTool.Modules.NetworkTool.Models;
1+
using ImTools;
2+
using System.Linq;
3+
4+
namespace Wu.CommTool.Modules.NetworkTool.Models;
25

36
public partial class NetworkCardConfig : ObservableObject
47
{
8+
/// <summary>
9+
/// 配置名称
10+
/// </summary>
11+
[ObservableProperty]
12+
string configName = "";
13+
514
/// <summary>
615
/// Ipv4地址列表
716
/// </summary>
817
[ObservableProperty]
918
ObservableCollection<Ipv4> ipv4s = [];
19+
20+
21+
[RelayCommand]
22+
[property: JsonIgnore]
23+
public void DeleteLine(Ipv4 obj)
24+
{
25+
if (obj == null)
26+
return;
27+
if (Ipv4s.Contains(obj))
28+
{
29+
Ipv4s.Remove(obj);
30+
}
31+
}
32+
33+
[RelayCommand]
34+
[property: JsonIgnore]
35+
public void AddNewLine()
36+
{
37+
Ipv4s.Add(new Ipv4());
38+
}
1039
}

0 commit comments

Comments
 (0)