From df9b2580669472d446e109dff88bdfa247b23b1e Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 15 Jul 2018 10:55:00 +0300 Subject: Implemented global disable UI Invokations & Property changed events on ExtendedObject. Some comments on PPC threading. --- .../Threading/IDispatcherProvider.cs | 12 ++++++++++++ .../Threading/DefaultDispetcherProvider.cs | 20 ++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/PPC') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Threading/IDispatcherProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Threading/IDispatcherProvider.cs index 4152d0cb9..27a5d1ab1 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Threading/IDispatcherProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Threading/IDispatcherProvider.cs @@ -6,9 +6,21 @@ using System.Threading.Tasks; namespace Tango.PPC.Common.Threading { + /// + /// Represents a mechanism for invoking actions on the main application thread. + /// public interface IDispatcherProvider { + /// + /// Invokes the specified action asynchronously. + /// + /// The action. void Invoke(Action action); + + /// + /// Invokes the specified action synchronously. + /// + /// The action. void InvokeSync(Action action); } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Threading/DefaultDispetcherProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Threading/DefaultDispetcherProvider.cs index c33233573..0051ca329 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Threading/DefaultDispetcherProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Threading/DefaultDispetcherProvider.cs @@ -8,20 +8,36 @@ using Tango.PPC.Common.Threading; namespace Tango.PPC.UI.Threading { + /// + /// Represents the default PPC which will invoke action on the current application dispatcher. + /// + /// public class DefaultDispetcherProvider : IDispatcherProvider { private Dispatcher _dispatcher; - public DefaultDispetcherProvider(Dispatcher dispacther) + /// + /// Initializes a new instance of the class. + /// + /// The dispatcher. + public DefaultDispetcherProvider(Dispatcher dispatcher) { - _dispatcher = dispacther; + _dispatcher = dispatcher; } + /// + /// Invokes the specified action asynchronously. + /// + /// The action. public void Invoke(Action action) { _dispatcher.BeginInvoke(action); } + /// + /// Invokes the specified action synchronously. + /// + /// The action. public void InvokeSync(Action action) { _dispatcher.Invoke(action); -- cgit v1.3.1