Class TimeZoneDateTimePicker
- Namespace
- Skyline.DataMiner.Utils.InteractiveAutomationScript
- Assembly
- Skyline.DataMiner.Utils.InteractiveAutomationScriptToolkit.dll
Defines a section that allows the user to define a DateTime in a specific time zone.
public class TimeZoneDateTimePicker : Section
- Inheritance
-
TimeZoneDateTimePicker
- Inherited Members
- Extension Methods
Examples
public class ScheduleAppointmentDialog : Dialog
{
private readonly TimeZoneDateTimePicker _timeZoneDateTimePicker = new TimeZoneDateTimePicker();
private readonly TextBox _whatTextBox = new TextBox();
private readonly TextBox _whereTextBox = new TextBox();
private readonly Label _whatLabel = new Label("What?");
private readonly Label _whenLabel = new Label("When?");
private readonly Label _whereLabel = new Label("Where?");
public ScheduleAppointmentDialog(IEngine engine) : base(engine)
{
ContinueButton.Pressed += (s, e) =>
{
Engine.GenerateInformation($"{Description} on {DateTime.ToString("O")} at {Location}");
Engine.ExitSuccess("Exit");
};
BuildUi();
}
public string Description => _whatTextBox.Text;
public DateTime DateTime => _timeZoneDateTimePicker.DateTime;
public string Location => _whereTextBox.Text;
public void BuildUi()
{
Clear();
int row = -1;
AddWidget(_whatLabel, ++row, 0);
AddWidget(_whatTextBox, row, 1, 1, 3);
AddWidget(_whenLabel, ++row, 0);
AddSection(_timeZoneDateTimePicker, row, 1);
AddWidget(_whereLabel, ++row, 0);
AddWidget(_whereTextBox, row, 1, 1, 3);
AddWidget(new WhiteSpace(), ++row, 0);
AddWidget(ContinueButton, ++row, 0, 1, 4, HorizontalAlignment.Right);
}
public Button ContinueButton { get; } = new Button("Continue") { Style = ButtonStyle.CallToAction };
}
Constructors
- TimeZoneDateTimePicker()
Initializes a new instance of the TimeZoneDateTimePicker class.
Properties
- DateTime
Sets or gets the DateTime value, optionally taking the selected timezone into account.
- TimeZone
Gets the selected TimeZone from the dropdown.
Methods
- BuildUi()
Rebuilds the section.
Events
- Changed
Triggered when a different datetime is picked or when timezone selection changes.