public void Delete(object toDel) { for (int i = 0; i < toBuy.Count; ++i) { TrashObj ob = toBuy[i] as TrashObj; if (ob == null) { continue; } if (toDel == ob.stored) { toBuy.RemoveAt(i); return; } } }
public void Add(TrashObj toAdd) { toBuy.Add(toAdd); }