private void UpdateWeather() { if (GlobalReference.GlobalValues.TickCounter % 4 == 0) { bool precipitatonDirectionUp = true; bool windSpeedDirectionUp = true; NotifyPrecipitation = false; NotifyWindSpeed = false; if (Precipitation == PrecipitationGoal) { PrecipitationGoal = GlobalReference.GlobalValues.Random.Next(100); } if (WindSpeed == WindSpeedGoal) { WindSpeedGoal = GlobalReference.GlobalValues.Random.Next(100); } if (PrecipitationGoal > Precipitation) { Precipitation++; } else if (PrecipitationGoal < Precipitation) { Precipitation--; precipitatonDirectionUp = false; } if (WeatherTriggers.Keys.Contains(Precipitation)) { if ((precipitatonDirectionUp && NotifyUp.Contains(Precipitation)) || (!precipitatonDirectionUp && NotifyDown.Contains(Precipitation))) { NotifyPrecipitation = true; } } if (WindSpeedGoal > WindSpeed) { WindSpeed++; } else if (WindSpeedGoal < WindSpeed) { WindSpeed--; windSpeedDirectionUp = false; } if (WeatherTriggers.Keys.Contains(WindSpeed)) { if ((windSpeedDirectionUp && NotifyUp.Contains(WindSpeed)) || (!windSpeedDirectionUp && NotifyDown.Contains(WindSpeed))) { NotifyWindSpeed = true; } } } }
public MainForm() { InitializeComponent(); NotifyUp.ShowBalloonTip(1000, "System Uptime", "Run", ToolTipIcon.Info); bwUp.RunWorkerAsync(); if (Startup()) { autorunToolStripMenuItem.Checked = true; } else { autorunToolStripMenuItem.Checked = false; } }