|
Vereinsmeisterschaften
22aa7800eae54b428d40e835886cefe1fdefdfdf
This is a software that can be used to manage the internal competition of the swimming club Illertissen called "Vereinsmeisterschaften".
|
Interaktionslogik für TimeSpanControl.xaml This control is inspired by the HTML time input (https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_type_time) More...
Public Types | |
| enum | TimeSpanControlEditModes { None , EditHours , EditMinutes , EditSeconds , EditMilliseconds } |
| Enum with editable parts of the TimeSpan. More... | |
Public Member Functions | |
| TimeSpanControl () | |
| Constructor of the TimeSpanControl. | |
Static Public Attributes | |
| const ushort | MAX_NUMBER_MILLISECOND_DIGITS = 3 |
| Maximum number of digits for the milliseconds. | |
| static readonly DependencyProperty | EditModeProperty = DependencyProperty.Register(nameof(EditMode), typeof(TimeSpanControlEditModes), typeof(TimeSpanControl), new UIPropertyMetadata(TimeSpanControlEditModes.EditMinutes, new PropertyChangedCallback(OnEditModeChanged))) |
| Dependency property for the EditMode property. | |
| static readonly DependencyProperty | ValueProperty = DependencyProperty.Register(nameof(Value), typeof(TimeSpan), typeof(TimeSpanControl), new FrameworkPropertyMetadata(TimeSpan.Zero, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(OnValueChanged))) |
| Dependency property for the Value property. | |
| static readonly DependencyProperty | HoursProperty = DependencyProperty.Register(nameof(Hours), typeof(int), typeof(TimeSpanControl), new UIPropertyMetadata(0, new PropertyChangedCallback(OnTimeChanged))) |
| Dependency property for the Hours property. | |
| static readonly DependencyProperty | MinutesProperty = DependencyProperty.Register(nameof(Minutes), typeof(int), typeof(TimeSpanControl), new UIPropertyMetadata(0, new PropertyChangedCallback(OnTimeChanged))) |
| Dependency property for the Minutes property. | |
| static readonly DependencyProperty | SecondsProperty = DependencyProperty.Register(nameof(Seconds), typeof(int), typeof(TimeSpanControl), new UIPropertyMetadata(0, new PropertyChangedCallback(OnTimeChanged))) |
| Dependency property for the Seconds property. | |
| static readonly DependencyProperty | MillisecondsProperty = DependencyProperty.Register(nameof(Milliseconds), typeof(int), typeof(TimeSpanControl), new UIPropertyMetadata(0, new PropertyChangedCallback(OnTimeChanged))) |
| Dependency property for the Milliseconds property. | |
| static readonly DependencyProperty | MillisecondDigitsProperty = DependencyProperty.Register(nameof(MillisecondDigits), typeof(ushort), typeof(TimeSpanControl), new PropertyMetadata(MAX_NUMBER_MILLISECOND_DIGITS, OnMillisecondDigitsChanged)) |
| Dependency property for the MillisecondDigits property. | |
| static readonly DependencyProperty | MillisecondsDisplayedProperty = MillisecondsDisplayedPropertyKey.DependencyProperty |
| Read-only dependency property for the MillisecondsDisplayed property. | |
| static readonly DependencyProperty | HoursVisibleProperty = DependencyProperty.Register(nameof(HoursVisible), typeof(bool), typeof(TimeSpanControl), new UIPropertyMetadata(true, new PropertyChangedCallback(OnVisiblePartsChanged))) |
| Dependency property for the HoursVisible property. | |
| static readonly DependencyProperty | MillisecondsVisibleProperty = DependencyProperty.Register(nameof(MillisecondsVisible), typeof(bool), typeof(TimeSpanControl), new UIPropertyMetadata(true, new PropertyChangedCallback(OnVisiblePartsChanged))) |
| Dependency property for the MillisecondsVisible property. | |
Properties | |
| TimeSpanControlEditModes | EditMode [get, set] |
| Current edit mode. | |
| TimeSpan | Value [get, set] |
| TimeSpan value that is editable by this control | |
| int | Hours [get, set] |
| Hours of the Value (TimeSpan.Hours) | |
| int | Minutes [get, set] |
| Minutes of the Value (TimeSpan.Minutes) | |
| int | Seconds [get, set] |
| Seconds of the Value (TimeSpan.Seconds) | |
| int | Milliseconds [get, set] |
| Milliseconds of the Value (TimeSpan.Milliseconds) | |
| ushort | MillisecondDigits [get, set] |
| Number of digits to display for the milliseconds. | |
| string | MillisecondsDisplayed [get, private set] |
| Read-only property that contains the formatted milliseconds depending on the MillisecondDigits property. | |
| bool | HoursVisible [get, set] |
| If true, the controls show the Hours field. | |
| bool | MillisecondsVisible [get, set] |
| If true, the controls show the Milliseconds field. | |
Private Member Functions | |
| void | updateMillisecondsDisplayed () |
| void | handleDigitInput (byte digit) |
| Integrate the entered digit into the TimeSpan value. | |
| void | increaseDigit () |
| Increase the digits depending on the current EditMode | |
| void | decreaseDigit () |
| Decrease the digits depending on the current EditMode | |
| void | txt_hours_PreviewMouseDown (object sender, MouseButtonEventArgs e) |
| void | txt_minutes_PreviewMouseDown (object sender, MouseButtonEventArgs e) |
| void | txt_seconds_PreviewMouseDown (object sender, MouseButtonEventArgs e) |
| void | txt_milliseconds_PreviewMouseDown (object sender, MouseButtonEventArgs e) |
| void | UserControl_PreviewKeyDown (object sender, KeyEventArgs e) |
| void | btn_Increase_Click (object sender, RoutedEventArgs e) |
| void | btn_Decrease_Click (object sender, RoutedEventArgs e) |
Static Private Member Functions | |
| static void | OnEditModeChanged (DependencyObject obj, DependencyPropertyChangedEventArgs e) |
| static void | OnValueChanged (DependencyObject obj, DependencyPropertyChangedEventArgs e) |
| static void | OnTimeChanged (DependencyObject obj, DependencyPropertyChangedEventArgs e) |
| static void | OnMillisecondDigitsChanged (DependencyObject d, DependencyPropertyChangedEventArgs e) |
| static void | OnVisiblePartsChanged (DependencyObject obj, DependencyPropertyChangedEventArgs e) |
Private Attributes | |
| bool | _digitEntry_StartWithFirstDigit = true |
| byte | _digitEntry_CountEnteredZeroes = 0 |
Static Private Attributes | |
| static readonly DependencyPropertyKey | MillisecondsDisplayedPropertyKey = DependencyProperty.RegisterReadOnly(nameof(MillisecondsDisplayed), typeof(string), typeof(TimeSpanControl), new PropertyMetadata("000")) |
Interaktionslogik für TimeSpanControl.xaml This control is inspired by the HTML time input (https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_type_time)
Definition at line 11 of file TimeSpanControl.xaml.cs.
Enum with editable parts of the TimeSpan.
Definition at line 16 of file TimeSpanControl.xaml.cs.
| Vereinsmeisterschaften.Controls.TimeSpanControl.TimeSpanControl | ( | ) |
Constructor of the TimeSpanControl.
Definition at line 35 of file TimeSpanControl.xaml.cs.
|
private |
Definition at line 464 of file TimeSpanControl.xaml.cs.
|
private |
Definition at line 459 of file TimeSpanControl.xaml.cs.
|
private |
Decrease the digits depending on the current EditMode
Definition at line 348 of file TimeSpanControl.xaml.cs.
|
private |
Integrate the entered digit into the TimeSpan value.
If it is the first digit after an EditMode change, it is used at the rightmost digit. For each following digit, the value is multiplied by 10 (shifted one digit to the left) and the digit is added. If the EditMode is changed automatically when the next digit will produce a number that is too large. E.g. if Hours = 3 the Edit mode will automatically change to EditMinutes because all following digits would lead to hours > 23.
| digit | Digit to handle (0 .. 9) |
Definition at line 270 of file TimeSpanControl.xaml.cs.
|
private |
Increase the digits depending on the current EditMode
Definition at line 317 of file TimeSpanControl.xaml.cs.
|
staticprivate |
Definition at line 63 of file TimeSpanControl.xaml.cs.
|
staticprivate |
Definition at line 178 of file TimeSpanControl.xaml.cs.
|
staticprivate |
Definition at line 153 of file TimeSpanControl.xaml.cs.
|
staticprivate |
Definition at line 86 of file TimeSpanControl.xaml.cs.
|
staticprivate |
Definition at line 243 of file TimeSpanControl.xaml.cs.
|
private |
Definition at line 381 of file TimeSpanControl.xaml.cs.
|
private |
Definition at line 402 of file TimeSpanControl.xaml.cs.
|
private |
Definition at line 388 of file TimeSpanControl.xaml.cs.
|
private |
Definition at line 395 of file TimeSpanControl.xaml.cs.
|
private |
Definition at line 204 of file TimeSpanControl.xaml.cs.
|
private |
Definition at line 409 of file TimeSpanControl.xaml.cs.
|
private |
Definition at line 43 of file TimeSpanControl.xaml.cs.
|
private |
Definition at line 42 of file TimeSpanControl.xaml.cs.
|
static |
Dependency property for the EditMode property.
Definition at line 61 of file TimeSpanControl.xaml.cs.
|
static |
Dependency property for the Hours property.
Definition at line 109 of file TimeSpanControl.xaml.cs.
|
static |
Dependency property for the HoursVisible property.
Definition at line 227 of file TimeSpanControl.xaml.cs.
|
static |
Maximum number of digits for the milliseconds.
Definition at line 28 of file TimeSpanControl.xaml.cs.
|
static |
Dependency property for the MillisecondDigits property.
Definition at line 176 of file TimeSpanControl.xaml.cs.
|
static |
Read-only dependency property for the MillisecondsDisplayed property.
Definition at line 202 of file TimeSpanControl.xaml.cs.
|
staticprivate |
Definition at line 197 of file TimeSpanControl.xaml.cs.
|
static |
Dependency property for the Milliseconds property.
Definition at line 151 of file TimeSpanControl.xaml.cs.
|
static |
Dependency property for the MillisecondsVisible property.
Definition at line 241 of file TimeSpanControl.xaml.cs.
|
static |
Dependency property for the Minutes property.
Definition at line 123 of file TimeSpanControl.xaml.cs.
|
static |
Dependency property for the Seconds property.
Definition at line 137 of file TimeSpanControl.xaml.cs.
|
static |
Dependency property for the Value property.
Definition at line 84 of file TimeSpanControl.xaml.cs.
|
getset |
Current edit mode.
This determines the part of the TimeSpan that is currently edited.
Definition at line 52 of file TimeSpanControl.xaml.cs.
|
getset |
Hours of the Value (TimeSpan.Hours)
Definition at line 100 of file TimeSpanControl.xaml.cs.
|
getset |
If true, the controls show the Hours field.
Definition at line 218 of file TimeSpanControl.xaml.cs.
|
getset |
Number of digits to display for the milliseconds.
Definition at line 167 of file TimeSpanControl.xaml.cs.
|
getset |
Milliseconds of the Value (TimeSpan.Milliseconds)
Definition at line 142 of file TimeSpanControl.xaml.cs.
|
getprivate set |
Read-only property that contains the formatted milliseconds depending on the MillisecondDigits property.
Definition at line 191 of file TimeSpanControl.xaml.cs.
|
getset |
If true, the controls show the Milliseconds field.
Definition at line 232 of file TimeSpanControl.xaml.cs.
|
getset |
Minutes of the Value (TimeSpan.Minutes)
Definition at line 114 of file TimeSpanControl.xaml.cs.
|
getset |
Seconds of the Value (TimeSpan.Seconds)
Definition at line 128 of file TimeSpanControl.xaml.cs.
|
getset |
TimeSpan value that is editable by this control
Definition at line 75 of file TimeSpanControl.xaml.cs.