Пример #1
0
        /// <summary>
        /// Shows a wait window with the specified text while executing the passed method.
        /// </summary>
        /// <param name="workerMethod">Pointer to the method to execute while displaying the wait window.</param>
        /// <param name="message">The text to display.</param>
        /// <param name="args">Arguments to pass to the worker method.</param>
        /// <returns>The result argument from the worker method.</returns>
        public static object Show(EventHandler <WaitWindowEventArgs> workerMethod, string message, params object[] args)
        {
            List <object> arguments = new List <object>();

            arguments.AddRange(args);

            WaitWindow instance = new WaitWindow();

            return(instance.Show(workerMethod, message, arguments));
        }
Пример #2
0
        public WaitWindowGUI(WaitWindow parent)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            this._Parent = parent;

            //	Position the window in the top right of the main screen.
            this.Top  = Convert.ToInt32((Screen.PrimaryScreen.WorkingArea.Bottom - this.Height) / 2d);          // + 32;
            this.Left = Convert.ToInt32((Screen.PrimaryScreen.WorkingArea.Right - this.Width) / 2d);            // - 32;
        }
Пример #3
0
        /// <summary>
        /// Shows a wait window with the specified text while executing the passed method.
        /// </summary>
        /// <param name="workerMethod">Pointer to the method to execute while displaying the wait window.</param>
        /// <param name="message">The text to display.</param>
        /// <returns>The result argument from the worker method.</returns>
        public static object Show(EventHandler <WaitWindowEventArgs> workerMethod, string message)
        {
            WaitWindow instance = new WaitWindow();

            return(instance.Show(workerMethod, message, new List <object>()));
        }
Пример #4
0
 /// <summary>
 /// Shows a wait window with the text 'Please wait...' while executing the passed method.
 /// </summary>
 /// <param name="workerMethod">Pointer to the method to execute while displaying the wait window.</param>
 /// <returns>The result argument from the worker method.</returns>
 public static object Show(EventHandler <WaitWindowEventArgs> workerMethod)
 {
     return(WaitWindow.Show(workerMethod, null));
 }
Пример #5
0
 /// <summary>
 /// Initialises a new intance of the WaitWindowEventArgs class.
 /// </summary>
 /// <param name="GUI">The associated WaitWindow instance.</param>
 /// <param name="args">A list of arguments to be passed.</param>
 public WaitWindowEventArgs(WaitWindow GUI, List <object> args) : base()
 {
     this._Window    = GUI;
     this._Arguments = args;
 }