private ModalTaskWindow(IModalTask InTask, string InTitle, string InMessage) { Task = InTask; Title = InTitle; Message = InMessage; InitializeComponent(); }
public static bool Execute(IModalTask Task, string InTitle, string InMessage, out string ErrorMessage) { ModalTaskWindow Window = new ModalTaskWindow(Task, InTitle, InMessage); Window.ShowDialog(); ErrorMessage = Window.ErrorMessage; return Window.bSucceeded; }
public static bool Execute(IModalTask Task, string InTitle, string InMessage, out string ErrorMessage) { ModalTaskWindow Window = new ModalTaskWindow(Task, InTitle, InMessage); Window.ShowDialog(); ErrorMessage = Window.ErrorMessage; return(Window.bSucceeded); }
public static ModalTaskResult Execute(IWin32Window Owner, IModalTask Task, string InTitle, string InMessage, out string ErrorMessage) { ModalTaskWindow Window = new ModalTaskWindow(Task, InTitle, InMessage, (Owner == null)? FormStartPosition.CenterScreen : FormStartPosition.CenterParent); Window.Complete += () => Window.Close(); Window.ShowDialog(Owner); ErrorMessage = Window.ErrorMessage; return(Window.Result); }
public ModalTaskWindow(IModalTask InTask, string InTitle, string InMessage, FormStartPosition InStartPosition) { InitializeComponent(); Task = InTask; Text = InTitle; MessageLabel.Text = InMessage; StartPosition = InStartPosition; SyncContext = SynchronizationContext.Current; BackgroundThread = new Thread(x => ThreadProc()); BackgroundThread.Start(); }
public static bool ExecuteAndShowError(IWin32Window Owner, IModalTask Task, string InTitle, string InMessage) { string ErrorMessage; ModalTaskResult Result = Execute(Owner, Task, InTitle, InMessage, out ErrorMessage); if (Result != ModalTaskResult.Succeeded) { if (!String.IsNullOrEmpty(ErrorMessage)) { MessageBox.Show(ErrorMessage); } return(false); } return(true); }