优化模式切换逻辑,更新控制台输出信息,调整 README.md 内容
This commit is contained in:
parent
c2a376d0c0
commit
2188920f58
|
@ -1,12 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection.Metadata;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using System.Text;
|
||||
namespace Debug;
|
||||
|
||||
public class ModeSwitch
|
||||
{
|
||||
public event Action<int>? Enter;
|
||||
|
@ -29,7 +22,7 @@ public class ModeSwitch
|
|||
private void Run()
|
||||
{
|
||||
Console.Clear();
|
||||
PrintCentered(title);
|
||||
PrintCentered("<--- " + title + " --->");
|
||||
int windowWidth = Console.WindowWidth;
|
||||
for (int i = 0; i < str.Length; i++)
|
||||
{
|
||||
|
|
10
Program.cs
10
Program.cs
|
@ -30,8 +30,8 @@ public class Program
|
|||
public Program()
|
||||
{
|
||||
Console.Clear();
|
||||
string[] str = ["抽卡", "搜索引擎", Music.title, "小龙快跑", "贪吃蛇"];
|
||||
var modeSwitch = new ModeSwitch("<--- 请选择你要执行的操作 --->", str, (a) =>
|
||||
string[] str = ["抽卡", "搜索引擎", Music.title, "小龙快跑", "贪吃蛇", "铁锈助手(联机模块)[未开发]"];
|
||||
var modeSwitch = new ModeSwitch("请选择你要执行的操作", str, (a) =>
|
||||
{
|
||||
switch (a)
|
||||
{
|
||||
|
@ -51,8 +51,12 @@ public class Program
|
|||
case 4:
|
||||
_ = new Tanchishe.Main();
|
||||
break;
|
||||
case 5:
|
||||
// _ = new Tanchishe.Main();
|
||||
_ = new Program();
|
||||
break;
|
||||
}
|
||||
}, "作者:MuQing \n使用语言:C# \n使用IDE:VS Code \n使用框架:.NET 8.0 \n项目地址:https://git.coldmint.top/muqing/ModelingMusicForm.git");
|
||||
}, "作者:MuQing\n使用语言:C#\n使用IDE:VS Code\n使用框架:.NET 8.0 \n测试运行平台:Windows11\n项目地址:https://git.coldmint.top/muqing/ModelingMusicForm.git");
|
||||
}
|
||||
public static void KeyEndThread()
|
||||
{
|
||||
|
|
24
README.md
24
README.md
|
@ -1,5 +1,6 @@
|
|||
# ModelingDebug
|
||||
### 一款C#的控制台程序
|
||||
# ModelingDebug
|
||||
|
||||
### C#-Net控制台程序
|
||||
## 功能
|
||||
1. 抽卡模拟器
|
||||
2. 文件/文件夹搜索
|
||||
|
@ -11,7 +12,9 @@
|
|||
可自由添加模块
|
||||
PgUp/W 上选择
|
||||
PgDn/S 下选择
|
||||
1···9快捷数字选择
|
||||
Enter(回车) 确定执行
|
||||
Esc 选择退出 Enter(回车) 返回选择器
|
||||
### 使用
|
||||
Visual Studio Code
|
||||
Visual Studio 2022
|
||||
|
@ -20,17 +23,17 @@
|
|||
var 变量 = new ModeSwitch("string", string[], (a) =>
|
||||
{
|
||||
//在这里处理选择逻辑
|
||||
});
|
||||
},"message");
|
||||
|
||||
### 例子
|
||||
string[] str = ["退出", "模块", "模块", "模块", "模块"];
|
||||
string[] str = ["模块", "模块", "模块", "模块"];
|
||||
var modeSwitch = new ModeSwitch("请选择你要执行的操作:", str, (a) =>
|
||||
{
|
||||
switch (a)
|
||||
{
|
||||
case 0:
|
||||
//需要执行的方法模块
|
||||
break;
|
||||
break;
|
||||
case 1:
|
||||
//需要执行的方法模块
|
||||
break;
|
||||
|
@ -49,13 +52,4 @@
|
|||
}
|
||||
});
|
||||
### 新增底部注意提醒词
|
||||
public ModeSwitch(string title, string[] a, Action<int> Enter, string message)
|
||||
### 输出
|
||||
```javascript
|
||||
<--- 请选择你要执行的操作 --->
|
||||
- << 退出 >> -
|
||||
- 模块 -
|
||||
- 模块 -
|
||||
- 模块 -
|
||||
- 模块 -
|
||||
------------------------------
|
||||
public ModeSwitch(string title, string[] a, Action<int> Enter, string message)
|
Loading…
Reference in New Issue
Block a user