public static void Resume() { if (isPaused) { isPaused = false; watcher.Start(); StartTimer(); pi.Notify("Running", "TorrentFlow is now running.", 1000); } else { pi.Notify("Already Running", "TorrentFlow is already running.", 1000); } }
public static void Initialize() { if (!(Utilites.IsNullOrEmpty(Properties.Settings.Default.FTPUploadPath) || Utilites.IsNullOrEmpty(Properties.Settings.Default.FTPAddress) || Utilites.IsNullOrEmpty(Properties.Settings.Default.FTPUsername))) { var credentials = new NetworkCredential(Properties.Settings.Default.FTPUsername, Utilites.StringCipher.Decrypt(Properties.Settings.Default.FTPPassword, "TorrentFlow")); ftpClient = new FTPClient(); var host = Properties.Settings.Default.FTPAddress; if (!host.StartsWith("ftp://")) { host = "ftp://" + host; } if (Properties.Settings.Default.FTPPort != 0) { host = String.Format("{0}:{1}", host, Properties.Settings.Default.FTPPort.ToString()); } ftpClient.Host = host; ftpClient.Credentials = credentials; ftpClient.EncryptionMode = Properties.Settings.Default.FTPEncryptionMode; } else { pi.Notify("Not Uploading", "No FTP server configured.", 3000); } if (!Utilites.IsNullOrEmpty(Properties.Settings.Default.WatchDirectory)) { watcher = new DirectoryWatcher(Properties.Settings.Default.WatchDirectory, NewTorrentFileDetected, NotifyFilters.LastWrite | NotifyFilters.CreationTime); watcher.SetFilter("*.torrent"); watcher.Start(); } else { pi.Notify("Not Watching", "TorrentFlow is not watching for torrent files.", 3000); } if (!Utilites.IsNullOrEmpty(Properties.Settings.Default.DownloadDirectory)) { //ftpClient.DownloadStatusChanged += OnDownloadStatusChanged; StartTimer(); } else { pi.Notify("Not Downloading", "TorrentFlow will not download any files.", 3000); } }
public static void Initialize() { ftp = new FTPClient(Properties.Settings.Default.FTPAddress, Properties.Settings.Default.FTPUsername, StringCipher.Decrypt(Properties.Settings.Default.FTPPassword, "TorrentFlow")); if (!Utilites.IsNullOrEmpty(Properties.Settings.Default.WatchDirectory)){ watcher = new DirectoryWatcher(Properties.Settings.Default.WatchDirectory, NewTorrentFileDetected, NotifyFilters.LastWrite); watcher.SetFilter("*.torrent"); watcher.Start(); } else { pi.Notify("Not Watching", "TorrentFlow is not watching for torrent files.", 5000); } if (!Utilites.IsNullOrEmpty(Properties.Settings.Default.DownloadDirectory)) { StartTimer(); } else { pi.Notify("Not Downloading", "Torrentflow will not download any files.", 5000); } }
public static void Initialize() { ftp = new FTPClient(Properties.Settings.Default.FTPAddress, Properties.Settings.Default.FTPUsername, StringCipher.Decrypt(Properties.Settings.Default.FTPPassword, "TorrentFlow")); if (!Utilites.IsNullOrEmpty(Properties.Settings.Default.WatchDirectory)) { watcher = new DirectoryWatcher(Properties.Settings.Default.WatchDirectory, NewTorrentFileDetected, NotifyFilters.LastWrite); watcher.SetFilter("*.torrent"); watcher.Start(); } else { pi.Notify("Not Watching", "TorrentFlow is not watching for torrent files.", 5000); } if (!Utilites.IsNullOrEmpty(Properties.Settings.Default.DownloadDirectory)) { StartTimer(); } else { pi.Notify("Not Downloading", "Torrentflow will not download any files.", 5000); } }