/// <summary>
        /// Shows a desktop alert.
        /// </summary>
        /// <param name="args"></param>
        public void ShowAlert(AlertNotificationArgs args)
        {
            AssertState(new[] { DesktopObjectState.Open, DesktopObjectState.Closing });

            // log new alert
            AlertLog.Instance.Log(args);

            this.DesktopWindowView.ShowAlert(args);
        }
        /// <summary>
        /// Shows a desktop alert.
        /// </summary>
        /// <param name="level">The alert level.</param>
        /// <param name="message">The message to display.</param>
        /// <param name="linkText">The link text to display.</param>
        /// <param name="linkAction">The link action to display.</param>
        /// <param name="dismissOnLinkClicked"> </param>
        public void ShowAlert(AlertLevel level, string message, string linkText, Action <DesktopWindow> linkAction, bool dismissOnLinkClicked)
        {
            var args = new AlertNotificationArgs(level, message)
            {
                LinkText             = linkText,
                LinkAction           = linkAction,
                DismissOnLinkClicked = dismissOnLinkClicked
            };

            ShowAlert(args);
        }
Exemple #3
0
        /// <summary>
        /// Logs a new alert.
        /// </summary>
        /// <param name="args"></param>
        public void Log(AlertNotificationArgs args)
        {
            var alert = new Alert(args.Level, Platform.Time, args.Message)
            {
                Acknowledged = args.Level == AlertLevel.Info                                    // info alerts are "pre-acknowledged" (do not require acknowledgement)
            };

            _alerts.Enqueue(alert);
            while (_alerts.Count > MaxLogSize)
            {
                _alerts.Dequeue();
            }

            EventsHelper.Fire(AlertLogged, this, new ItemEventArgs <Alert>(alert));
        }
        /// <summary>
        /// Shows a desktop alert.
        /// </summary>
        /// <param name="level">The alert level.</param>
        /// <param name="message">The message to display.</param>
        public void ShowAlert(AlertLevel level, string message)
        {
            var args = new AlertNotificationArgs(level, message);

            ShowAlert(args);
        }