38 lines
868 B
C#
38 lines
868 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Dakota.Models.Daten
|
|
{
|
|
internal class DatenelementCounter : DatenelementFiller
|
|
{
|
|
public Func<int> Counter { get; private set; }
|
|
|
|
public DatenelementCounter(string title, int count, Func<int> counter) : this(title, count, counter, count)
|
|
{
|
|
|
|
}
|
|
|
|
public DatenelementCounter(string title, int count, Func<int> counter, int filllen) : base(title, count, filllen)
|
|
{
|
|
Counter = counter;
|
|
}
|
|
|
|
public void Update()
|
|
{
|
|
var value = Counter();
|
|
|
|
SetValue(value.ToString("D" + MinStellen.ToString()));
|
|
}
|
|
|
|
public override string GetValue()
|
|
{
|
|
Update();
|
|
|
|
return base.GetValue();
|
|
}
|
|
}
|
|
}
|