/// <summary> /// This method will create a new thread, make a hidden form and a browser /// control on that thread, navigate the browser to the URL you give it, /// wait for OnDocumentComplete, and then execute the operation you give it. /// </summary> /// <typeparam name="TResult">The type of the result</typeparam> /// <param name="url">The URL to navigate the browser to</param> /// <param name="label">The name to assign to the background thread (for easier debugging)</param> /// <param name="browserWidth">The approx. desired width of the browser</param> /// <param name="browserHeight">The approx. desired height of the browser</param> /// <param name="defaultValue">The value to return if the operation is not successful</param> /// <param name="operation">The operation to perform</param> /// <returns>The result returned by the operation, or if failed, defaultValue</returns> public static TResult InvokeAfterDocumentComplete <TResult>(string url, string label, int browserWidth, int browserHeight, TResult defaultValue, BrowserOperation <TResult> operation) { InvokerHelper <TResult> invoker = new InvokerHelper <TResult>(url, label, browserWidth, browserHeight, defaultValue, operation); invoker.Execute(); return(invoker.Result); }
public void InvokeOnMainLoop(InvokerHelper helper) { NSApplication.SharedApplication.InvokeOnMainThread(helper.Invoke); }
public void InvokeOnMainLoop(InvokerHelper helper) => dispatcher(helper.Invoke);