Exemple #1
0
 public IStatusWriter GetStatusWriter(object owner)
 {
     lock ( _statusWriters )
     {
         IStatusWriter writer = (IStatusWriter)_statusWriters [owner];
         if (writer == null)
         {
             writer = new StatusWriter(this, owner);
             _statusWriters [owner] = writer;
         }
         return(writer);
     }
 }
Exemple #2
0
        internal void UpdateStatusText(bool doEvents)
        {
            if (_statusBar.Panels.Count == 0)     // do not crash when we are closing
            {
                return;
            }

            if (_updatingStatusText)
            {
                _recursiveUpdateStatusText = true;
                return;
            }

            _updatingStatusText = true;

            do
            {
                string panelText;
                lock ( _activeStatusWriters )
                {
                    if (_activeStatusWriters.Count == 0)
                    {
                        panelText = _defaultText;
                    }
                    else
                    {
                        StatusWriter statusWriter = (StatusWriter)_activeStatusWriters [0];
                        panelText = statusWriter.LastMessage;
                    }
                }
                _panel.Text = panelText;

                if (doEvents)
                {
                    _recursiveUpdateStatusText = false;
                    _statusBar.Refresh();
                }
            } while(_recursiveUpdateStatusText);

            _updatingStatusText        = false;
            _recursiveUpdateStatusText = false;
        }