private void UpdateServiceStatus() { try { if (!ServiceManager.DoesServiceExist("SmokeSignalSrvc")) { ServiceStatusLabel.Text = "Not installed!!!"; ServiceStatusLabel.ForeColor = Color.Red; } else { ServiceControllerStatus status = ServiceManager.ServiceStatus("SmokeSignalSrvc"); string s = status.ToString(); Color c = Color.Green; if (status != ServiceControllerStatus.Running) { c = Color.YellowGreen; } s += serviceConfigured ? ", configured" : ", not configured"; ServiceStatusLabel.ForeColor = c; ServiceStatusLabel.Text = s; } } finally { OnDelay.Do(UpdateServiceStatus, 5 * 1000); } }
private void Form1_Load(object sender, EventArgs e) { this.ValidateChildren(); serviceConfigured = (InvalidControls == 0); UpdateServiceStatus(); StartingUp = false; OnDelay.InAMoment(CheckForUpdateSilent); }
private void AboutButton_Click(object sender, EventArgs e) { AboutWindow aw = new AboutWindow(); DialogResult result = aw.ShowDialog(); aw.Close(); if (result == DialogResult.OK) { OnDelay.InAMoment(CheckForUpdateUI); } }