/// <summary> /// Init constructor. /// </summary> public DependencyObjectDispatcher(System.Windows.DependencyObject dependencyObject, System.Windows.Threading.DispatcherPriority priority) { if (dependencyObject == null || dependencyObject.Dispatcher == null) { throw new ArgumentNullException("dependencyObject"); } _dispatcher = dependencyObject.Dispatcher; _priority = priority; }
/// <summary> /// Constructs a DispatcherScheduler that schedules units of work on the given <see cref="System.Windows.Threading.Dispatcher"/> at the given priority. /// </summary> /// <param name="dispatcher">Dispatcher to schedule work on.</param> /// <param name="priority">Priority at which units of work are scheduled.</param> /// <exception cref="ArgumentNullException"><paramref name="dispatcher"/> is null.</exception> public DispatcherScheduler(System.Windows.Threading.Dispatcher dispatcher, System.Windows.Threading.DispatcherPriority priority) { if (dispatcher == null) { throw new ArgumentNullException(nameof(dispatcher)); } _dispatcher = dispatcher; _priority = priority; }
public static void SubmitWorkItem(Action action, System.Windows.Threading.DispatcherPriority priority) { if (allowNextProcess && !_touchupOccured) { allowNextProcess = false; System.Windows.Application.Current.Dispatcher.BeginInvoke( priority, action ).Completed += dispatcherOperation_Completed; } }
/// <summary> /// Constructs a DispatcherScheduler that schedules units of work on the given <see cref="System.Windows.Threading.Dispatcher"/>. /// </summary> /// <param name="dispatcher">Dispatcher to schedule work on.</param> /// <exception cref="ArgumentNullException"><paramref name="dispatcher"/> is null.</exception> public DispatcherScheduler(System.Windows.Threading.Dispatcher dispatcher) { if (dispatcher == null) { throw new ArgumentNullException(nameof(dispatcher)); } _dispatcher = dispatcher; #if HAS_DISPATCHER_PRIORITY _priority = Windows.Threading.DispatcherPriority.Normal; #endif }
public static void Focus(UIElement element, System.Windows.Threading.DispatcherPriority priority, Func <bool> shouldSetFocus) { Debug.Assert(element != null); element.Dispatcher.BeginInvoke(priority, (Action)(() => { if (shouldSetFocus()) { element.Focus(); if (element.Focusable) { Keyboard.Focus(element); } } })); }
public void Redraw(ISegment segment, System.Windows.Threading.DispatcherPriority priority) { this.adapter.TextEditor.TextArea.TextView.Redraw(segment, priority); }
public static void Focus(UIElement element, System.Windows.Threading.DispatcherPriority priority) { Focus(element, priority, () => true); }
/// <summary> /// Creates new dispatcher based on given System.Windows dispatcher object. /// </summary> public static IEventDispatcher Create(System.Windows.Threading.Dispatcher dispatcher, System.Windows.Threading.DispatcherPriority priority) { return(new DependencyObjectDispatcher(dispatcher, priority)); }
public void DispatchOnUIThread(Action action, System.Windows.Threading.DispatcherPriority priority) => _inner.DispatchOnUIThread(action, priority);
/// <summary/> public void BeginInvokeShutdown(System.Windows.Threading.DispatcherPriority priority) { new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted).Assert(); InnerObject.BeginInvokeShutdown(priority); }
public static void Invoke(this System.Windows.Threading.Dispatcher dispatcher, System.Action action, System.Windows.Threading.DispatcherPriority priority) { }
public static System.Windows.Threading.DispatcherOperation BeginInvoke(this System.Windows.Threading.Dispatcher dispatcher, System.Action action, System.Windows.Threading.DispatcherPriority priority) { throw null; }