Example #1
0
        public DownloadManager(CrBrowser crBrowser)
        {
            _crBrowser = crBrowser;
            browser    = _crBrowser.GetBrowser();

            var handler = new DownloadHandler();

            handler.OnBeforeDownloadFired  += (s, e) => OnBeforeDownload(e, e.downloadItem);
            handler.OnDownloadUpdatedFired += (s, e) => OnDownloadUpdated(e, e.downloadItem);

            _crBrowser.GetBrowser().DownloadHandler = handler;
            _crBrowser.GetBrowser().RegisterAsyncJsObject("CrDownloadsCallBack", new CrDownloadsCallBack(this));
        }
Example #2
0
        public DownloadManager(CrBrowser crBrowser)
        {
            _crBrowser = crBrowser;

            downloadHandler = new DownloadHandler();
            downloadHandler.OnBeforeDownloadFired += (s, e) =>
            {
                DownloadDo("add", _crBrowser.GetBrowser(), e);
            };
            downloadHandler.OnDownloadUpdatedFired += (s, e) =>
            {
                DownloadDo("update", _crBrowser.GetBrowser(), e);
            };

            _crBrowser.GetBrowser().DownloadHandler = downloadHandler;
            _crBrowser.GetBrowser().RegisterAsyncJsObject("CrDownloadsCallBack", new CrDownloadsCallBack());
        }