/// /// Copyright (c) 2013-2015 Sensus Metering Systems /// using System; using System.Drawing; using System.Windows.Forms; namespace TBF.UiControls { public partial class TestProgressCtrl : UserControl { public enum Result { NotDone, Passed, Failed, } public Result TestResult { set { //switch (value) //{ // case Result.NotDone: resultPictureBox.Image = Properties.Resources.TestNotDoneImage; break; // case Result.Passed: resultPictureBox.Image = Properties.Resources.TestPassedImage; break; // case Result.Failed: resultPictureBox.Image = Properties.Resources.TestFailedImage; break; //} } } public bool Selected; int testId; public int TestId { get { return testId; } } string testName; public string TestName { get { return testName; } } int part; public int Part { get { return part; } } string title; public string Title2 { get { return title; } } int repetitionNr; public int RepetitionNr { get { return repetitionNr; } } public string Title { set { testNameLabel.Text = value; } } public int Progress { set { testProgressBar.Value = value; } } public ProgressBar TestProgressBar { get { return testProgressBar; } } public TestProgressCtrl() { InitializeComponent(); this.Progress = 0; this.TestResult = UiControls.TestProgressCtrl.Result.NotDone; } public TestProgressCtrl(int testId, string testName, int part, string title, int repetitionNr, int testRepeats) : this() { this.testId = testId; this.part = part; this.testName = testName; this.title = title; this.repetitionNr = repetitionNr; this.Title = title; } private void TestProgressCtrl_Click(object sender, System.EventArgs e) { if (Selected) { Selected = false; BackColor = Color.Transparent; } else { Selected = true; BackColor = Color.Orange; } } } }