Implementing IFileLoader

Oct 30, 2010 at 2:08 AM

I'm having trouble implementing Balder 8.8.9 IFileLoader.

It would be quite easy if Silverlight allowed synchronous IO, but I've been trying to used WebClient's and OpenReadAsync.  The problem is (maybe not the only one) that to get the Stream I have to wait for an event handler to return the data, but any attempt to block the "GetStream()" methed  to wait for the event to return the Stream also seems to block the IO.  Probably because they are both in the same thread.

My objective is to read ".ase" files from the ClientBin

I'm still researching ways to do this, but if anyone can point me in the right direction I'd appreciate it.


Oct 30, 2010 at 7:24 AM


this is a shortcoming of the FileLoader at the moment - or in fact the entire content system, it wasn't built for Async - I'm hammering my head against the wall daily for not doing it from the start. I've started a branch to fix this, which changes the API for the IFileLoader a bit, with an Async callback - that seems to working quite good. Just need to get the rest of content system up to speed. 

I have one task in line before I can get to that, which is sprite intersection for mouse events. When I get that nailed, I'll jump back to this branch.

Oct 30, 2010 at 11:12 AM
Edited Oct 30, 2010 at 11:12 AM

Btw: I've created a work item for this :

Oct 30, 2010 at 5:19 PM

Thanks.  I'll look forward to it!