Пример #1
0
 public void AddCarAccessory(CarAccessory carAccessory)
 {
     _carAccessories.Add(carAccessory);
 }
Пример #2
0
 public void RemoveCarAccessory(CarAccessory carAccessory)
 {
     _carAccessories.Remove(carAccessory);
 }
Пример #3
0
        public WholeColor(string name, int colorNum, bool isPainted, CarBrand brand = null, CarAccessory accessory = null)
        {
            this.Name      = name;
            this.ColorNum  = colorNum;
            this.IsPainted = isPainted;

            if (brand == null)
            {
                this.Brand = CarBrand.Empty;
            }
            else
            {
                this.Brand = brand;
            }

            if (accessory == null)
            {
                this.Accessory = CarAccessory.Empty;
            }
            else
            {
                this.Accessory = accessory;
            }


            this.OnConstructed();
        }