background information:
I am making a batch encoder for my project, this is something like this: (I need to add the cancel button inside each item and change the placeholder)
Added for each item, a thread / task should process a given notification (image) and save disk as an encoded image H No need.
I am used to working with rep and delegateObject.BeginInvoke (...) , but I only have constant Calls inside the Representative method
Problem:
I did more that with WinForms Not at all with the dynamic list. Apart from this, I'm not familiar with the UI / Thread / Function cancellation.
Question:
I need a little pressure on the head to do the best way to deal with this problem.
How to manage multiple parallel operations and update the UI?
Did you see anything on the lines of using cancellation token:
Private cancellation token resource; Private Ascend void start_lick (object sender, eventArgse E) {_cts = new cancellationTocasource (); Var Token = _cts.Token; Try {Waiting for work} Rune ((= => {// your encoding process}); } Catch (OperationConnected Exception) {// Handle Cancellation}} Private Wide Stop_clic (Object Sender, EventAgages E) {If (_cts! = Null) _Connection cancel (); }
No comments:
Post a Comment