Exemplo n.º 1
0
        public void OnRoadTempCalculation(List <int> side)
        {
            AverageAmbientTemp = AverageAmbientTemperature(side);
            var onRoadTemperates = new List <int>();


            foreach (var temp in side)
            {
                if (temp > AverageAmbientTemp)
                {
                    onRoadTemperates.Add(temp);
                }
            }

            MaxTemp           = onRoadTemperates.Max();
            AverageOnRoadTemp = onRoadTemperates.Average();



            Console.WriteLine($"Average Temperate: " + AverageAmbientTemp.ToString());
            Console.WriteLine($"Rounded Average Temp: " + Math.Round(AverageAmbientTemp, 2).ToString());
            Console.WriteLine($"Max on Road Temp: " + MaxTemp.ToString());
            Console.WriteLine($"Average On Road Temp: " + AverageOnRoadTemp.ToString());
            Console.WriteLine($"Rounded Average on Road Temp: " + Math.Round(AverageOnRoadTemp, 2).ToString());
        }
Exemplo n.º 2
0
 public override int GetHashCode()
 {
     return(DayOfMonth.GetHashCode() ^ MaxTemp.GetHashCode() ^ MinTemp.GetHashCode());
 }
        void ReleaseDesignerOutlets()
        {
            if (Humidity != null)
            {
                Humidity.Dispose();
                Humidity = null;
            }

            if (HumidityLabel != null)
            {
                HumidityLabel.Dispose();
                HumidityLabel = null;
            }

            if (MaxTemp != null)
            {
                MaxTemp.Dispose();
                MaxTemp = null;
            }

            if (MinTemp != null)
            {
                MinTemp.Dispose();
                MinTemp = null;
            }

            if (Pressure != null)
            {
                Pressure.Dispose();
                Pressure = null;
            }

            if (PressureLabel != null)
            {
                PressureLabel.Dispose();
                PressureLabel = null;
            }

            if (ShowDetails != null)
            {
                ShowDetails.Dispose();
                ShowDetails = null;
            }

            if (showHideLabel != null)
            {
                showHideLabel.Dispose();
                showHideLabel = null;
            }

            if (SomeDetailsView != null)
            {
                SomeDetailsView.Dispose();
                SomeDetailsView = null;
            }

            if (Temperature != null)
            {
                Temperature.Dispose();
                Temperature = null;
            }

            if (TemperatureLabel != null)
            {
                TemperatureLabel.Dispose();
                TemperatureLabel = null;
            }

            if (TempMaxLabel != null)
            {
                TempMaxLabel.Dispose();
                TempMaxLabel = null;
            }

            if (TempMinLabel != null)
            {
                TempMinLabel.Dispose();
                TempMinLabel = null;
            }

            if (Town != null)
            {
                Town.Dispose();
                Town = null;
            }

            if (WindSpeed != null)
            {
                WindSpeed.Dispose();
                WindSpeed = null;
            }

            if (WindSpeedLabel != null)
            {
                WindSpeedLabel.Dispose();
                WindSpeedLabel = null;
            }
        }