aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/PendingNotification.cs
blob: cf76e90d9596778159fa9cd8349cfe5f6db734f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { col
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.PPC.UI.Notifications
{
    /// <summary>
    /// Represents a pending notification item.
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <typeparam name="TResult">The type of the result.</typeparam>
    public class PendingNotification<T, TResult>
    {
        /// <summary>
        /// Gets or sets the item.
        /// </summary>
        public T Item { get; set; }

        /// <summary>
        /// Gets or sets the completion source.
        /// </summary>
        public TaskCompletionSource<TResult> CompletionSource { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="PendingNotification{T, TResult}"/> class.
        /// </summary>
        public PendingNotification()
        {

        }

        /// <summary>
        /// Initializes a new instance of the <see cref="PendingNotification{T, TResult}"/> class.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <param name="completionSource">The completion source.</param>
        public PendingNotification(T item, TaskCompletionSource<TResult> completionSource) : this()
        {
            Item = item;
            CompletionSource = completionSource;
        }
    }
}