mirror of
https://github.com/jie65535/GrasscutterCommandGenerator.git
synced 2025-06-07 22:59:14 +08:00
Add run log
This commit is contained in:
parent
740463f017
commit
b05269712a
@ -112,6 +112,7 @@ namespace GrasscutterTools.Forms
|
|||||||
RunCommands = RunCommands,
|
RunCommands = RunCommands,
|
||||||
GetCommand = () => CmbCommand.Text,
|
GetCommand = () => CmbCommand.Text,
|
||||||
Dock = DockStyle.Fill,
|
Dock = DockStyle.Fill,
|
||||||
|
Name = nameof(T)
|
||||||
};
|
};
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
@ -121,6 +122,7 @@ namespace GrasscutterTools.Forms
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void FormMain_Load(object sender, EventArgs e)
|
private void FormMain_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("FormMain_Load enter");
|
||||||
Text += " - by jie65535 - v" + Common.AppVersion.ToString(3);
|
Text += " - by jie65535 - v" + Common.AppVersion.ToString(3);
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
Text += "-debug";
|
Text += "-debug";
|
||||||
@ -134,9 +136,14 @@ namespace GrasscutterTools.Forms
|
|||||||
foreach (TabPage tp in TCMain.Controls)
|
foreach (TabPage tp in TCMain.Controls)
|
||||||
{
|
{
|
||||||
if (tp.Controls.Count > 0 && tp.Controls[0] is BasePage page)
|
if (tp.Controls.Count > 0 && tp.Controls[0] is BasePage page)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"{page.Name} OnLoad enter");
|
||||||
page.OnLoad();
|
page.OnLoad();
|
||||||
|
Console.WriteLine($"{page.Name} OnLoad completed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Console.WriteLine("FormMain_Load completed");
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 窗口关闭后触发
|
/// 窗口关闭后触发
|
||||||
@ -191,6 +198,7 @@ namespace GrasscutterTools.Forms
|
|||||||
/// <param name="command">命令</param>
|
/// <param name="command">命令</param>
|
||||||
private void SetCommand(string command)
|
private void SetCommand(string command)
|
||||||
{
|
{
|
||||||
|
Console.WriteLine($"SetCommand(\"{command}\")");
|
||||||
var oldCommand = CmbCommand.Text;
|
var oldCommand = CmbCommand.Text;
|
||||||
CmbCommand.Text = (ModifierKeys == Keys.Shift) ? $"{oldCommand} | {command}" : command;
|
CmbCommand.Text = (ModifierKeys == Keys.Shift) ? $"{oldCommand} | {command}" : command;
|
||||||
if (ChkAutoCopy.Checked)
|
if (ChkAutoCopy.Checked)
|
||||||
@ -329,12 +337,14 @@ namespace GrasscutterTools.Forms
|
|||||||
var cmd = command.TrimStart('/');
|
var cmd = command.TrimStart('/');
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("RunCommand:" + cmd);
|
||||||
var msg = await Common.OC.Invoke(cmd);
|
var msg = await Common.OC.Invoke(cmd);
|
||||||
TxtCommandRunLog.AppendText(string.IsNullOrEmpty(msg) ? "OK" : msg);
|
TxtCommandRunLog.AppendText(string.IsNullOrEmpty(msg) ? "OK" : msg);
|
||||||
TxtCommandRunLog.AppendText(Environment.NewLine);
|
TxtCommandRunLog.AppendText(Environment.NewLine);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("RunCommand Error:" + ex.ToString());
|
||||||
TxtCommandRunLog.AppendText("Error: ");
|
TxtCommandRunLog.AppendText("Error: ");
|
||||||
TxtCommandRunLog.AppendText(ex.Message);
|
TxtCommandRunLog.AppendText(ex.Message);
|
||||||
TxtCommandRunLog.AppendText(Environment.NewLine);
|
TxtCommandRunLog.AppendText(Environment.NewLine);
|
||||||
|
Loading…
Reference in New Issue
Block a user