c# - Inject IProgress<string> to a method passed by parameter -


i develop simple windows forms form, contaning text area, ok button , 1 cancel button. receive method constructor parameter, know has both iprogress<string> , cancellationtoken parameters, alongside parameters.

however, both iprogress<string> handler (that write progress messages on text area mentioned above) , cancellationtoken (that bound cancel button) inside form , not accessible outside.

how "inject" both iprogress , cancellationtoken method, before starts? should make both public , tie them before showing form, without passing function constructor parameter?

something that:

var progressform = new myprogressform(); // not working. pseudo-algorithm. progressform.functiontoexecute = myfunction(param1, param2,     progressform.progressreporter, progressform.cancellationtoken); progressform.show(); 


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -