Mercurial > silverbladetech
view Chronosv2/source/Extensions/Windows/DispatcherObjectExtensions.cs @ 28:4c0dea4760c5
RabbitMq working
author | adminsh@apollo |
---|---|
date | Wed, 21 Mar 2012 20:29:04 +0000 |
parents | 09d18d6e5f40 |
children |
line wrap: on
line source
using System; using System.Windows.Threading; namespace Chronos.Extensions.Windows { /// <summary> /// Provides a set of commonly used Dispatcher extension methods /// </summary> public static class DispatcherObjectExtensions { #region · Extensions · /// <summary> /// Executes the specified <see cref="Action "/> at the <see cref="DispatcherPriority.ApplicationIdle"/> priority /// on the thread on which the DispatcherObject is associated with. /// </summary> /// <param name="dispatcherObject">The dispatcher object.</param> /// <param name="action">The action.</param> public static void InvokeAsynchronously(this DispatcherObject dispatcherObject, Action action) { dispatcherObject.Dispatcher.BeginInvoke(DispatcherPriority.Normal, action); } /// <summary> /// Executes the specified <see cref="Action "/> at the <see cref="DispatcherPriority.ApplicationIdle"/> priority /// on the thread on which the DispatcherObject is associated with. /// </summary> /// <param name="dispatcherObject">The dispatcher object.</param> /// <param name="action">The action.</param> public static void InvokeAsynchronouslyInBackground(this DispatcherObject dispatcherObject, Action action) { dispatcherObject.Dispatcher.BeginInvoke(DispatcherPriority.Background, action); } /// <summary> /// Executes the specified <see cref="Action "/> at the <see cref="DispatcherPriority.ApplicationIdle"/> priority /// on the thread on which the DispatcherObject is associated with. /// </summary> /// <param name="dispatcherObject">The dispatcher object.</param> /// <param name="action">The action.</param> public static void Invoke(this DispatcherObject dispatcherObject, Action action) { dispatcherObject.Dispatcher.Invoke(action); } #endregion } }