private void DoWork() { GP.ExecuteSecure(() => Work(Cts.Token, (a) => Invoke(a), new Progress <ProgressMessage>(ProgressHandler))); Action update = Close; this.Invoke(update); }