Batch opening documents in order to export shedules

Batch opening documents in order to export shedules

SONA-ARCHITECTURE
Advocate Advocate
212 Views
1 Reply
Message 1 of 2

Batch opening documents in order to export shedules

SONA-ARCHITECTURE
Advocate
Advocate

HI,

I've got a Wpf datagrid wich contains documents user has selected threw an OpenFileDialog.

I've got a foreach loop doing  :

  • OpenDocumentFile
  • exporting shedules
  • Close file

I've got a progressBar for this process but I can't see the progression in my wpf page.

I've missed something but what?

Thx

Pierre NAVARRA
SONA-Architecture.
http://www.sona-architecture.com
https://fr.linkedin.com/in/pierre-navarra-62032a107
0 Likes
Accepted solutions (1)
213 Views
1 Reply
Reply (1)
Message 2 of 2

SONA-ARCHITECTURE
Advocate
Advocate
Accepted solution

Sorry, I've founded :

I transform by function as : private async void 

and calling await DoEvents(); in my loop

And create this other method :

 

protected async Task<bool> DoEvents()
{
await Task.Run(() => {
Thread.Sleep(1);
});

return true;
}

 

Pierre NAVARRA
SONA-Architecture.
http://www.sona-architecture.com
https://fr.linkedin.com/in/pierre-navarra-62032a107