Hi,
The download event is not what you are looking for. Those events are triggered when explicitly downloads a file. A resource can either be "loaded" or "downloaded". If a resource is to be "loaded", it is fetched from the server and passed to the corresponding parser (for example, a HTML file would be passed to the HTML parser), which would then parse and display it in the browser window. If a resource is to be downloaded, it is fetched from the server and then saved to a temp file, no parsers are involved.
There is no built-in features for you to limit download size of dependency resources such as images. If you must control that, you will have to take over the loading process yourself with a custom resource handler:
https://www.essentialobjects.com/doc/webbrowser/advanced/resource_handler.aspxThis allows you to selectively intercept certain resources and handle actually resource fetching yourself. For example, you could use a custom resource handler to intercept all font file request and then load the font file from your local database and then pass it to the browser. The browser will still think it got the font file from the server. You can implement whatever logic you wish in this part. For example, if you have intercepted an image request, you can send the request to the server, and as soon as you get the response header that tells you the size of the image, you can check the size and decide whether you wish to continue. If it it too big, you can simply return from your custom resource handler and the browser engine will get an "corrupted" image.
Because the loader layer of the browser engine is highly optimized, it is not a good idea to completely take over the entire loader layer with your own code. As such you should only intercept those requests that you are interested and leave the rest for the browser engine to handle.
Hope this helps. Please feel free to let us know if you still have any questions.
Thanks!