处理完成后调用子程序over,传参files为输出路径
去掉"是否打开文件夹"对话框,改为设置Quicker变量 files=输出文件路径、over=true,然后关闭窗口。 ScannerForm构造函数接收IStepContext用于变量传递。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -737,9 +737,11 @@ public class ScannerForm : Form
|
|||||||
|
|
||||||
private List<string> inputFiles = new List<string>();
|
private List<string> inputFiles = new List<string>();
|
||||||
private bool isPdfInput = false;
|
private bool isPdfInput = false;
|
||||||
|
private Quicker.Public.IStepContext _context;
|
||||||
|
|
||||||
public ScannerForm()
|
public ScannerForm(Quicker.Public.IStepContext context)
|
||||||
{
|
{
|
||||||
|
_context = context;
|
||||||
InitUI();
|
InitUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1040,13 +1042,10 @@ public class ScannerForm : Form
|
|||||||
|
|
||||||
lblStatus.Text = string.Format("完成!已保存: {0}", Path.GetFileName(outputPath));
|
lblStatus.Text = string.Format("完成!已保存: {0}", Path.GetFileName(outputPath));
|
||||||
|
|
||||||
DialogResult dr = MessageBox.Show(
|
// 调用子程序 "over",传参 files 为输出文件路径
|
||||||
string.Format("处理完成!共 {0} 页。\n\n是否打开所在目录?", results.Count),
|
_context.SetVarValue("files", outputPath);
|
||||||
"完成", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
|
_context.SetVarValue("over", true);
|
||||||
if (dr == DialogResult.Yes)
|
this.Close();
|
||||||
{
|
|
||||||
System.Diagnostics.Process.Start("explorer.exe", "/select," + outputPath);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -1128,7 +1127,7 @@ public static void Exec(Quicker.Public.IStepContext context)
|
|||||||
|
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
Application.Run(new ScannerForm());
|
Application.Run(new ScannerForm(context));
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("kernel32.dll", SetLastError = true)]
|
[DllImport("kernel32.dll", SetLastError = true)]
|
||||||
|
|||||||
Reference in New Issue
Block a user