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
Post a Comment