/// <summary> /// Fills controls related to Dev errors /// </summary> private void FillDevErrorsControls() { if (rbRemoteServer.Checked && String.IsNullOrEmpty(txtRemoteServerName.Text)) { return; } DevelopmentErrors de = new DevelopmentErrors(this.txtRemoteServerName.Text, this.rbRemoteServer.Checked); if (de.GetStatus()) { using (Stream myStream = currentAssembly.GetManifestResourceStream("CrmDiagTool2011.Images.bullet_green.png")) { this.btn_devErrors_status.Image = new Bitmap(myStream); } this.btn_devErrors_status.Text = "Turn DevErrors Off"; } else { using (Stream myStream = currentAssembly.GetManifestResourceStream("CrmDiagTool2011.Images.bullet_red.png")) { this.btn_devErrors_status.Image = new Bitmap(myStream); } this.btn_devErrors_status.Text = "Turn DevErrors On"; } this.pnlDevErrors.Enabled = true; }
private void btn_devErrors_status_Click(object sender, EventArgs e) { try { DevelopmentErrors de = new DevelopmentErrors(); if (btn_devErrors_status.Text == @"Turn DevErrors Off") { de.SetStatus(false); } else if (btn_devErrors_status.Text == @"Turn DevErrors On") { de.SetStatus(true); } // Refresh the current status to see if the change worked or not... if (de.GetStatus()) { using (Stream myStream = currentAssembly.GetManifestResourceStream("Dynamics365Tracer.Images.bullet_green.png")) { // ReSharper disable once AssignNullToNotNullAttribute btn_devErrors_status.Image = new Bitmap(myStream); } btn_devErrors_status.Text = @"Turn DevErrors Off"; } else { using (Stream myStream = currentAssembly.GetManifestResourceStream("Dynamics365Tracer.Images.bullet_red.png")) { // ReSharper disable once AssignNullToNotNullAttribute btn_devErrors_status.Image = new Bitmap(myStream); } btn_devErrors_status.Text = @"Turn DevErrors On"; } } catch (NotCrmWebServerException) { tpDevErrors.Enabled = false; } catch (Exception error) { MessageBox.Show(this, @"Error while updating devErrors settings: " + error.Message, @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btn_devErrors_status_Click(object sender, EventArgs e) { try { DevelopmentErrors de = new DevelopmentErrors(this.txtRemoteServerName.Text, this.rbRemoteServer.Checked); if (this.btn_devErrors_status.Text == "Turn DevErrors Off") { de.SetStatus(false); } else if (this.btn_devErrors_status.Text == "Turn DevErrors On") { de.SetStatus(true); } // Refresh the current status to see if the change worked or not... if (de.GetStatus()) { using (Stream myStream = currentAssembly.GetManifestResourceStream("CrmDiagTool2011.Images.bullet_green.png")) { this.btn_devErrors_status.Image = new Bitmap(myStream); } this.btn_devErrors_status.Text = "Turn DevErrors Off"; } else { using (Stream myStream = currentAssembly.GetManifestResourceStream("CrmDiagTool2011.Images.bullet_red.png")) { this.btn_devErrors_status.Image = new Bitmap(myStream); } this.btn_devErrors_status.Text = "Turn DevErrors On"; } } catch (Exception error) { MessageBox.Show(this, "Error while updating devErrors settings: " + error.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// Fills controls related to Dev errors /// </summary> private void FillDevErrorsControls() { DevelopmentErrors de = new DevelopmentErrors(); if (de.GetStatus()) { using (Stream myStream = currentAssembly.GetManifestResourceStream("Dynamics365Tracer.Images.bullet_green.png")) { btn_devErrors_status.Image = new Bitmap(myStream); } btn_devErrors_status.Text = @"Turn DevErrors Off"; } else { using (Stream myStream = currentAssembly.GetManifestResourceStream("Dynamics365Tracer.Images.bullet_red.png")) { btn_devErrors_status.Image = new Bitmap(myStream); } btn_devErrors_status.Text = @"Turn DevErrors On"; } }