aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/MachineStudio.Dispensers/Contracts
ModeNameSize
-rw-r--r--IMainView.cs405logstatsplain
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using Tango.Core.Commands;

namespace Tango.PPC.Common.Notifications
{
    /// <summary>
    /// Represents the PPC user notification provider responsible for displaying information, alerts and dialogs to the user.
    /// </summary>
    public interface INotificationProvider
    {
        /// <summary>
        /// Gets the collection of notification items.
        /// </summary>
        ObservableCollection<NotificationItem> NotificationItems { get; }

        /// <summary>
        /// Gets a value indicating whether this instance has notification items.
        /// </summary>
        bool HasNotificationItems { get; }

        /// <summary>
        /// Gets the current message box.
        /// </summary>
        MessageBoxVM CurrentMessageBox { get; }

        /// <summary>
        /// Gets a value indicating whether this instance has message box.
        /// </summary>
        bool HasMessageBox { get; }

        /// <summary>
        /// Shows an information message box.
        /// </summary>
        /// <param name="message">The message.</param>
        Task ShowInfo(String message);

        /// <summary>
        /// Shows warning message box.
        /// </summary>
        /// <param name="message">The message.</param>
        Task ShowWarning(String message);

        /// <summary>
        /// Shows an error message box.
        /// </summary>
        /// <param name="message">The message.</param>
        Task ShowError(String message);

        /// <summary>
        /// Shows a question message box.
        /// </summary>
        /// <param name="message">The message.</param>
        Task<bool> ShowQuestion(String message);

        /// <summary>
        /// Inserts the notification item to the bottom of the notifications collection.
        /// </summary>
        /// <param name="item">The item.</param>
        NotificationItem PushNotification(NotificationItem item);

        /// <summary>
        /// Inserts the notification item to the bottom of the notifications collection.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <param name="condition">A condition which determines if this item is still relevant.</param>
        /// <param name="autoCheck">Determines whether to perform automatic checking of the condition.</param>
        /// <param name="checkInterval">Determines how frequently the condition function will be invoked. (Default 1 second)</param>
        NotificationItem PushNotification(NotificationItem item, Func<bool> condition, bool autoCheck = true, TimeSpan? checkInterval = null);

        /// <summary>
        /// Removed the specified notification item.
        /// </summary>
        /// <param name="item">The item.</param>
        void PopNotification(NotificationItem item);

        /// <summary>
        /// Invokes the notification items conditions.
        /// </summary>
        void InvokeNotificationItemsConditions();

        /// <summary>
        /// Gets the pop notification command.
        /// </summary>
        RelayCommand<NotificationItem> PopNotificationCommand { get; }
    }
}