aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Threading/DefaultDispetcherProvider.cs
blob: c33233573a348ffea68e54ae8402d2a5c90cca67 (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
27
28
29
30
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Threading;
using Tango.PPC.Common.Threading;

namespace Tango.PPC.UI.Threading
{
    public class DefaultDispetcherProvider : IDispatcherProvider
    {
        private Dispatcher _dispatcher;

        public DefaultDispetcherProvider(Dispatcher dispacther)
        {
            _dispatcher = dispacther;
        }

        public void Invoke(Action action)
        {
            _dispatcher.BeginInvoke(action);
        }

        public void InvokeSync(Action action)
        {
            _dispatcher.Invoke(action);
        }
    }
}