Beispiel #1
0
 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;
		}
		private ModalTaskWindow(IModalTask InTask, string InTitle, string InMessage)
		{
			Task = InTask;
			Title = InTitle;
			Message = InMessage;
			InitializeComponent();
		}
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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);
        }
Beispiel #6
0
        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);
        }