/// <summary> /// Perform the background work. /// </summary> private void DoWork() { // Perform work try { var args = new DoWorkEventArgs(argument); worker.OnDoWork(args); result = args.Result; } catch (Exception ex) { error = ex; } // Invoke result handler resultHandler.SendEmptyMessage(0); }