wpf - Error on calling method in dowork event (background worker) -


i have in code 2 same , big pieces of code, create method , put there. call method 2 times in code, first time , second time want call dowork event (background worker). problem when executes (in dowork) program stops responding... question is.how can call method dowork event?

edit: code

private void parsehtmlfile(string file) { // here parse html file , fill arraylists. }  // event call method on click private void menuitem_newpr(object sender, routedeventargs e) { parsehtmlfile(file);// in case program works well. }  // work  worker.dowork += (s, e) => { var file = e.argument string; parsehtmlfile(file);// in case program stop responding. } 

edit 2: changed thing in method , doesn't crash, have problem now. dowork method doesn't executes code exists below method call statement. put breakpoint there , never goes there...


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -