aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Azure/Tango.AzureUtils/AzureUtilsConfirmationEventArgs.cs
blob: 9a27e06de8b50a35b204de502e498a94ac0fba80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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; padd
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.AzureUtils
{
    public class AzureUtilsConfirmationEventArgs : EventArgs
    {
        private TaskCompletionSource<bool> _completionSource;

        public String Message { get; set; }

        public AzureUtilsConfirmationEventArgs(String message)
        {
            Message = message;
            _completionSource = new TaskCompletionSource<bool>();
        }

        internal Task<bool> GetAwaiter()
        {
            return _completionSource.Task;
        }

        public void Confirm()
        {
            _completionSource.SetResult(true);
        }

        public void Cancel()
        {
            _completionSource.SetResult(false);
        }
    }
}