public void SortEntries() { if (PartSets != null) { PartSets.Sort((x, y) => x.SortID - y.SortID); } if (Part_Colors != null) { Part_Colors.Sort((x, y) => x.SortID - y.SortID); foreach (var partColor in Part_Colors) { partColor._Colors.Sort((x, y) => x.SortID - y.SortID); } } if (Bodies != null) { Bodies.Sort((x, y) => x.SortID - y.SortID); } }
public PartColor GetPartColors(string id, string name) { if (Part_Colors == null) { Part_Colors = new List <PartColor>(); } int index = Part_Colors.FindIndex(p => (p.Index == id)); if (index != -1) { return(Part_Colors[index]); } else { PartColor newPartColor = new PartColor() { Index = id, Str_00 = name, _Colors = new List <Colors>() }; Part_Colors.Add(newPartColor); return(newPartColor); } }