public void AddTunning(ITunningPart part) { if (!this.tunningParts.Contains(part)) { this.tunningParts.Add(part); }; }
public void AddTunning(ITunningPart part) { var adding = this.TunningParts as List <ITunningPart>; adding.Add(part); this.TunningParts = adding as IEnumerable <ITunningPart>; }
public void AddTunning(ITunningPart part) { if (!this.tunningParts.Contains(part)) { this.tunningParts.Add(part); } ; }
public void AddTunning(ITunningPart part) { if (this.TunningParts.Any(x => x.GetType().BaseType == part.GetType().BaseType)) { var message = GlobalConstants.CannotAddMultiplePartsOfTheSameTypeToVehicleExceptionMessage; var parameter = part.GetType().Name; throw new TunningDuplicationException(message, parameter); } this.tunningParts.Add(part); }
public bool RemoveTunning(ITunningPart part) { var result = this.tuningParts.Contains(part); if (result) { this.tuningParts.Remove(part); } return(result); }
public void AddTunning(ITunningPart part) { // TODO: NUll if (this.tuningParts.Any(existing => existing.GetType().BaseType == part.GetType().BaseType)) { // TODO : probly incorrect ( 1 part PER type ? ) throw new TunningDuplicationException("This part has already been installed"); } this.tuningParts.Add(part); }
public bool RemoveTunning(ITunningPart part) { if (this.TunningParts.Contains(part)) { this.TunningParts = this.TunningParts.Except(new List <ITunningPart> { part }); return(true); } return(false); }
public bool RemoveTunning(ITunningPart part) { if (this.tunningParts.Contains(part)) { return(this.tunningParts.Remove(part)); } else { return(false); } }
public bool RemoveTunning(ITunningPart part) { var removing = this.TunningParts as List <ITunningPart>; if (removing.Contains(part)) { removing.Remove(part); this.TunningParts = removing as IEnumerable <ITunningPart>; return(true); } else { return(false); } }
public void AddTunning(ITunningPart part) { var partType = part.GetType(); foreach (var p in TunningParts) { if (p.GetType() == partType) { throw new TunningDuplicationException(GlobalConstants.CannotAddMultiplePartsOfTheSameTypeToVehicleExceptionMessage); } } this.TunningParts = this.TunningParts.Concat(new List <ITunningPart> { part }); }
public bool RemoveTunning(ITunningPart part) { throw new NotImplementedException(); }
public bool RemoveTunning(ITunningPart part) { if (this.tunningParts.Contains(part)) { return this.tunningParts.Remove(part); } else return false; }
public void AddTunning(ITunningPart part) { this.tunningParts.Add(part); }
public void AddTunning(ITunningPart part) { throw new NotImplementedException(); }
public bool RemoveTunning(ITunningPart part) { return(this.tunningParts.Remove(part)); }