void handle_SubmitSasProgramComplete(object sender, SubmitCompleteEventArgs args) { BeginInvoke(new MethodInvoker(delegate() { if (progressdlg != null && progressdlg.Visible) { progressdlg.Close(); progressdlg = null; } sasJobId = -1; if (args.Success) { AddCardinalities(); } Cursor.Current = _savedCursor; } )); }