Post by Prezence on Jun 6, 2014 9:20:54 GMT 10
I am using this code public sub downloadbegin(sender as object, e as downloadbegineventargs)
While e.Info.IsActive
Application.DoEvents()
End While
downloadsbar.Visible = True
Dim file As String = e.Info.FileName + "|" + e.Info.SavePath + "|" + e.Info.Url.ToString + "|" + e.Info.Progress.ToString
downloadsbar.Items.Add(New DownloadBarItem(e.Info.FileName, e.Info.SavePath, e.Info.Url.ToString))
end sub
Sometimes the webcontrol disappears, and the application crashes This happens for files like .zip, .mp3 but doesn't for pdfs or powerpoints How did you handle the event ?
Check out our website here. Check out AirBrowse here. Follow us on GitHub here.
Last Edit: Jun 16, 2014 1:20:20 GMT 10 by Prezence
|
|
Post by Nathan Lecompte on Jun 6, 2014 16:35:40 GMT 10
To handle the event is quite simple, in Awesomium 1.7 all the downloads are managed by the WebCore. All you have to do is add your Download Sub to the WebCore's Download Event like this: Sub Form Load() AddHandler downloadbegin(), AddressOf WebCore.DownloadBegin() '<< Add this to your Form's Load event. End Sub Hope this helps! PS: If this solved your question please add "[SOLVED]" to your subject/title.
|
|
Post by Prezence on Jun 6, 2014 20:53:20 GMT 10
I meant like actually retrieving the download and updating the progress etc.
Check out our website here. Check out AirBrowse here. Follow us on GitHub here.
|
|
Post by Prezence on Jun 6, 2014 21:23:20 GMT 10
For instance, cancel the download in the eventargs and use a webclient or httpwebresponse?
Check out our website here. Check out AirBrowse here. Follow us on GitHub here.
Last Edit: Jun 6, 2014 21:23:31 GMT 10 by Prezence
|
|
Post by Nathan Lecompte on Jun 7, 2014 11:16:43 GMT 10
Oh, OK. Sorry about that, I thought you meant only handling the Download event. Awesomium has a tabbed WinForms example which includes Downloads manager and should help answer your question . When you install the SDK, Awesomium.NET samples are deployed under: %PublicDocuments%\Awesomium SDK Samples\1.7.x.x\Awesomium.NET\Samples On Windows Vista, 7 and 8, %PublicDocuments% corresponds to something like: C:\Users\Public\Documents So the full path to the samples solution should be: C:\Users\Public\Documents\Awesomium SDK Samples\1.7.x.x\Awesomium.NET\Samples\Awesomium.NET Samples.sln And the exact path to the TabbedFormsSample (this one is in C# although there should be other languages included too) project: C:\Users\Public\Documents\Awesomium SDK Samples\1.7.x.x\Awesomium.NET\Samples\Windows Forms\CSharp\WebControlSample\TabbedFormsSample.csproj Hope this helps!
|
|
Post by Nathan Lecompte on Jun 12, 2014 16:29:05 GMT 10
If this solved your question please add "[SOLVED]" to your subject/title.
|
|
Post by Prezence on Jun 15, 2014 6:41:34 GMT 10
I have figured that out, how to do the Downloads manager window and all of that. What I want to know is why the webcontrol will sometimes go blank when I try to handle the downloadbegin event and add an item to my downloads bar. I used your browser as an example. When I download ,for example, the lumia player setup exe file, my webcontrols go blank and the webcore shuts down. Yours does not... Does your browser handle the webcore.download event or the webcore.downloadbegin event? And do you have any recommendations along the lines of a downloads bar?
Check out our website here. Check out AirBrowse here. Follow us on GitHub here.
|
|
Post by Nathan Lecompte on Jun 15, 2014 14:37:42 GMT 10
Hmm...is this only for when Downloading items or does this occur even when not Downloading. It could be because you haven't referenced the correct DLLs or it could be that you don't Rebuild the application before debugging. This might also be a bug in Awesomium (although I doubt that). Lumia Browser uses both of the events, it launches the Downloads bar on the DownloadBegin event and adds an item to the Downloads Manager. The Download event is used for things like progress. I also use the DownloadComplete event (quite obvious what that does). Recommendations...not really, although I do know what a downloads bar should support: -Open file in folder -Open file (obviously) -Cancel/Stop download -Pause/Resume download (optional) -Download Stats (percentage, speed, file size, filename, file location, file save location) There isn't much I could do now, you could try asking the guys at Awesomium for help if you need ( answers.awesomium.com ). Hope this helps!
|
|
Post by Prezence on Jun 16, 2014 1:20:02 GMT 10
Thank you! After all the confusion, I changed my code to launch the downloadbegin in the main form instead of the tab user control's code. I also changed the event handler to Shared - which someone said would work. I had also been using a line of code to extract the icon associated with the file which caused the webcore to shutdown when the system couldn't find the icon. When I wrapped that in a try catch, everything was fine after that.
Check out our website here. Check out AirBrowse here. Follow us on GitHub here.
|
|
Post by Nathan Lecompte on Jun 16, 2014 8:00:03 GMT 10
That's great!
|
|