internal void BtnStart_Click(object sender, EventArgs e) { //UpdateColor(); UpdateColor(EntryFormName); UpdateColours(NewSvcEnty); btnCopy.Enabled = false; btnDelete.Enabled = false; btnCancel.Enabled = false; if (btnStart.Text == "Stopped") { DialogResult dialogResult = MessageBox.Show("Would you like to Start the service: ", "Start Service", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { //Start Service /* * btnStart.BackColor = Color.Green; * btnStart.Text = "Running"; * btnStart.ForeColor = Color.White; * StopStartServiceFlag = true; */ StopStart(Color.Green, "Running", true); NewSvcEntyNames.UpdateServiceButton("Running"); } } else { DialogResult dialogResult = MessageBox.Show("Would you like to Stop the service: ", "Start Service", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { //Start Service /* * btnStart.BackColor = Color.Red; * btnStart.Text = "Stopped"; * btnStart.ForeColor = Color.White; * StopStartServiceFlag = false; */ StopStart(Color.Red, "Stopped", false); NewSvcEntyNames.UpdateServiceButton("Stopped"); } } }
private void BtnDelete_Click(object sender, EventArgs e) { //btnDelete.BackColor = Color.Red; //btnDelete.ForeColor = Color.White; //MessageBox.Show(EntryFormName); if (!string.IsNullOrEmpty(EntryFormName)) { DialogResult dialogResult = MessageBox.Show("Delete: " + EntryFormName, "Delete Service Entry", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { flpEntryForm.Controls.Remove(lab); NewSvcEnty.DeleteEntry(EntryFormName); } } // lab.BackColor = Color.Gray; lab.BackColor = Color.LightGray; EntryFormName = ""; btnCopy.Enabled = false; btn_AddNewEntry.Enabled = true; btnDelete.Enabled = false; //btnDelete.BackColor = Color.LightGray; //btnDelete.ForeColor = Color.LightGray; btnCancel.Enabled = false; // If there are no more entries/services then set // Service button to Stopped and disable it // and update xml file with status of Stopped if (NewSvcEntyInstance.Count == 0) { StopStart(Color.Red, "Stopped", false); btnStart.Enabled = false; NewSvcEntyNames.UpdateServiceButton("Stopped"); } }