/// <snd-abort what='file' id='10' /> private void OnSndAbortEvent(PeerSocket peer, XmlRequest xml) { Gtk.Application.Invoke(delegate { string what = (string)xml.Attributes["what"]; if (what == "file") { ulong id = ulong.Parse((string)xml.Attributes["id"]); DownloadManager.AbortDownload(peer, id); } }); }
private string FileAlreadyInUse(string fileName) { string saveAs = null; bool goOn = true; do { // Save File Dialog saveAs = Base.Dialogs.SaveFile(Paths.UserSharedDirectory(MyInfo.Name), fileName); if (saveAs == null) { return(null); } if (DownloadManager.IsInList(saveAs) == true) { string msg = "Currently you are Downloading file that you have saved as '" + saveAs + "'.\n" + "I've to stop the Download of It in favor of this?"; goOn = GUI.Base.Dialogs.QuestionDialog("Name Conflict", msg); if (goOn == true) { DownloadManager.AbortDownload(saveAs); } } else if (UploadManager.IsInList(saveAs) == true) { string msg = "Currently you are Uploading file '" + saveAs + "' that you want replace.\n" + "I've to stop the Upload of It favor of this?"; goOn = GUI.Base.Dialogs.QuestionDialog("Name Conflict", msg); if (goOn == true) { DownloadManager.AbortDownload(saveAs); } } } while (goOn == false); return(saveAs); }
private void Stop(object sender, RoutedEventArgs e) { DownloadManager.AbortDownload(); }