Beispiel #1
0
        /// <summary>
        /// Called when the perf graph message is received.
        /// </summary>
        /// <param name="message">The message.</param>
        protected void OnPerfGraphMessageReceived(PerfGraphMessage message)
        {
            var evt = OnPerfGraphMessage;

            if (evt != null)
            {
                evt(this, message);
            }
        }
Beispiel #2
0
        private bool ShowPopup(PerfGraphMessage perfMessage)
        {
            lock ( _syncRoot )
            {
                var viewModel = _userInterface.DataContext as PerfGraphViewModel;
                if (viewModel != null)
                {
                    PerfGraphPopup popup = null;
                    if (_notifyIcon.CustomBalloon != null && _notifyIcon.CustomBalloon.Child != null)
                    {
                        popup = _notifyIcon.CustomBalloon.Child as PerfGraphPopup;
                    }

                    var popupViewModel = new PerfGraphPopupViewModel
                    {
                        Message = perfMessage.Content
                    };

                    popupViewModel.ShowPerfLog += popupViewModel_ShowPerfLog;

                    if (popup != null)
                    {
                        PopupViewModel = popupViewModel;

                        popup.Closed += popup_Closed;

                        _notifyIcon.CloseBalloon( );

                        return(true);
                    }

                    var perfGraphPopup = new PerfGraphPopup
                    {
                        DataContext = popupViewModel
                    };

                    _notifyIcon.ShowCustomBalloon(perfGraphPopup, PopupAnimation.Scroll, _popupTimeout);

                    return(true);
                }
            }

            return(false);
        }
Beispiel #3
0
        /// <summary>
        /// Channels the perf graph message.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The event args.</param>
        private void Channel_OnPerfGraphMessage(object sender, PerfGraphMessage e)
        {
            string message = e.ToString();

            PropagateMessageToPlugins(message);
        }