Esempio n. 1
0
        public bool StartDownload(AsyncCompletedEventHandler dlFinishedCallback,
                                  DownloadProgressChangedEventHandler dlProgressCallback,
                                  string URL,
                                  string SavePath)
        {
            Uri uri;

            try
            {
                uri = new Uri(URL);
            }
            catch (Exception)
            {
                return(false);
            }
            m_client.DownloadFileCompleted   += dlFinishedCallback;
            m_client.DownloadProgressChanged += dlProgressCallback;

            int chrindex = SavePath.LastIndexOf(@"/");

            if (chrindex == -1)
            {
                chrindex = SavePath.LastIndexOf(@"\");
            }

            string Path = SavePath.Substring(0, chrindex);

            System.IO.Directory.CreateDirectory(Path);

            m_client.DownloadFileAsync(uri, MyToolkit.ValidPath(SavePath));

            return(true);
        }
Esempio n. 2
0
        public void DownloadManifest()
        {
            if (DontDownloadManifest)
            {
                ManifestDownloadComplete(null, null);
            }

            MyToolkit.ActivityLog("Attempting to download Manifest file \"" + ManifestURL + "\"");
            m_Status      = "Fetching manifest";
            LocalManifest = MyToolkit.ValidPath(Path.Combine(PathRoot, "Bourbon.xml"));
            client.StartDownload(new AsyncCompletedEventHandler(ManifestDownloadComplete),
                                 new DownloadProgressChangedEventHandler(dlProgress),
                                 ManifestURL,
                                 LocalManifest);
        }
Esempio n. 3
0
 public DownloadItem(ArrayList URL, string filePath)
 {
     m_urls     = URL;
     m_filePath = MyToolkit.ValidPath(filePath);
 }