/// <summary> /// Show wait form. Call it at times when UI thread will be unresponsible /// For now used 1. on Executing commands through the CommandManager /// 2. when creating and showing child forms /// </summary> /// <param name="text">message body, optional</param> /// <param name="header">message header, optional</param> /// <param name="steps">overall steps provide to show progress bar, and on each step call IncProcessingState(), optional</param> public void ShowProcessing(string text = "", string header = "", int steps = 0) { targetProcessingSteps = steps; currentProcessingStep = 0; appWaitForm = GetNewAppWaitForm(); queueAppWaitForm.Enqueue(appWaitForm); if (!appWaitForm.Visible) { Task.Run(() => InvokeIfRequired(appWaitForm, () => { try { barButtonStatusNotifications.Enabled = false; appWaitForm.ShowDialog(); } catch (InvalidOperationException e) { log.Warn(string.Concat(appWaitForm.GetType().Name, e.Message)); } })); } Application.DoEvents(); }
private AppWaitForm GetNewAppWaitForm() { var form = new AppWaitForm(); form.StartPosition = this.StartPosition; form.ShowOnTopMode = DevExpress.XtraWaitForm.ShowFormOnTopMode.AboveParent; return (form); }
public PrizmApplicationXtraForm() { InitializeComponent(); appWaitForm = GetNewAppWaitForm(); }
private AppWaitForm GetNewAppWaitForm() { var form = new AppWaitForm(); form.StartPosition = this.StartPosition; form.ShowOnTopMode = DevExpress.XtraWaitForm.ShowFormOnTopMode.AboveParent; return form; }
/// <summary> /// Show wait form. Call it at times when UI thread will be unresponsible /// For now used 1. on Executing commands through the CommandManager /// 2. when creating and showing child forms /// </summary> /// <param name="text">message body, optional</param> /// <param name="header">message header, optional</param> /// <param name="steps">overall steps provide to show progress bar, and on each step call IncProcessingState(), optional</param> public void ShowProcessing(string text = "", string header = "", int steps = 0) { targetProcessingSteps = steps; currentProcessingStep = 0; appWaitForm = GetNewAppWaitForm(); queueAppWaitForm.Enqueue(appWaitForm); if(!appWaitForm.Visible) { Task.Run(() => InvokeIfRequired(appWaitForm, () => { try { barButtonStatusNotifications.Enabled = false; appWaitForm.ShowDialog(); } catch(InvalidOperationException e) { log.Warn(string.Concat(appWaitForm.GetType().Name, e.Message)); } })); } Application.DoEvents(); }