public override void Start(Func <Task> action, CancellationTokenSource cts, Action <ProgressMessage> onProgressCallback = null) { if (isRunning == false) { isRunning = true; base.Start(action, cts, onProgressCallback); NSObject.InvokeInBackground(async() => await Task.Run(action, TokenSource.Token)); } }
public void FinishContentEditing(Action <PHContentEditingOutput> completionHandler) { // Update UI to reflect that editing has finished and output is being rendered. // Render and provide output on a background queue. NSObject.InvokeInBackground(() => { // Create editing output from the editing input. var output = new PHContentEditingOutput(input); // Call completion handler to commit edit to Photos. completionHandler(output); // Clean up temporary files, etc. }); }
public void FinishContentEditing(Action <PHContentEditingOutput> completionHandler) { // Update UI to reflect that editing has finished and output is being rendered. // Render and provide output on a background queue. NSObject.InvokeInBackground(() => { // Create editing output from the editing input. var output = new PHContentEditingOutput(input); // Provide new adjustments and render output to given location. // output.AdjustmentData = <#new adjustment data#>; // NSData renderedJPEGData = <#output JPEG#>; // renderedJPEGData.Save (output.RenderedContentURL, true); // Call completion handler to commit edit to Photos. completionHandler(output); // Clean up temporary files, etc. }); }
public void Start(Func <Task> action) { NSObject.InvokeInBackground(new Action(async() => await action())); }