75 lines
1.6 KiB
C#
75 lines
1.6 KiB
C#
///
|
|
/// Copyright (c) 2013-2021 Senus Slovensko a.s.
|
|
///
|
|
using System;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
|
|
namespace TBF.UI.Shared
|
|
{
|
|
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 readonly string ComplTestName;
|
|
public readonly int TestId;
|
|
public readonly int Part;
|
|
public readonly int RepetitionNr;
|
|
|
|
public int Progress { set { testProgressBar.Value = value; } }
|
|
public ProgressBar TestProgressBar { get { return testProgressBar; } }
|
|
|
|
public bool Selected;
|
|
|
|
public TestProgressCtrl()
|
|
{
|
|
InitializeComponent();
|
|
this.Progress = 0;
|
|
this.TestResult = TestProgressCtrl.Result.NotDone;
|
|
}
|
|
|
|
public TestProgressCtrl(string complTestName, int testId, int part, int repetitionNr)
|
|
: this()
|
|
{
|
|
this.ComplTestName = complTestName;
|
|
this.TestId = testId;
|
|
this.Part = part;
|
|
this.RepetitionNr = repetitionNr;
|
|
|
|
testNameLabel.Text = complTestName;
|
|
}
|
|
|
|
private void TestProgressCtrl_Click(object sender, System.EventArgs e)
|
|
{
|
|
if (Selected)
|
|
{
|
|
Selected = false;
|
|
BackColor = Color.Transparent;
|
|
}
|
|
else
|
|
{
|
|
Selected = true;
|
|
BackColor = Color.Orange;
|
|
}
|
|
}
|
|
}
|
|
}
|