示例#1
0
 public void AddTunning(ITunningPart part)
 {
     if (!this.tunningParts.Contains(part))
     {
         this.tunningParts.Add(part);
     };
 }
示例#2
0
        public void AddTunning(ITunningPart part)
        {
            var adding = this.TunningParts as List <ITunningPart>;

            adding.Add(part);
            this.TunningParts = adding as IEnumerable <ITunningPart>;
        }
示例#3
0
 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);
        }
示例#5
0
        public bool RemoveTunning(ITunningPart part)
        {
            var result = this.tuningParts.Contains(part);

            if (result)
            {
                this.tuningParts.Remove(part);
            }

            return(result);
        }
示例#6
0
        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);
        }
示例#7
0
 public bool RemoveTunning(ITunningPart part)
 {
     if (this.TunningParts.Contains(part))
     {
         this.TunningParts = this.TunningParts.Except(new List <ITunningPart> {
             part
         });
         return(true);
     }
     return(false);
 }
示例#8
0
        public bool RemoveTunning(ITunningPart part)
        {
            if (this.tunningParts.Contains(part))
            {
                return(this.tunningParts.Remove(part));
            }

            else
            {
                return(false);
            }
        }
示例#9
0
        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);
            }
        }
示例#10
0
        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();
 }
示例#12
0
        public bool RemoveTunning(ITunningPart part)
        {
            if (this.tunningParts.Contains(part))
            {
                return this.tunningParts.Remove(part);
            }

            else return false;
        }
示例#13
0
 public void AddTunning(ITunningPart part)
 {
     this.tunningParts.Add(part);
 }
示例#14
0
 public bool RemoveTunning(ITunningPart part)
 {
     throw new NotImplementedException();
 }
示例#15
0
 public void AddTunning(ITunningPart part)
 {
     throw new NotImplementedException();
 }
 public bool RemoveTunning(ITunningPart part)
 {
     return(this.tunningParts.Remove(part));
 }
 public void AddTunning(ITunningPart part)
 {
     throw new NotImplementedException();
 }