int CompareByWeight(IFitting f1, IFitting f2) { if (f1.Weight < f2.Weight) return 1; if (f1.Weight > f2.Weight) return -1; return 0; }
public bool Add(IFitting item) { Box b = item as Box; if (b != null) { foreach (Box old in Boxes) if (old.Id == b.Id) return false; Boxes.Add(b); } return true; }