private object Show(EventHandler <WaitWindowEventArgs> workerMethod, string message, List <object> args) { // Validate Parameters if (workerMethod == null) { throw new ArgumentException("No worker method has been specified.", "workerMethod"); } else { _WorkerMethod = workerMethod; } _Args = args; if (string.IsNullOrEmpty(message)) { message = "Please wait..."; } // Set up the window _GUI = new WaitWindowGUI(this); _GUI.MessageLabel.Text = message; // Call it _GUI.ShowDialog(); object result = _GUI._Result; // clean up Exception _Error = _GUI._Error; _GUI.Dispose(); // Return result or throw and exception if (_Error != null) { throw _Error; } else { return(result); } }
private object Show(EventHandler<WaitWindowEventArgs> workerMethod, string message, List<object> args){ // Validate Parameters if (workerMethod == null){ throw new ArgumentException("No worker method has been specified.", "workerMethod"); } else { _WorkerMethod = workerMethod; } _Args = args; if (string.IsNullOrEmpty(message)){ message = "Please wait..."; } // Set up the window _GUI = new WaitWindowGUI(this); _GUI.MessageLabel.Text = message; // Call it _GUI.ShowDialog(); object result = _GUI._Result; // clean up Exception _Error = _GUI._Error; _GUI.Dispose(); // Return result or throw and exception if (_Error != null){ throw _Error; } else { return result; } }