Ejemplo n.º 1
0
        public static void PlantChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            UserControl_FloraConfig floraConfig = (UserControl_FloraConfig)o;

            if (floraConfig != null)
            {
                if (floraConfig.PlantName != floraConfig.Plant.PlantName)
                {
                    floraConfig.PlantName = floraConfig.Plant.PlantName;
                    floraConfig.OnPropertyChanged("PlantName");
                }
                if (floraConfig.PlantImagePath != floraConfig.Plant.PlantImagePath)
                {
                    floraConfig.PlantImagePath = floraConfig.Plant.PlantImagePath;
                    floraConfig.OnPropertyChanged("PlantImagePath");
                }
                if (floraConfig.GrowthDuration != floraConfig.Plant.GrowthDuration)
                {
                    floraConfig.GrowthDuration = floraConfig.Plant.GrowthDuration;
                    floraConfig.OnPropertyChanged("GrowthDuration");
                }
                if (floraConfig.HealthPoints != floraConfig.Plant.HealthPoints)
                {
                    floraConfig.HealthPoints = floraConfig.Plant.HealthPoints;
                    floraConfig.OnPropertyChanged("HealthPoints");
                }
                if (floraConfig.BioreactorCharge != floraConfig.Plant.BioreactorCharge)
                {
                    floraConfig.BioreactorCharge = floraConfig.Plant.BioreactorCharge;
                    floraConfig.OnPropertyChanged("BioreactorCharge");
                }
                if (floraConfig.CanEat != floraConfig.Plant.CanEat)
                {
                    floraConfig.CanEat = floraConfig.Plant.CanEat;
                    floraConfig.OnPropertyChanged("CanEat");
                }
                if (floraConfig.NutrientsAmount != floraConfig.Plant.NutrientsAmount)
                {
                    floraConfig.NutrientsAmount = floraConfig.Plant.NutrientsAmount;
                    floraConfig.OnPropertyChanged("NutrientsAmount");
                }
                if (floraConfig.WaterAmount != floraConfig.Plant.WaterAmount)
                {
                    floraConfig.WaterAmount = floraConfig.Plant.WaterAmount;
                    floraConfig.OnPropertyChanged("WaterAmount");
                }
                if (floraConfig.Decomposes != floraConfig.Plant.Decomposes)
                {
                    floraConfig.Decomposes = floraConfig.Plant.Decomposes;
                    floraConfig.OnPropertyChanged("Decomposes");
                }
                if (floraConfig.DecompositionSpeed != floraConfig.Plant.DecompositionSpeed)
                {
                    floraConfig.DecompositionSpeed = floraConfig.Plant.DecompositionSpeed;
                    floraConfig.OnPropertyChanged("DecompositionSpeed");
                }
            }
        }
Ejemplo n.º 2
0
        public static void PlantNameChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            UserControl_FloraConfig floraConfig = (UserControl_FloraConfig)o;

            if (floraConfig != null)
            {
                if (floraConfig.PlantName != floraConfig.Plant.PlantName)
                {
                    floraConfig.PlantName = floraConfig.Plant.PlantName;
                    floraConfig.OnPropertyChanged("PlantName");
                }
            }
        }