Add CanRun property to Formatter.
This commit is contained in:
parent
75c9c984c6
commit
285c6a2555
@ -64,6 +64,12 @@ namespace zaaReloaded2.Formatter
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Dictionary<DateTime, TimePointFormatter> WorkingTimePoints { get; private set; }
|
public Dictionary<DateTime, TimePointFormatter> WorkingTimePoints { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Is true if this Formatter object carries a Laboratory with
|
||||||
|
/// at least one time point.
|
||||||
|
/// </summary>
|
||||||
|
public bool CanRun { get { return Laboratory.TimePoints.Count > 0; } }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
@ -113,6 +119,8 @@ namespace zaaReloaded2.Formatter
|
|||||||
/// current position of the cursor).</param>
|
/// current position of the cursor).</param>
|
||||||
public void Run()
|
public void Run()
|
||||||
{
|
{
|
||||||
|
if (!CanRun) throw new InvalidOperationException("No laboratory data to format.");
|
||||||
|
|
||||||
int current = 0;
|
int current = 0;
|
||||||
while (current < Settings.Elements.Count)
|
while (current < Settings.Elements.Count)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user