public static void perform(operation_d operation)
 {
     using (UnshownBusyDlg f = new UnshownBusyDlg(operation))
     {
         f.ShowDialog();
     }
 }
Example #2
0
 public void add(operation_d operation)
 {
     lock (SYNCROOT)
     {
         _operations.enqueue(operation);
     }
     _evCatnap.set();
 }
Example #3
0
        private void callOperation(operation_d operation)
        {
            _retry = false;

            operation();

            if (_retry)
            {
                _topPrioOperations.Enqueue(operation);
            }
        }
Example #4
0
        public static void perform(operation_d operation, IWin32Window owner = null, bool forceNoDlg = false)
        {
            if (performing || forceNoDlg)
            {
                operation();
            }
            else
            {
                using (BusyDlg f = new BusyDlg(operation))
                {
                    performing = true;
                    f.ShowDialog(owner);
                    performing = false;

                    if (f._e != null)
                    {
                        throw new ExceptionCarrier(f._e);
                    }
                }
            }
        }
Example #5
0
        public BusyDlg(operation_d operation, bool cancellable)
        {
            self = this;

            _operation = operation;

            InitializeComponent();

            if (cancellable == false)
            {
                this.btnCancel.Visible = false;
                this.Height            = 110;
            }
            this.MinimumSize = this.Size;
            this.MaximumSize = new Size(this.Size.Width * 2, this.Size.Height);

            this.lblStatus.Text    = "";
            this.lblOptStatus.Text = "";

            Gnd.i.progressMessage.post(null);
            Gnd.i.progressOptionalMessage.post(null);
        }
Example #6
0
        public static void perform(bool antiCancel, operation_d operation)
        {
            using (CancellableBusyDlg f = new CancellableBusyDlg(operation))
            {
                Gnd.i.cancellableBusyDlg = f;
                Gnd.i.cancelled          = false;

                if (antiCancel)
                {
                    f.btnCancel.Enabled = false;
                }

                f.ShowDialog();

                Gnd.i.cancellableBusyDlg = null;

                if (f._e != null)
                {
                    throw f._e;
                }
            }
            GC.Collect();
        }
        public UnshownBusyDlg(operation_d operation)
        {
            _operation = operation;

            InitializeComponent();
        }
Example #8
0
        public CancellableBusyDlg(operation_d operation)
        {
            _operation = operation;

            InitializeComponent();
        }
Example #9
0
 public void add(operation_d operation)
 {
     _operations.Enqueue(operation);
 }
Example #10
0
 public void addTopPrio(operation_d operation)
 {
     _topPrioOperations.Enqueue(operation);
 }