protected void ExecuteOperation(OperatingContext Context, IProgressController pc, string Command, CancellationToken CancellationToken) { pc.SetProgress(0); Context.Surfer.SeekForMatches(Context.Terminal, CancellationToken, new CommandExpectation(@"SMDKC100 #", Context.Terminal, Command)); Context.Surfer.SeekForMatches(Context.Terminal, CancellationToken, new DelegateExpectation(@"Writing data at 0x([0-9a-fA-F]+) --\s+(?<progress>\d+)% complete\.", false, match => pc.SetProgress(0.01 * int.Parse(match.Groups["progress"].Value))), new DelegateExpectation(@"(?<length>\d+) bytes written\: (?<result>.+)\n", true, match => { if (match.Groups["result"].Value != "OK") throw new NandWriteErrorDnwBurningException(match.Groups["result"].Value); })); }