using System; using System.Collections.Generic; public class FavoriteManager { List favs = new List(); public int Length { get { return favs.Count; } } public Favorite this[int i] { set { if (i < 0 || i >= favs.Count) throw new ArgumentOutOfRangeException("i", i, "Ungültiger Index"); favs[i] = value; } get { if (i < 0 || i >= favs.Count) throw new ArgumentOutOfRangeException("i", i, "Ungültiger Index"); return favs[i]; } } }