/// <summary> /// Method used for invoking subscription method on Caller thread. /// </summary> /// <param name="subscriptions">method subscription</param> /// <param name="obj">argument</param> private void ExecuteOnCallingTrherad(IMessangerSubscription subscriptions, object obj) { subscriptions.Execute(obj); }
/// <summary> /// Method used for invoking subsciption method on new task (thread) /// </summary> /// <param name="subscriptions">method subscription</param> /// <param name="obj">argument</param> private void ExecuteOnNewThread(IMessangerSubscription subscriptions, object obj) { Task.Factory.StartNew(() => subscriptions.Execute(obj)); }
/// <summary> /// Method used for invoking subsciption method on UI Dispatcher thread /// </summary> /// <param name="subscriptions">method subscription</param> /// <param name="obj">argument</param> private void ExecuteOnDispatcher(IMessangerSubscription subscriptions, object obj) { Dispatcher.CurrentDispatcher.Invoke(() => subscriptions.Execute(obj)); }