private static IAsyncOperation <T> runIdleAsyncCore <T>(this CoreDispatcher dispatcher, Func <T> agileCallback) { var r = new AsyncOperation <T>(); var ignore = dispatcher.RunIdleAsync(i => core(r, agileCallback)); return(r); }
private static IAsyncAction runIdleAsyncCore(this CoreDispatcher dispatcher, Func <IAsyncAction> agileCallback) { var r = new AsyncAction(); var ignore = dispatcher.RunIdleAsync(args => core(r, agileCallback)); return(r); }
/// <summary> /// Run <paramref name="agileCallback"/> on UI thread with idle priority. /// </summary> /// <param name="dispatcher"><see cref="CoreDispatcher"/> to run <paramref name="agileCallback"/> on</param> /// <param name="agileCallback">callback to execute</param> /// <returns>An <see cref="IAsyncAction"/> indicates the completion of <paramref name="agileCallback"/>.</returns> /// <exception cref="ArgumentNullException"><paramref name="dispatcher"/> or <paramref name="agileCallback"/> /// is <see langword="null"/>.</exception> public static IAsyncAction RunIdleAsync(this CoreDispatcher dispatcher, DispatchedHandler agileCallback) { if (dispatcher == null) { throw new ArgumentNullException(nameof(dispatcher)); } if (agileCallback == null) { throw new ArgumentNullException(nameof(agileCallback)); } return(dispatcher.RunIdleAsync(i => agileCallback())); }
private static async void beginIdleCore(CoreDispatcher dispatcher, IdleDispatchedHandler agileCallback) { await dispatcher.RunIdleAsync(agileCallback); }