Beispiel #1
0
        public StatusBusy(string statusText, bool showWaitForm)
        {
            if (_statusBarItem != null)
            {
                _oldStatus             = _statusBarItem.Caption;
                _statusBarItem.Caption = statusText;
                Application.DoEvents();
            }
            if (_frmMain != null)
            {
                _oldCursor      = _frmMain.Cursor;
                _frmMain.Cursor = Cursors.WaitCursor;
            }

            var settingsProvider = Provider.Get();

            if (settingsProvider != null)
            {
                var section = settingsProvider.LoadSection("BasicWindowSettings");
                _showWaitForm = showWaitForm && section.GetSetting("ShowWaitForm", true).Value;
            }
            else
            {
                _showWaitForm = false;
            }

            if (_showWaitForm)
            {
                WaitFormHelper.Start(statusText);
            }
        }
Beispiel #2
0
        private bool _disposedValue; // To detect redundant calls

        protected void Dispose(bool disposing)
        {
            if (!_disposedValue)
            {
                if (disposing)
                {
                    if (_frmMain != null)
                    {
                        _frmMain.Cursor = _oldCursor;
                    }
                    if (_statusBarItem != null)
                    {
                        _statusBarItem.Caption = _oldStatus;
                    }
                    if (_showWaitForm)
                    {
                        WaitFormHelper.Stop();
                    }
                }
            }
            _disposedValue = true;
        }