Ejemplo n.º 1
0
        public void Copy(Features newFeatures)
        {
            if (newFeatures == null)
            {
                throw new ArgumentNullException("newFeatures");
            }

            if (newFeatures.IsBedroomsModified)
            {
                Bedrooms = newFeatures.Bedrooms;
            }

            if (newFeatures.IsBathroomsModified)
            {
                Bathrooms = newFeatures.Bathrooms;
            }

            if (newFeatures.IsToiletsModified)
            {
                Toilets = newFeatures.Toilets;
            }

            if (newFeatures.IsCarParkingModified)
            {
                if (newFeatures.CarParking == null)
                {
                    CarParking = null;
                }
                else
                {
                    if (CarParking == null)
                    {
                        CarParking = new CarParking();
                    }

                    if (newFeatures.CarParking.IsModified)
                    {
                        CarParking.Copy(newFeatures.CarParking);
                    }

                    IsCarParkingModified = true;
                }
            }

            if (newFeatures.IsEnsuitesModified)
            {
                Ensuites = newFeatures.Ensuites;
            }

            if (newFeatures.IsLivingAreasModified)
            {
                LivingAreas = newFeatures.LivingAreas;
            }

            if (newFeatures.IsTagsModified)
            {
                Tags = newFeatures.Tags;
            }
        }