public void RemoveTorrentSource(TorrentSourceType tsType) { string[] sources = AppSettings.TorrentSources.Split(';'); string newSetting = string.Empty; string sType = ((int)tsType).ToString(); foreach (string src in sources) { if (string.IsNullOrEmpty(src)) { continue; } if (src.Trim() == sType) { continue; } if (!string.IsNullOrEmpty(newSetting)) { newSetting += ";"; } newSetting += src; } AppSettings.TorrentSources = newSetting; RefreshTorrentSources(); }
protected override void OnPageLoad() { base.OnPageLoad(); curBrowseSource = BaseConfig.Settings.DefaultTorrentSource; ClearGUIProperty(GuiProperty.Download_Status); SetGUIProperty(GuiProperty.Torrent_Summary, Translation.Starting + "..."); SetGUIProperty(GuiProperty.Search_ResultDescription, Translation.NoResults); ClearGUIProperty(GuiProperty.Search_Summary); if (!MainWindow.uTorrent.Initialised) MainWindow.uTorrent.Init(); ShowPageTorrents(); // this means we are in search mode if (MainWindow.currentDownloadSearch != null) { ShowPageSearch(false); PerformTorrentSearchAsync(); btnSearchPage.Focus = true; } }
public int MoveDownTorrentSource(TorrentSourceType tsType) { string[] sources = AppSettings.TorrentSources.Split(';'); string sType = ((int)tsType).ToString(); List <string> sourcesList = new List <string>(); // get a list of valid sources foreach (string src in sources) { if (string.IsNullOrEmpty(src)) { continue; } sourcesList.Add(src); } // find the position of the source to be moved int pos = -1; for (int i = 0; i < sourcesList.Count; i++) { if (sourcesList[i].Trim() == sType) { pos = i; } } if (pos == -1) { return(-1); // not found } if (pos == sourcesList.Count - 1) { return(-1); // already at bottom } string lan1 = sourcesList[pos + 1]; sourcesList[pos + 1] = sType; sourcesList[pos] = lan1; string newSetting = string.Empty; foreach (string lan in sourcesList) { if (!string.IsNullOrEmpty(newSetting)) { newSetting += ";"; } newSetting += lan; } AppSettings.TorrentSources = newSetting; RefreshTorrentSources(); return(pos + 1); }
private ContextMenuAction ShowBrowseSources(TorrentLink torLink) { ContextMenu cmenu = new ContextMenu(Translation.SelectSource); cmenu.Add("<<< " + Translation.Browse, () => ShowContextMenuBrowse(torLink)); foreach (TorrentSource src in Enum.GetValues(typeof(TorrentSource))) { TorrentSource local = src; cmenu.AddAction(DownloadHelper.GetTorrentSourceDescription(src), () => { curBrowseSource = local; PerformTorrentBrowseAsync(); }); } return cmenu.Show(); }
public void AddTorrentSource(TorrentSourceType tsType) { string sType = ((int)tsType).ToString(); string newSetting = AppSettings.TorrentSources; if (!string.IsNullOrEmpty(newSetting)) { newSetting += ";"; } newSetting += sType; AppSettings.TorrentSources = newSetting; RefreshTorrentSources(); }
public static string TorrentSourceTranslatedShort(TorrentSourceType tsType) { switch (tsType) { case TorrentSourceType.TokyoToshokanAnime: return("TT"); case TorrentSourceType.TokyoToshokanAll: return("TT"); case TorrentSourceType.BakaBT: return("BakaBT"); case TorrentSourceType.Nyaa: return("Nyaa"); case TorrentSourceType.Sukebei: return("SukeNyaa"); case TorrentSourceType.AnimeBytes: return("AByt.es"); default: return("TT"); } }
public static string TorrentSourceTranslated(TorrentSourceType tsType) { switch (tsType) { case TorrentSourceType.TokyoToshokanAnime: return("Tokyo Toshokan (Anime)"); case TorrentSourceType.TokyoToshokanAll: return("Tokyo Toshokan (All)"); case TorrentSourceType.BakaBT: return("BakaBT"); case TorrentSourceType.Nyaa: return("Nyaa"); case TorrentSourceType.AnimeSuki: return("Anime Suki"); case TorrentSourceType.AnimeBytes: return("Anime Byt.es"); default: return("Tokyo Toshokan (Anime)"); } }
public TorrentLinkVM(TorrentSourceType tsType) { Source = new TorrentSourceVM(tsType, true); }
public TorrentSourceVM(TorrentSourceType tsType, bool isEnabled) { TorrentSource = tsType; IsEnabled = isEnabled; }
public TorrentsTokyoToshokan(TorrentSourceType tsType) { SourceType = tsType; }
public static TorrentSource Create(TorrentSourceType tsType, bool isEnabled) { return(new VM_TorrentSource(tsType, isEnabled)); }
public void RemoveTorrentSource(TorrentSourceType tsType) { string[] sources = AppSettings.TorrentSources.Split(';'); string newSetting = string.Empty; string sType = ((int)tsType).ToString(); foreach (string src in sources) { if (string.IsNullOrEmpty(src)) continue; if (src.Trim() == sType) continue; if (!string.IsNullOrEmpty(newSetting)) newSetting += ";"; newSetting += src; } AppSettings.TorrentSources = newSetting; RefreshTorrentSources(); }
public static string TorrentSourceTranslated(TorrentSourceType tsType) { switch (tsType) { case TorrentSourceType.TokyoToshokanAnime: return "Tokyo Toshokan (Anime)"; case TorrentSourceType.TokyoToshokanAll: return "Tokyo Toshokan (All)"; case TorrentSourceType.BakaBT: return "BakaBT"; case TorrentSourceType.Nyaa: return "Nyaa"; case TorrentSourceType.Sukebei: return "Sukebei Nyaa"; case TorrentSourceType.AnimeBytes: return "AnimeBytes"; default: return "Tokyo Toshokan (Anime)"; } }
public void AddTorrentSource(TorrentSourceType tsType) { string sType = ((int)tsType).ToString(); string newSetting = AppSettings.TorrentSources; if (!string.IsNullOrEmpty(newSetting)) newSetting += ";"; newSetting += sType; AppSettings.TorrentSources = newSetting; RefreshTorrentSources(); }
public int MoveUpTorrentSource(TorrentSourceType tsType) { string[] sources = AppSettings.TorrentSources.Split(';'); string sType = ((int)tsType).ToString(); List<string> sourcesList = new List<string>(); // get a list of valid sources foreach (string src in sources) { if (string.IsNullOrEmpty(src)) continue; sourcesList.Add(src); } // find the position of the source to be moved int pos = -1; for (int i = 0; i < sourcesList.Count; i++) { if (sourcesList[i].Trim() == sType) pos = i; } if (pos == -1) return -1; // not found if (pos == 0) return -1; // already at top string lan1 = sourcesList[pos - 1]; sourcesList[pos - 1] = sType; sourcesList[pos] = lan1; string newSetting = string.Empty; foreach (string src in sourcesList) { if (!string.IsNullOrEmpty(newSetting)) newSetting += ";"; newSetting += src; } AppSettings.TorrentSources = newSetting; RefreshTorrentSources(); return pos - 1; }
public static string TorrentSourceTranslatedShort(TorrentSourceType tsType) { switch (tsType) { case TorrentSourceType.TokyoToshokanAnime: return "TT"; case TorrentSourceType.TokyoToshokanAll: return "TT"; case TorrentSourceType.BakaBT: return "BakaBT"; case TorrentSourceType.Nyaa: return "Nyaa"; case TorrentSourceType.AnimeSuki: return "Suki"; case TorrentSourceType.AnimeBytes: return "AByt.es"; default: return "TT"; } }
public VM_TorrentSource(TorrentSourceType tsType, bool isEnabled) : base(tsType, isEnabled) { }