public void AddCarPartCollection(AaronCarPartCollection collection) { if (_carPartCollections.Contains(collection)) { throw new ArgumentException("Attempted to add a duplicate car part collection"); } _carPartCollections.Add(collection); }
private void ProcessCarHashList(Chunk chunk) { if (chunk.Size % 4 != 0) { throw new InvalidDataException("malformed car hash list chunk"); } Progress?.Report("Processing car part collection hash list"); while (Stream.Position < chunk.EndOffset) { AaronCarPartCollection carPartCollection = new AaronCarPartCollection(); carPartCollection.Name = HashResolver.Resolve(Reader.ReadUInt32()); carPartCollection.Parts = new SynchronizedObservableCollection <AaronCarPartRecord>(); this._carPartService.AddCarPartCollection(carPartCollection); } }
public AaronCarPartCollection ReplaceCarPartCollection(uint hash, AaronCarPartCollection collection) { var index = _carPartCollections.IndexOf(GetCarPartCollectionByHash(hash)); return(_carPartCollections[index] = collection); }