/// <summary> /// Fügt eine Quelle zur Liste der zuletzt verwendeten Quellen hinzu. Ist der /// Eintrag bereits vorhanden, so wird er an den Anfang der Liste verschoben. /// </summary> /// <param name="station">Der Name der Quelle.</param> public static void AddRecentChannel(string station) { // Not allowed if (string.IsNullOrEmpty(station)) { return; } // Remove first RecentChannels.Remove(station); // Append to head RecentChannels.Insert(0, station); // Correct and save Update(); }
/// <summary> /// Begrenzt die Anzahl der zuletzt verwendeten Quellen auf die Höchstgrenze. /// </summary> /// <returns>Gesetzt, wenn eine Reduktion vorgenommen wurde.</returns> private static bool LimitChannels() { // Check delta int delta = (RecentChannels.Count - MaxRecentChannels); if (delta < 1) { return(false); } // Cut off while (delta-- > 0) { RecentChannels.RemoveAt(MaxRecentChannels); } // Did it return(true); }