passing parameter to dowork?

Posted by safi on Stack Overflow See other posts from Stack Overflow or by safi
Published on 2011-02-09T15:17:45Z Indexed on 2011/02/09 15:25 UTC
Read the original article Hit count: 163

Filed under:
|

How can i Pass parameter to background_DoWork?

 public void bgw1_DoWork(Object sender, DoWorkEventArgs e)
    {
        make_zip_file argumentest = e.Argument as make_zip_file;
        Thread.Sleep(100);
        argumentest.return_path = argumentest.Makezipfile(files, IsOriginal);
        e.Result = argumentest;

    }

i need to pass files,isOrginal parameter...?

i am calling this method:

public string run_async() {

        bgw1.DoWork += bgw1_DoWork;
        bgw1.RunWorkerCompleted += bgw1_RunWorkerCompleted;
        make_zip_file mzf2 = new make_zip_file();
        bgw1.RunWorkerAsync();
        return return_path;

    }

© Stack Overflow or respective owner

Related posts about c#

Related posts about multithreading