public void Add(UTransit.Models.Bus bus) { lock (bus) { if (Count == RegistrantionNo.Length) { var newLength = RegistrantionNo.Length + 1000; var registrantionNo = new string[newLength]; RegistrantionNo.CopyTo(registrantionNo, 0); RegistrantionNo = registrantionNo; var type = new string[newLength]; Type.CopyTo(type, 0); Type = type; var color = new string[newLength]; Color.CopyTo(color, 0); Color = color; } RegistrantionNo[Count] = bus.RegistrantionNo; Type[Count] = bus.Type; Color[Count] = bus.Color; Count++; } }
public void Add(UTransit.Models.Bus bus) { lock (bus) { if (Heigth > _limit - 1) { if (index == _limit) { index = 0; } Next[index].Add(bus); index++; } else { Next[Heigth] = new Bus(1000); Next[index].Add(bus); Heigth++; } } }