public void AutoTest(AutoTestStartParameter parameter) { try { } finally { this.IsRunningTest = false; this.autoTestTask = null; this.cancellationSource = null; } }
public void StartAutoTest(AutoTestStartParameter parameter) { cancellationSource = CancellationTokenSource.CreateLinkedTokenSource(new CancellationToken(false)); this.autoTestTask = new Task(() => this.AutoTest(parameter), cancellationSource.Token); this.autoTestTask.Start(); }