private void AddLabel(TorrentLabel label) { var comboItem = new ComboBoxItem { Content = label.Name, Background = label.Brush, Foreground = label.ForegroundBrush, Tag = label }; labelList.Items.Insert(labelList.Items.Count - 2, comboItem); var menuItem = new MenuItem { Header = label.Name, Background = label.Brush, Foreground = label.ForegroundBrush, Tag = label }; menuItem.Click += setLabelOnTorrentClicked; torrentGridContextMenuSetLabelMenu.Items.Insert(0, menuItem); menuItem = new MenuItem { Header = label.Name, Background = label.Brush, Foreground = label.ForegroundBrush, Tag = label }; menuItem.Click += setLabelOnTorrentClicked; menuSetLabelMenu.Items.Insert(0, menuItem); }
public void SetToDefaults() { // General SaveSession = true; AutoUpdate = true; PromptForSaveOnShellLinks = true; DeleteTorrentsAfterAdd = false; SeedOnlyWhenIdle = false; // Downloads DefaultDownloadLocation = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads"); PostCompletionDestination = string.Empty; WatchedDirectories = new WatchedDirectory[0]; // Connection IncomingPort = 22239; UseRandomPort = false; MapWithUPnP = false; MaxUploadSpeed = 0; MaxDownloadSpeed = 0; MaxConnections = 500; MaxConnectionsPerTorrent = 100; UploadSlotsPerTorrent = 4; // BitTorrent EnableDHT = true; EncryptionSettings = EncryptionTypes.RC4Header | EncryptionTypes.RC4Full; HoursToSeed = 0; TargetSeedRatio = 0; // Interface ShowTrayIcon = true; CloseToSystemTray = true; MinimizeToSystemTray = false; ShowNotificationOnCompletion = true; ConfirmExitWhenActive = true; ConfirmTorrentRemoval = true; WarnOnDangerousFiles = true; WarnWhenRunningAsAdministrator = true; StartTorrentsImmediately = true; DoubleClickSeeding = DoubleClickAction.OpenFolder; DoubleClickDownloading = DoubleClickAction.OpenFolder; // Completion TorrentCompletionCommand = string.Empty; // RSS RssFeeds = new RssFeed[0]; MinutesBetweenRssUpdates = 5; // Other RecentDownloadLocations = new string[0]; Labels = new TorrentLabel[0]; TotalBytesDownloaded = TotalBytesUploaded = 0; WindowWidth = WindowHeight = -1; Maximized = false; }