Exemple #1
0
        ContentWindow CreateContentWindow()
        {
            ContentWindow w = new ContentWindow();

            w.Closed += _dlg_Closed;
            w.Topmost = Topmost;

            _uiState.RestoreWindowState(w);

            return(w);
        }
Exemple #2
0
        private void SetSelectedItem(QueueItem itm)
        {
            if (itm != null)
            {
                if (_isMinimized)
                {
                    return;
                }

                if (_dlg == null || (_dlgShown && !_dlg.IsVisible))
                {
                    _dlg = CreateContentWindow();

                    _dlgShown = false;
                    UpdateContentWindow();
                }

                var content = GetQueueItemContent(itm);

                //_mgr.MessageContentFormat
                _dlg.SetContent(content, itm.Queue.ContentFormat, itm.Error);
                _dlg.SetTitle(itm.DisplayName);

                if (!_dlgShown)
                {
                    _dlg.Show();

                    _dlgShown = true;

                    this.Focus();
                }
                else
                {
                    if (!Topmost)
                    {
                        _dlg.Activate(); // Make sure its visible
                        this.Activate();
                    }
                }

                UpdateContextMenu(itm);
            }
            else
            {
                UpdateContextMenu(null);

                if (_dlg != null && _dlg.IsVisible)
                {
                    _dlg.Hide();
                }
            }
        }
        private void SetSelectedItem(QueueItem itm)
        {
            if( itm != null ) {

            if( _isMinimized )
              return;

            if( _dlg == null || ( _dlgShown && !_dlg.IsVisible ) ) {
              _dlg = CreateContentWindow();

              _dlgShown = false;
              UpdateContentWindow();
            }

            var content = GetQueueItemContent(itm);

            //_mgr.MessageContentFormat
            _dlg.SetContent(content, itm.Queue.ContentFormat, itm.Error);
            _dlg.SetTitle(itm.DisplayName);

            if( !_dlgShown ) {
              _dlg.Show();

              _dlgShown = true;

              this.Focus();
            } else {
              if( !Topmost ) {
            _dlg.Activate(); // Make sure its visible
            this.Activate();
              }
            }

            UpdateContextMenu(itm);
              } else {

            UpdateContextMenu(null);

            if( _dlg != null && _dlg.IsVisible )
              _dlg.Hide();

              }
        }
        ContentWindow CreateContentWindow()
        {
            ContentWindow w = new ContentWindow();
              w.Closed += _dlg_Closed;
              w.Topmost = Topmost;

              _uiState.RestoreWindowState(w);

              return w;
        }
        private void SetSelectedItem(QueueItem itm)
        {
            if( itm != null && itm.Content != null ) {

            if( _isMinimized )
              return;

            if( _dlgShown && !_dlg.IsVisible ) {
              _dlg = new ContentWindow();
              _dlg.Topmost = Topmost;

              _uiState.RestoreWindowState(_dlg);

              _dlgShown = false;
              UpdateContentWindow();
            }

            _dlg.SetContent(_mgr.LoadMessageContent(itm), itm.Error);

            //_dlg.Left = ( this.Left + this.Width ) - _dlg.Width;
            //_dlg.Top = this.Top - _dlg.Height;
            _dlg.SetTitle(itm.DisplayName);

            if( !_dlgShown ) {
              _dlg.Show();

              _dlgShown = true;
            } else {
              if( !Topmost ) {
            _dlg.Activate(); // Make sure its visible
            this.Activate();
              }
            }

            UpdateContextMenu(itm);
              } else {

            UpdateContextMenu(null);

            if( _dlg != null && _dlg.IsVisible )
              _dlg.Hide();

              }
        }
        private void InitSystem()
        {
            this.Icon = BitmapFrame.Create(this.GetImageResourceStream("main.ico"));

              _dlg = new ContentWindow();

              _uiState = SbmqSystem.UIState;
              RestoreWindowState();

              this.IsEnabled = false;

              BackgroundWorker w = new BackgroundWorker();
              w.DoWork += (s,e) => {
            _sys = SbmqSystem.Create();
            _sys.ItemsChanged += MessageMgr_ItemsChanged;

            _mgr = _sys.Manager;
              };

              w.RunWorkerCompleted += (s,e) => {

            RestoreQueueButtonsState();
            this.IsEnabled = true;

            btnSendCommand.IsEnabled = _sys.CanSendCommand;
            btnViewSubscriptions.IsEnabled = _sys.CanViewSubscriptions;

            lbItems.ItemsSource = _mgr.Items;

            SetupContextMenu();

            SetupQueueMonitorTimer(_sys.Config.MonitorInterval);

            if( _sys.Config.StartCount == 1 ) {
              ShowConfigDialog();

            } else if( _sys.Config.VersionCheck.Enabled ) {
              if( _sys.Config.VersionCheck.LastCheck < DateTime.Now.AddDays(-14) )
            CheckIfLatestVersion(false);
            }

              };

              w.RunWorkerAsync();
        }