DateRangeChoice
Class in Oadm.Sdk.Client.Controls · Oadm.Sdk.Client.dll
The date range of a log or list (DateRangeButton, SDK 0.15.0): the presets Last hour, Today, Last 24 hours, Last 7 days and All, or Custom with From and To (date and 24-hour time, this computer’s time). A preset is relative: DateRangeChoice.Resolve gives its instants at the moment of the query. The button text says the applied range (“All”, “Last 24 hours”, “12 Nov 09:00 – 14 Nov 18:00”); DateRangeChoice.Changed fires when it changes. Not kept: All at each start. The Custom fields validate like every form (To after From, the error directly below To).
public sealed class DateRangeChoice : ValidatingViewModelInherits ValidatingViewModel
Constructors
Section titled “Constructors”DateRangeChoice
Section titled “DateRangeChoice”DateRangeChoice(TimeProvider? time = null)A range of All.
Parameters
time: The clock and this computer’s time zone (tests pass a fake one); null: the system’s.
Properties
Section titled “Properties”ApplyCustomCommand
Section titled “ApplyCustomCommand”IRelayCommand ApplyCustomCommand { get; }Gets an IRelayCommand instance wrapping DateRangeChoice.ApplyCustom.
ChooseCommand
Section titled “ChooseCommand”IRelayCommand<DateRangePreset> ChooseCommand { get; }Gets an IRelayCommand<T> instance wrapping DateRangeChoice.Choose.
FromDate
Section titled “FromDate”DateTimeOffset? FromDate { get; set; }The From day (the time of day comes from FromTime).
FromError
Section titled “FromError”string? FromError { get; }The visible error of From (below its pickers).
FromTime
Section titled “FromTime”TimeSpan? FromTime { get; set; }The From time of day (24 hours).
bool IsAll { get; }No range: every entry.
IsCustomShown
Section titled “IsCustomShown”bool IsCustomShown { get; }From and To show in the flyout.
IsOpen
Section titled “IsOpen”bool IsOpen { get; set; }The flyout is open (bound two-way by the button).
Marked
Section titled “Marked”DateRangePreset Marked { get; set; }The choice marked in the open flyout; Custom shows From and To.
Options
Section titled “Options”static IReadOnlyList<DateRangeOption> Options { get; }The choices of the flyout, in order.
Preset
Section titled “Preset”DateRangePreset Preset { get; private set; }The applied range.
string Text { get; }The button text: “All”, “Last 24 hours”, “12 Nov 09:00 – 14 Nov 18:00”.
ToDate
Section titled “ToDate”DateTimeOffset? ToDate { get; set; }The To day (the time of day comes from ToTime).
ToError
Section titled “ToError”string? ToError { get; }The visible error of To.
ToTime
Section titled “ToTime”TimeSpan? ToTime { get; set; }The To time of day (24 hours).
Methods
Section titled “Methods”ApplyCustom
Section titled “ApplyCustom”void ApplyCustom()Applies From and To (Apply in the flyout); shows the errors instead while they are not valid.
Choose
Section titled “Choose”void Choose(DateRangePreset preset)Marks a choice in the flyout: a preset applies at once and closes it; Custom shows From and To.
OnOpening
Section titled “OnOpening”void OnOpening()The flyout opens: it marks the applied range and fills From and To with it (or with today).
void Reset()Back to All (logout).
Resolve
Section titled “Resolve”(DateTimeOffset? From, DateTimeOffset? To) Resolve()The instants of the applied range now: From (null = from the oldest) and To (null = up to now). Today starts at midnight of this computer’s day.
SetCustom
Section titled “SetCustom”void SetCustom(DateTimeOffset from, DateTimeOffset to)Sets a custom range directly (tests, a range another page hands over).
Events
Section titled “Events”Changed
Section titled “Changed”event EventHandler? ChangedThe applied range changed (a preset was chosen or Custom applied).