using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Media; using System.Text.RegularExpressions; namespace XFEToolBox.WpfCore.Controls; /// /// 统一展示图形化操作所对应的命令行,并提供一键复制。 /// 命令执行仍由调用方负责,本控件不会启动任何进程。 /// public partial class CommandPreviewBox : UserControl { private static readonly Regex CommandTokenPattern = new( "(?\\s+)|(?\"(?:\\\\.|[^\"\\\\])*\"|'(?:\\\\.|[^'\\\\])*')|" + "(?\\$\\{[^}]*\\}|\\$[A-Za-z_][A-Za-z0-9_]*|%[^%\\r\\n]+%)|" + "(?