Add SelectFirstDay and SelectLastDay elements.
This commit is contained in:
@ -67,11 +67,11 @@ namespace zaaReloaded2.Formatter
|
||||
/// <summary>
|
||||
/// Gets the current working set of TimePointFormatters.
|
||||
/// </summary>
|
||||
public ITimePointFormatterDictionary WorkingTimePoints { get; private set; }
|
||||
public Dictionary<DateTime, TimePointFormatter> WorkingTimePoints { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
#region Constructors
|
||||
|
||||
public Formatter()
|
||||
{
|
||||
@ -95,18 +95,41 @@ namespace zaaReloaded2.Formatter
|
||||
/// current position of the cursor).</param>
|
||||
public void Run()
|
||||
{
|
||||
WorkingTimePoints = _timePointFormatters;
|
||||
foreach (ElementBase element in Settings.Elements)
|
||||
{
|
||||
element.Run(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selects all time points for the first day in the
|
||||
/// laboratory.
|
||||
/// </summary>
|
||||
public void SelectFirstDay()
|
||||
{
|
||||
DateTime first = _timePointFormatters.First().Key;
|
||||
WorkingTimePoints = _timePointFormatters
|
||||
.Where(kv => kv.Key.Date == first.Date)
|
||||
.ToDictionary(kv => kv.Key, kv => kv.Value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selects all time points for the first day in the
|
||||
/// laboratory.
|
||||
/// </summary>
|
||||
public void SelectLastDay()
|
||||
{
|
||||
DateTime last = _timePointFormatters.Last().Key;
|
||||
WorkingTimePoints = _timePointFormatters
|
||||
.Where(kv => kv.Key.Date == last.Date)
|
||||
.ToDictionary(kv => kv.Key, kv => kv.Value);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Fields
|
||||
|
||||
ITimePointFormatterDictionary _timePointFormatters;
|
||||
TimePointFormatterDictionary _timePointFormatters;
|
||||
Laboratory _laboratory;
|
||||
|
||||
#endregion
|
||||
|
Reference in New Issue
Block a user