-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJulianDateConverterForm.cs
942 lines (733 loc) · 49.1 KB
/
JulianDateConverterForm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
using System.Globalization;
using System.Media;
using Julian_and_his_dates.Properties;
namespace JulianAndHisDates
{
/// <summary>
/// Initialize the form.
/// </summary>
public partial class JulianDateConverterForm : Form
{
private const double julianDateMinimum = 1721423.5;
private const double julianDateMaximum = 5373483.5;
private readonly double doubleJulianDate;
private readonly double doubleModifiedJulianDate;
private readonly double doubleReducedJulianDate;
private readonly double doubleTruncatedJulianDate;
private readonly double doubleDublinJulianDate;
private readonly double doubleCnesJulianDate;
private readonly double doubleCcsdsJulianDate;
private readonly double doubleLopJulianDate;
private readonly double doubleMillenniumJulianDate;
private readonly double doubleLilianDate;
private readonly double doubleChronologicalJulianDate;
private readonly double doubleChronologicalModifiedJulianDate;
private readonly double doubleRataDie;
private readonly double doubleMarsSolDate;
private readonly double doubleUnixtime;
private readonly CultureInfo culture = CultureInfo.CreateSpecificCulture(name: "en-GB");
private readonly NumberStyles style = NumberStyles.AllowDecimalPoint;
private readonly Color colorWhiteFont = Color.WhiteSmoke;
private readonly Color colorDarkBackground = Color.FromArgb(red: 29, green: 32, blue: 41);
/// <summary>
/// Initialize the form.
/// </summary>
public JulianDateConverterForm()
{
InitializeComponent();
doubleJulianDate = JulianDates.CalculateJulianDate();
doubleModifiedJulianDate = JulianDates.CalculateModifiedJulianDate();
doubleReducedJulianDate = JulianDates.CalculateReducedJulianDate();
doubleTruncatedJulianDate = JulianDates.CalculateTruncatedJulianDate();
doubleDublinJulianDate = JulianDates.CalculateDublinJulianDate();
doubleCnesJulianDate = JulianDates.CalculateCnesJulianDate();
doubleCcsdsJulianDate = JulianDates.CalculateCcsdsJulianDate();
doubleLopJulianDate = JulianDates.CalculateLopJulianDate();
doubleMillenniumJulianDate = JulianDates.CalculateMillenniumJulianDate();
doubleChronologicalJulianDate = JulianDates.CalculateChronologicalJulianDate();
doubleChronologicalModifiedJulianDate = JulianDates.CalculateChronologicalModifiedJulianDate();
doubleLilianDate = JulianDates.CalculateLilianDate();
doubleRataDie = JulianDates.CalculateRataDie();
doubleMarsSolDate = JulianDates.CalculateMarsSolDate();
doubleUnixtime = JulianDates.CalculateUnixTime();
//, defaultButton: MessageBoxDefaultButton.Button1, options: MessageBoxOptions.DefaultDesktopOnly
labelLocalTime.Text = DateTime.Now.ToString(provider: culture);
labelUtcTime.Text = DateTime.UtcNow.ToString(provider: culture);
textboxJulianDate.Text = doubleJulianDate.ToString(provider: culture);
textboxModifiedJulianDate.Text = doubleModifiedJulianDate.ToString(provider: culture);
textboxReducedJulianDate.Text = doubleReducedJulianDate.ToString(provider: culture);
textboxTruncatedJulianDate.Text = doubleTruncatedJulianDate.ToString(provider: culture);
textboxDublinJulianDate.Text = doubleDublinJulianDate.ToString(provider: culture);
textboxCnesJulianDate.Text = doubleCnesJulianDate.ToString(provider: culture);
textboxCcsdsJulianDate.Text = doubleCcsdsJulianDate.ToString(provider: culture);
textboxLopJulianDate.Text = doubleLopJulianDate.ToString(provider: culture);
textboxMillenniumJulianDate.Text = doubleMillenniumJulianDate.ToString(provider: culture);
textboxChronologicalJulianDate.Text = doubleChronologicalJulianDate.ToString(provider: culture);
textboxChronologicalModifiedJulianDate.Text = doubleChronologicalModifiedJulianDate.ToString(provider: culture);
textboxLilianDate.Text = doubleLilianDate.ToString(provider: culture);
textboxRataDie.Text = doubleRataDie.ToString(provider: culture);
textboxMarsSolDate.Text = doubleMarsSolDate.ToString(provider: culture);
textboxUnixtime.Text = doubleUnixtime.ToString(provider: culture);
}
/// <summary>
/// Set dark mode
/// </summary>
public void SetDarkMode()
{
textboxJulianDate.ForeColor = colorWhiteFont;
textboxJulianDate.BackColor = colorDarkBackground;
textboxModifiedJulianDate.ForeColor = colorWhiteFont;
textboxModifiedJulianDate.BackColor = colorDarkBackground;
textboxReducedJulianDate.ForeColor = colorWhiteFont;
textboxReducedJulianDate.BackColor = colorDarkBackground;
textboxTruncatedJulianDate.ForeColor = colorWhiteFont;
textboxTruncatedJulianDate.BackColor = colorDarkBackground;
textboxDublinJulianDate.ForeColor = colorWhiteFont;
textboxDublinJulianDate.BackColor = colorDarkBackground;
textboxCnesJulianDate.ForeColor = colorWhiteFont;
textboxCnesJulianDate.BackColor = colorDarkBackground;
textboxCcsdsJulianDate.ForeColor = colorWhiteFont;
textboxCcsdsJulianDate.BackColor = colorDarkBackground;
textboxLopJulianDate.ForeColor = colorWhiteFont;
textboxLopJulianDate.BackColor = colorDarkBackground;
textboxMillenniumJulianDate.ForeColor = colorWhiteFont;
textboxMillenniumJulianDate.BackColor = colorDarkBackground;
textboxChronologicalJulianDate.ForeColor = colorWhiteFont;
textboxChronologicalJulianDate.BackColor = colorDarkBackground;
textboxChronologicalModifiedJulianDate.ForeColor = colorWhiteFont;
textboxChronologicalModifiedJulianDate.BackColor = colorDarkBackground;
textboxLilianDate.ForeColor = colorWhiteFont;
textboxLilianDate.BackColor = colorDarkBackground;
textboxRataDie.ForeColor = colorWhiteFont;
textboxRataDie.BackColor = colorDarkBackground;
textboxMarsSolDate.ForeColor = colorWhiteFont;
textboxMarsSolDate.BackColor = colorDarkBackground;
textboxUnixtime.ForeColor = colorWhiteFont;
textboxUnixtime.BackColor = colorDarkBackground;
}
private void JulianDateConverterForm_Load(object sender, EventArgs e)
{
statusStrip.ForeColor = ForeColor;
statusStrip.BackColor = BackColor;
}
private bool IsOKForDecimalTextBox(char theCharacter, TextBox theTextBox)
{
// Only allow control characters, digits, plus and minus signs.
// Only allow ONE plus sign.
// Only allow ONE minus sign.
// Only allow the plus or minus sign as the FIRST character.
// Only allow ONE decimal point.
// Do NOT allow decimal point or digits BEFORE any plus or minus sign.
if (
!char.IsControl(c: theCharacter)
&& !char.IsDigit(c: theCharacter)
&& (theCharacter != '.')
&& (theCharacter != ',')
&& (theCharacter != '-')
&& (theCharacter != '+')
)
{
// Then it is NOT a character we want allowed in the text box.
return false;
}
// Only allow one decimal point.
if (((theCharacter == '.') || (theCharacter == ',')) && ((theTextBox.Text.IndexOf(value: '.') > -1) || (theTextBox.Text.IndexOf(value: ',') > -1)))
{
// Then there is already a decimal point in the text box.
return false;
}
// Only allow one minus sign.
if (theCharacter == '-' && theTextBox.Text.IndexOf(value: theCharacter) > -1)
{
// Then there is already a minus sign in the text box.
return false;
}
// Only allow one plus sign.
if (theCharacter == '+' && theTextBox.Text.IndexOf(value: theCharacter) > -1)
{
// Then there is already a plus sign in the text box.
return false;
}
// Only allow one plus sign OR minus sign, but not both.
if ((
(theCharacter == '-')
|| (theCharacter == '+')
)
&&
(
(theTextBox.Text.IndexOf(value: '-') > -1)
|| (theTextBox.Text.IndexOf(value: '+') > -1)
)
)
{
// Then the user is trying to enter a plus or minus sign and
// there is ALREADY a plus or minus sign in the text box.
return false;
}
// Only allow a minus or plus sign at the first character position.
if ((
(theCharacter == '-')
|| (theCharacter == '+')
)
&& theTextBox.SelectionStart != 0
)
{
// Then the user is trying to enter a minus or plus sign at some position
// OTHER than the first character position in the text box.
return false;
}
// Only allow digits and decimal point AFTER any existing plus or minus sign
if (
(
// Is digit or decimal point
char.IsDigit(theCharacter) || (theCharacter == '.')
)
&&
(
// A plus or minus sign EXISTS
(theTextBox.Text.IndexOf(value: '-') > -1) || (theTextBox.Text.IndexOf(value: '+') > -1)
)
&&
// Attempting to put the character at the beginning of the field.
theTextBox.SelectionStart == 0
)
{
// Then the user is trying to enter a digit or decimal point in front of a minus or plus sign.
return false;
}
// Only allow digits and decimal point AFTER any existing plus or minus sign
if (
(
// Is digit or decimal point
char.IsDigit(c: theCharacter) || (theCharacter == ',')
)
&&
(
// A plus or minus sign EXISTS
(theTextBox.Text.IndexOf(value: '-') > -1) || (theTextBox.Text.IndexOf(value: '+') > -1)
)
&&
// Attempting to put the character at the beginning of the field.
theTextBox.SelectionStart == 0
)
{
// Then the user is trying to enter a digit or decimal point in front of a minus or plus sign.
return false;
}
// Otherwise the character is perfectly fine for a decimal value and the character
// may indeed be placed at the current insertion position.
return true;
}
/// <summary>
/// Saves an image of the screen to the specified path.
///
/// </summary>
/// <param name="location">Path, where output file will be saved at.</param>
/// <returns>Path of the successfully saved image or error message</returns>
public string ScreenToPicture(string location)
{
try
{
using (Bitmap screenToBitmap = new(width: Size.Width, height: Size.Height))
{
using (Graphics gGraphics = Graphics.FromImage(image: screenToBitmap))
{
Size currentScreenSize = new(width: Size.Width, height: Size.Height);
gGraphics.CopyFromScreen(upperLeftSource: Location, upperLeftDestination: new Point(x: 0, y: 0), blockRegionSize: currentScreenSize);
}
screenToBitmap.Save(filename: location);
}
return location;
}
catch (Exception ex)
{
return ex.Message;
}
}
private void SetStatusBar(string strText)
{
toolStripStatusLabelInformation.Visible = true;
toolStripStatusLabelInformation.Text = strText;
toolStripStatusLabelTakeScreenshot.Visible = false;
}
private void ResetStatusBar()
{
toolStripStatusLabelInformation.Visible = false;
toolStripStatusLabelInformation.Text = string.Empty;
toolStripStatusLabelTakeScreenshot.Visible = true;
}
#region Click-Eventhandlers
private void LabelUtcTimeText_Click(object sender, EventArgs e) => MessageBox.Show(text: Resources.strUtcTimeText, caption: Resources.strInformation, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Information, defaultButton: MessageBoxDefaultButton.Button1, options: MessageBoxOptions.DefaultDesktopOnly);
private void LabelLocalTimeText_Click(object sender, EventArgs e) => MessageBox.Show(text: Resources.strLocalTimeText, caption: Resources.strInformation, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Information, defaultButton: MessageBoxDefaultButton.Button1, options: MessageBoxOptions.DefaultDesktopOnly);
private void LabelJulianDateText_Click(object sender, EventArgs e) => MessageBox.Show(text: Resources.strJulianDateText, caption: Resources.strInformation, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Information, defaultButton: MessageBoxDefaultButton.Button1, options: MessageBoxOptions.DefaultDesktopOnly);
private void LabelModifiedJulianDateText_Click(object sender, EventArgs e) => MessageBox.Show(text: Resources.strModifiedJulianDateText, caption: Resources.strInformation, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Information, defaultButton: MessageBoxDefaultButton.Button1, options: MessageBoxOptions.DefaultDesktopOnly);
private void LabelReducedJulianDateText_Click(object sender, EventArgs e) => MessageBox.Show(text: Resources.strReducedJulianDateText, caption: Resources.strInformation, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Information, defaultButton: MessageBoxDefaultButton.Button1, options: MessageBoxOptions.DefaultDesktopOnly);
private void LabelTruncatedJulianDateText_Click(object sender, EventArgs e) => MessageBox.Show(text: Resources.strTruncatedJulianDateText, caption: Resources.strInformation, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Information, defaultButton: MessageBoxDefaultButton.Button1, options: MessageBoxOptions.DefaultDesktopOnly);
private void LabelDublinJulianDateText_Click(object sender, EventArgs e) => MessageBox.Show(text: Resources.strDublinJulianDateText, caption: Resources.strInformation, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Information, defaultButton: MessageBoxDefaultButton.Button1, options: MessageBoxOptions.DefaultDesktopOnly);
private void LabelCnesJulianDateText_Click(object sender, EventArgs e) => MessageBox.Show(text: Resources.strCnesJulianDateText, caption: Resources.strInformation, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Information, defaultButton: MessageBoxDefaultButton.Button1, options: MessageBoxOptions.DefaultDesktopOnly);
private void LabelCcsdsJulianDateText_Click(object sender, EventArgs e) => MessageBox.Show(text: Resources.strCcsdsJulianDateText, caption: Resources.strInformation, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Information, defaultButton: MessageBoxDefaultButton.Button1, options: MessageBoxOptions.DefaultDesktopOnly);
private void LabelLopJulianDateText_Click(object sender, EventArgs e) => MessageBox.Show(text: Resources.strLopJulianDateText, caption: Resources.strInformation, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Information, defaultButton: MessageBoxDefaultButton.Button1, options: MessageBoxOptions.DefaultDesktopOnly);
private void LabelMillenniumJulianDateText_Click(object sender, EventArgs e) => MessageBox.Show(text: Resources.strMillenniumJulianDateText, caption: Resources.strInformation, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Information, defaultButton: MessageBoxDefaultButton.Button1, options: MessageBoxOptions.DefaultDesktopOnly);
private void LabelChronologicalJulianDateText_Click(object sender, EventArgs e) => MessageBox.Show(text: Resources.strChronologicalJulianDateText, caption: Resources.strInformation, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Information, defaultButton: MessageBoxDefaultButton.Button1, options: MessageBoxOptions.DefaultDesktopOnly);
private void LabelChronologicalModifiedJulianDateText_Click(object sender, EventArgs e) => MessageBox.Show(text: Resources.strChronologicalModifiedJulianDateText, caption: Resources.strInformation, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Information, defaultButton: MessageBoxDefaultButton.Button1, options: MessageBoxOptions.DefaultDesktopOnly);
private void LabelLilianDateText_Click(object sender, EventArgs e) => MessageBox.Show(text: Resources.strLilianDateText, caption: Resources.strInformation, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Information, defaultButton: MessageBoxDefaultButton.Button1, options: MessageBoxOptions.DefaultDesktopOnly);
private void LabelRataDieText_Click(object sender, EventArgs e) => MessageBox.Show(text: Resources.strRataDieText, caption: Resources.strInformation, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Information, defaultButton: MessageBoxDefaultButton.Button1, options: MessageBoxOptions.DefaultDesktopOnly);
private void LabelMarsSolDateText_Click(object sender, EventArgs e) => MessageBox.Show(text: Resources.strMarsSolDateText, caption: Resources.strInformation, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Information, defaultButton: MessageBoxDefaultButton.Button1, options: MessageBoxOptions.DefaultDesktopOnly);
private void LabelUnixtimeText_Click(object sender, EventArgs e) => MessageBox.Show(text: Resources.strUnixtimeText, caption: Resources.strInformation, buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Information, defaultButton: MessageBoxDefaultButton.Button1, options: MessageBoxOptions.DefaultDesktopOnly);
private void ToolStripStatusLabelTakeScreenshot_Click(object sender, EventArgs e)
{
using SoundPlayer sound = new(stream: Resources.wavCameraFlashing);
sound.Play();
string
strPathToMyPictures = Environment.GetFolderPath(folder: Environment.SpecialFolder.MyPictures) + "\\",
strFilenameWithExtension = JulianDates.CalculateJulianDate().ToString(provider: culture) + ".png",
strInfotext = Resources.strScreenshotSavedTo;
MessageBox.Show(
text: strInfotext + "\n\n" + ScreenToPicture(location: strPathToMyPictures + strFilenameWithExtension),
caption: "Screenshot taken",
buttons: MessageBoxButtons.OK);
}
#endregion
#region Enter-Eventhandlers
private void LabelUtcTimeText_Enter(object sender, EventArgs e)
{
labelUtcTimeText.Cursor = Cursors.Hand;
labelUtcTimeText.Font = new Font(prototype: labelUtcTimeText.Font, newStyle: FontStyle.Underline);
SetStatusBar(strText: labelUtcTimeText.AccessibleDescription);
}
private void LabelLocalTimeText_Enter(object sender, EventArgs e)
{
labelLocalTimeText.Cursor = Cursors.Hand;
labelLocalTimeText.Font = new Font(prototype: labelLocalTimeText.Font, newStyle: FontStyle.Underline);
SetStatusBar(strText: labelLocalTimeText.AccessibleDescription);
}
private void LabelJulianDateText_Enter(object sender, EventArgs e)
{
labelJulianDateText.Cursor = Cursors.Hand;
labelJulianDateText.Font = new Font(prototype: labelJulianDateText.Font, newStyle: FontStyle.Underline);
SetStatusBar(strText: labelJulianDateText.AccessibleDescription);
}
private void LabelModifiedJulianDateText_Enter(object sender, EventArgs e)
{
labelModifiedJulianDateText.Cursor = Cursors.Hand;
labelModifiedJulianDateText.Font = new Font(prototype: labelModifiedJulianDateText.Font, newStyle: FontStyle.Underline);
SetStatusBar(strText: labelModifiedJulianDateText.AccessibleDescription);
}
private void LabelReducedJulianDateText_Enter(object sender, EventArgs e)
{
labelReducedJulianDateText.Cursor = Cursors.Hand;
labelReducedJulianDateText.Font = new Font(prototype: labelReducedJulianDateText.Font, newStyle: FontStyle.Underline);
SetStatusBar(strText: labelReducedJulianDateText.AccessibleDescription);
}
private void LabelTruncatedJulianDateText_Enter(object sender, EventArgs e)
{
labelTruncatedJulianDateText.Cursor = Cursors.Hand;
labelTruncatedJulianDateText.Font = new Font(prototype: labelTruncatedJulianDateText.Font, newStyle: FontStyle.Underline);
SetStatusBar(strText: labelTruncatedJulianDateText.AccessibleDescription);
}
private void LabelDublinJulianDateText_Enter(object sender, EventArgs e)
{
labelDublinJulianDateText.Cursor = Cursors.Hand;
labelDublinJulianDateText.Font = new Font(prototype: labelDublinJulianDateText.Font, newStyle: FontStyle.Underline);
SetStatusBar(strText: labelDublinJulianDateText.AccessibleDescription);
}
private void LabelCnesJulianDateText_Enter(object sender, EventArgs e)
{
labelCnesJulianDateText.Cursor = Cursors.Hand;
labelCnesJulianDateText.Font = new Font(prototype: labelCnesJulianDateText.Font, newStyle: FontStyle.Underline);
SetStatusBar(strText: labelCnesJulianDateText.AccessibleDescription);
}
private void LabelCcsdsJulianDateText_Enter(object sender, EventArgs e)
{
labelCcsdsJulianDateText.Cursor = Cursors.Hand;
labelCcsdsJulianDateText.Font = new Font(prototype: labelCcsdsJulianDateText.Font, newStyle: FontStyle.Underline);
SetStatusBar(strText: labelCcsdsJulianDateText.AccessibleDescription);
}
private void LabelLopJulianDateText_Enter(object sender, EventArgs e)
{
labelLopJulianDateText.Cursor = Cursors.Hand;
labelLopJulianDateText.Font = new Font(prototype: labelLopJulianDateText.Font, newStyle: FontStyle.Underline);
SetStatusBar(strText: labelLopJulianDateText.AccessibleDescription);
}
private void LabelMillenniumJulianDateText_Enter(object sender, EventArgs e)
{
labelMillenniumJulianDateText.Cursor = Cursors.Hand;
labelMillenniumJulianDateText.Font = new Font(prototype: labelMillenniumJulianDateText.Font, newStyle: FontStyle.Underline);
SetStatusBar(strText: labelMillenniumJulianDateText.AccessibleDescription);
}
private void LabelChronologicalJulianDateText_Enter(object sender, EventArgs e)
{
labelChronologicalJulianDateText.Cursor = Cursors.Hand;
labelChronologicalJulianDateText.Font = new Font(prototype: labelChronologicalJulianDateText.Font, newStyle: FontStyle.Underline);
SetStatusBar(strText: labelChronologicalJulianDateText.AccessibleDescription);
}
private void LabelChronologicalModifiedJulianDateText_Enter(object sender, EventArgs e)
{
labelChronologicalModifiedJulianDateText.Cursor = Cursors.Hand;
labelChronologicalModifiedJulianDateText.Font = new Font(prototype: labelChronologicalModifiedJulianDateText.Font, newStyle: FontStyle.Underline);
SetStatusBar(strText: labelChronologicalModifiedJulianDateText.AccessibleDescription);
}
private void LabelLilianDateText_Enter(object sender, EventArgs e)
{
labelLilianDateText.Cursor = Cursors.Hand;
labelLilianDateText.Font = new Font(prototype: labelLilianDateText.Font, newStyle: FontStyle.Underline);
SetStatusBar(strText: labelLilianDateText.AccessibleDescription);
}
private void LabelRataDieText_Enter(object sender, EventArgs e)
{
labelRataDieText.Cursor = Cursors.Hand;
labelRataDieText.Font = new Font(prototype: labelRataDieText.Font, newStyle: FontStyle.Underline);
SetStatusBar(strText: labelRataDieText.AccessibleDescription);
}
private void LabelMarsSolDateText_Enter(object sender, EventArgs e)
{
labelMarsSolDateText.Cursor = Cursors.Hand;
labelMarsSolDateText.Font = new Font(prototype: labelMarsSolDateText.Font, newStyle: FontStyle.Underline);
SetStatusBar(strText: labelMarsSolDateText.AccessibleDescription);
}
private void LabelUnixtimeText_Enter(object sender, EventArgs e)
{
labelUnixtimeText.Cursor = Cursors.Hand;
labelUnixtimeText.Font = new Font(prototype: labelUnixtimeText.Font, newStyle: FontStyle.Underline);
SetStatusBar(strText: labelUnixtimeText.AccessibleDescription);
}
private void LabelUtcTime_Enter(object sender, EventArgs e) => SetStatusBar(strText: labelUtcTime.AccessibleDescription);
private void LabelLocalTime_Enter(object sender, EventArgs e) => SetStatusBar(strText: labelLocalTime.AccessibleDescription);
private void TextboxJulianDate_Enter(object sender, EventArgs e) => SetStatusBar(strText: textboxJulianDate.AccessibleDescription);
private void TextboxModifiedJulianDate_Enter(object sender, EventArgs e) => SetStatusBar(strText: textboxModifiedJulianDate.AccessibleDescription);
private void TextboxReducedJulianDate_Enter(object sender, EventArgs e) => SetStatusBar(strText: textboxReducedJulianDate.AccessibleDescription);
private void TextboxTruncatedJulianDate_Enter(object sender, EventArgs e) => SetStatusBar(strText: textboxTruncatedJulianDate.AccessibleDescription);
private void TextboxDublinJulianDate_Enter(object sender, EventArgs e) => SetStatusBar(strText: textboxDublinJulianDate.AccessibleDescription);
private void TextboxCnesJulianDate_Enter(object sender, EventArgs e) => SetStatusBar(strText: textboxCnesJulianDate.AccessibleDescription);
private void TextboxCcsdsJulianDate_Enter(object sender, EventArgs e) => SetStatusBar(strText: textboxCcsdsJulianDate.AccessibleDescription);
private void TextboxLopJulianDate_Enter(object sender, EventArgs e) => SetStatusBar(strText: textboxLopJulianDate.AccessibleDescription);
private void TextboxMillenniumJulianDate_Enter(object sender, EventArgs e) => SetStatusBar(strText: textboxMillenniumJulianDate.AccessibleDescription);
private void TextboxChronologicalJulianDate_Enter(object sender, EventArgs e) => SetStatusBar(strText: textboxChronologicalJulianDate.AccessibleDescription);
private void TextboxChronologicalModifiedJulianDate_Enter(object sender, EventArgs e) => SetStatusBar(strText: textboxChronologicalModifiedJulianDate.AccessibleDescription);
private void TextboxLilianDate_Enter(object sender, EventArgs e) => SetStatusBar(strText: textboxLilianDate.AccessibleDescription);
private void TextboxRataDie_Enter(object sender, EventArgs e) => SetStatusBar(strText: textboxRataDie.AccessibleDescription);
private void TextboxMarsSolDate_Enter(object sender, EventArgs e) => SetStatusBar(strText: textboxMarsSolDate.AccessibleDescription);
private void TextboxUnixtime_Enter(object sender, EventArgs e) => SetStatusBar(strText: textboxUnixtime.AccessibleDescription);
#endregion
#region Leave-Eventhandlers
private void LabelUtcTimeText_Leave(object sender, EventArgs e)
{
labelUtcTimeText.Cursor = Cursors.Default;
labelUtcTimeText.Font = new Font(prototype: labelUtcTimeText.Font, newStyle: FontStyle.Regular);
ResetStatusBar();
}
private void LabelLocalTimeText_Leave(object sender, EventArgs e)
{
labelLocalTimeText.Cursor = Cursors.Default;
labelLocalTimeText.Font = new Font(prototype: labelLocalTimeText.Font, newStyle: FontStyle.Regular);
ResetStatusBar();
}
private void LabelJulianDateText_Leave(object sender, EventArgs e)
{
labelJulianDateText.Cursor = Cursors.Default;
labelJulianDateText.Font = new Font(prototype: labelJulianDateText.Font, newStyle: FontStyle.Regular);
ResetStatusBar();
}
private void LabelModifiedJulianDateText_Leave(object sender, EventArgs e)
{
labelModifiedJulianDateText.Cursor = Cursors.Default;
labelModifiedJulianDateText.Font = new Font(prototype: labelModifiedJulianDateText.Font, newStyle: FontStyle.Regular);
ResetStatusBar();
}
private void LabelReducedJulianDateText_Leave(object sender, EventArgs e)
{
labelReducedJulianDateText.Cursor = Cursors.Default;
labelReducedJulianDateText.Font = new Font(prototype: labelReducedJulianDateText.Font, newStyle: FontStyle.Regular);
ResetStatusBar();
}
private void LabelTruncatedJulianDateText_Leave(object sender, EventArgs e)
{
labelTruncatedJulianDateText.Cursor = Cursors.Default;
labelTruncatedJulianDateText.Font = new Font(prototype: labelTruncatedJulianDateText.Font, newStyle: FontStyle.Regular);
ResetStatusBar();
}
private void LabelDublinJulianDateText_Leave(object sender, EventArgs e)
{
labelDublinJulianDateText.Cursor = Cursors.Default;
labelDublinJulianDateText.Font = new Font(prototype: labelDublinJulianDateText.Font, newStyle: FontStyle.Regular);
ResetStatusBar();
}
private void LabelCnesJulianDateText_Leave(object sender, EventArgs e)
{
labelCnesJulianDateText.Cursor = Cursors.Default;
labelCnesJulianDateText.Font = new Font(prototype: labelCnesJulianDateText.Font, newStyle: FontStyle.Regular);
ResetStatusBar();
}
private void LabelCcsdsJulianDateText_Leave(object sender, EventArgs e)
{
labelCcsdsJulianDateText.Cursor = Cursors.Default;
labelCcsdsJulianDateText.Font = new Font(prototype: labelCcsdsJulianDateText.Font, newStyle: FontStyle.Regular);
ResetStatusBar();
}
private void LabelLopJulianDateText_Leave(object sender, EventArgs e)
{
labelLopJulianDateText.Cursor = Cursors.Default;
labelLopJulianDateText.Font = new Font(prototype: labelLopJulianDateText.Font, newStyle: FontStyle.Regular);
ResetStatusBar();
}
private void LabelMillenniumJulianDateText_Leave(object sender, EventArgs e)
{
labelMillenniumJulianDateText.Cursor = Cursors.Default;
labelMillenniumJulianDateText.Font = new Font(prototype: labelMillenniumJulianDateText.Font, newStyle: FontStyle.Regular);
ResetStatusBar();
}
private void LabelChronologicalJulianDateText_Leave(object sender, EventArgs e)
{
labelChronologicalJulianDateText.Cursor = Cursors.Default;
labelChronologicalJulianDateText.Font = new Font(prototype: labelChronologicalJulianDateText.Font, newStyle: FontStyle.Regular);
ResetStatusBar();
}
private void LabelChronologicalModifiedJulianDateText_Leave(object sender, EventArgs e)
{
labelChronologicalModifiedJulianDateText.Cursor = Cursors.Default;
labelChronologicalModifiedJulianDateText.Font = new Font(prototype: labelChronologicalModifiedJulianDateText.Font, newStyle: FontStyle.Regular);
ResetStatusBar();
}
private void LabelLilianDateText_Leave(object sender, EventArgs e)
{
labelLilianDateText.Cursor = Cursors.Default;
labelLilianDateText.Font = new Font(prototype: labelLilianDateText.Font, newStyle: FontStyle.Regular);
ResetStatusBar();
}
private void LabelRataDieText_Leave(object sender, EventArgs e)
{
labelRataDieText.Cursor = Cursors.Default;
labelRataDieText.Font = new Font(prototype: labelRataDieText.Font, newStyle: FontStyle.Regular);
ResetStatusBar();
}
private void LabelMarsSolDateText_Leave(object sender, EventArgs e)
{
labelMarsSolDateText.Cursor = Cursors.Default;
labelMarsSolDateText.Font = new Font(prototype: labelMarsSolDateText.Font, newStyle: FontStyle.Regular);
ResetStatusBar();
}
private void LabelUnixtimeText_Leave(object sender, EventArgs e)
{
labelUnixtimeText.Cursor = Cursors.Default;
labelUnixtimeText.Font = new Font(prototype: labelUnixtimeText.Font, newStyle: FontStyle.Regular);
ResetStatusBar();
}
private void LabelUtcTime_Leave(object sender, EventArgs e) => ResetStatusBar();
private void LabelLocalTime_Leave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxJulianDate_Leave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxModifiedJulianDate_Leave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxReducedJulianDate_Leave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxTruncatedJulianDate_Leave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxDublinJulianDate_Leave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxCnesJulianDate_Leave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxCcsdsJulianDate_Leave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxLopJulianDate_Leave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxMillenniumJulianDate_Leave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxChronologicalJulianDate_Leave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxChronologicalModifiedJulianDate_Leave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxLilianDate_Leave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxRataDie_Leave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxMarsSolDate_Leave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxUnixtime_Leave(object sender, EventArgs e) => ResetStatusBar();
#endregion
#region MouseEnter-Eventhandlers
private void LabelUtcTimeText_MouseEnter(object sender, EventArgs e) => LabelUtcTimeText_Enter(sender: sender, e: e);
private void LabelLocalTimeText_MouseEnter(object sender, EventArgs e) => LabelLocalTimeText_Enter(sender, e);
private void LabelJulianDateText_MouseEnter(object sender, EventArgs e) => LabelJulianDateText_Enter(sender, e);
private void LabelModifiedJulianDateText_MouseEnter(object sender, EventArgs e) => LabelModifiedJulianDateText_Enter(sender, e);
private void LabelReducedJulianDateText_MouseEnter(object sender, EventArgs e) => LabelReducedJulianDateText_Enter(sender, e);
private void LabelTruncatedJulianDateText_MouseEnter(object sender, EventArgs e) => LabelTruncatedJulianDateText_Enter(sender, e);
private void LabelDublinJulianDateText_MouseEnter(object sender, EventArgs e) => LabelDublinJulianDateText_Enter(sender, e);
private void LabelCnesJulianDateText_MouseEnter(object sender, EventArgs e) => LabelCnesJulianDateText_Enter(sender, e);
private void LabelCcsdsJulianDateText_MouseEnter(object sender, EventArgs e) => LabelCcsdsJulianDateText_Enter(sender, e);
private void LabelLopJulianDateText_MouseEnter(object sender, EventArgs e) => LabelLopJulianDateText_Enter(sender, e);
private void LabelMillenniumJulianDateText_MouseEnter(object sender, EventArgs e) => LabelMillenniumJulianDateText_Enter(sender, e);
private void LabelChronologicalJulianDateText_MouseEnter(object sender, EventArgs e) => LabelChronologicalJulianDateText_Enter(sender, e);
private void LabelChronologicalModifiedJulianDateText_MouseEnter(object sender, EventArgs e) => LabelChronologicalModifiedJulianDateText_Enter(sender, e);
private void LabelLilianDateText_MouseEnter(object sender, EventArgs e) => LabelLilianDateText_Enter(sender, e);
private void LabelRataDieText_MouseEnter(object sender, EventArgs e) => LabelRataDieText_Enter(sender, e);
private void LabelMarsSolDateText_MouseEnter(object sender, EventArgs e) => LabelMarsSolDateText_Enter(sender, e);
private void LabelUnixtimeText_MouseEnter(object sender, EventArgs e) => LabelUnixtimeText_Enter(sender, e);
private void LabelUtcTime_MouseEnter(object sender, EventArgs e) => SetStatusBar(strText: labelUtcTime.AccessibleDescription);
private void LabelLocalTime_MouseEnter(object sender, EventArgs e) => SetStatusBar(strText: labelLocalTime.AccessibleDescription);
private void TextboxJulianDate_MouseEnter(object sender, EventArgs e) => SetStatusBar(strText: textboxJulianDate.AccessibleDescription);
private void TextboxModifiedJulianDate_MouseEnter(object sender, EventArgs e) => SetStatusBar(strText: textboxModifiedJulianDate.AccessibleDescription);
private void TextboxReducedJulianDate_MouseEnter(object sender, EventArgs e) => SetStatusBar(strText: textboxReducedJulianDate.AccessibleDescription);
private void TextboxTruncatedJulianDate_MouseEnter(object sender, EventArgs e) => SetStatusBar(strText: textboxTruncatedJulianDate.AccessibleDescription);
private void TextboxDublinJulianDate_MouseEnter(object sender, EventArgs e) => SetStatusBar(strText: textboxDublinJulianDate.AccessibleDescription);
private void TextboxCnesJulianDate_MouseEnter(object sender, EventArgs e) => SetStatusBar(strText: textboxCnesJulianDate.AccessibleDescription);
private void TextboxCcsdsJulianDate_MouseEnter(object sender, EventArgs e) => SetStatusBar(strText: textboxCcsdsJulianDate.AccessibleDescription);
private void TextboxLopJulianDate_MouseEnter(object sender, EventArgs e) => SetStatusBar(strText: textboxLopJulianDate.AccessibleDescription);
private void TextboxMillenniumJulianDate_MouseEnter(object sender, EventArgs e) => SetStatusBar(strText: textboxMillenniumJulianDate.AccessibleDescription);
private void TextboxChronologicalJulianDate_MouseEnter(object sender, EventArgs e) => SetStatusBar(strText: textboxChronologicalJulianDate.AccessibleDescription);
private void TextboxChronologicalModifiedJulianDate_MouseEnter(object sender, EventArgs e) => SetStatusBar(strText: textboxChronologicalModifiedJulianDate.AccessibleDescription);
private void TextboxLilianDate_MouseEnter(object sender, EventArgs e) => SetStatusBar(strText: textboxLilianDate.AccessibleDescription);
private void TextboxRataDie_MouseEnter(object sender, EventArgs e) => SetStatusBar(strText: textboxRataDie.AccessibleDescription);
private void TextboxMarsSolDate_MouseEnter(object sender, EventArgs e) => SetStatusBar(strText: textboxMarsSolDate.AccessibleDescription);
private void TextboxUnixtime_MouseEnter(object sender, EventArgs e) => SetStatusBar(strText: textboxUnixtime.AccessibleDescription);
#endregion
#region MouseLeave-Eventhandlers
private void LabelUtcTimeText_MouseLeave(object sender, EventArgs e) => LabelUtcTimeText_Leave(sender, e);
private void LabelLocalTimeText_MouseLeave(object sender, EventArgs e) => LabelLocalTimeText_Leave(sender, e);
private void LabelJulianDateText_MouseLeave(object sender, EventArgs e) => LabelJulianDateText_Leave(sender, e);
private void LabelModifiedJulianDateText_MouseLeave(object sender, EventArgs e) => LabelModifiedJulianDateText_Leave(sender, e);
private void LabelReducedJulianDateText_MouseLeave(object sender, EventArgs e) => LabelReducedJulianDateText_Leave(sender, e);
private void LabelTruncatedJulianDateText_MouseLeave(object sender, EventArgs e) => LabelTruncatedJulianDateText_Leave(sender, e);
private void LabelDublinJulianDateText_MouseLeave(object sender, EventArgs e) => LabelDublinJulianDateText_Leave(sender, e);
private void LabelCnesJulianDateText_MouseLeave(object sender, EventArgs e) => LabelCnesJulianDateText_Leave(sender, e);
private void LabelCcsdsJulianDateText_MouseLeave(object sender, EventArgs e) => LabelCcsdsJulianDateText_Leave(sender, e);
private void LabelLopJulianDateText_MouseLeave(object sender, EventArgs e) => LabelLopJulianDateText_Leave(sender, e);
private void LabelMillenniumJulianDateText_MouseLeave(object sender, EventArgs e) => LabelMillenniumJulianDateText_Leave(sender, e);
private void LabelChronologicalJulianDateText_MouseLeave(object sender, EventArgs e) => LabelChronologicalJulianDateText_Leave(sender, e);
private void LabelChronologicalModifiedJulianDateText_MouseLeave(object sender, EventArgs e) => LabelChronologicalModifiedJulianDateText_Leave(sender, e);
private void LabelLilianDateText_MouseLeave(object sender, EventArgs e) => LabelLilianDateText_Leave(sender, e);
private void LabelRataDieText_MouseLeave(object sender, EventArgs e) => LabelRataDieText_Leave(sender, e);
private void LabelMarsSolDateText_MouseLeave(object sender, EventArgs e) => LabelMarsSolDateText_Leave(sender, e);
private void LabelUnixtimeText_MouseLeave(object sender, EventArgs e) => LabelUnixtimeText_Leave(sender, e);
private void LabelUtcTime_MouseLeave(object sender, EventArgs e) => ResetStatusBar();
private void LabelLocalTime_MouseLeave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxJulianDate_MouseLeave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxModifiedJulianDate_MouseLeave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxReducedJulianDate_MouseLeave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxTruncatedJulianDate_MouseLeave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxDublinJulianDate_MouseLeave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxCnesJulianDate_MouseLeave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxCcsdsJulianDate_MouseLeave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxLopJulianDate_MouseLeave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxMillenniumJulianDate_MouseLeave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxChronologicalJulianDate_MouseLeave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxChronologicalModifiedJulianDate_MouseLeave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxLilianDate_MouseLeave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxRataDie_MouseLeave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxMarsSolDate_MouseLeave(object sender, EventArgs e) => ResetStatusBar();
private void TextboxUnixtime_MouseLeave(object sender, EventArgs e) => ResetStatusBar();
#endregion
#region TextChangend-Eventhandlers
private void TextboxJulianDate_TextChanged(object sender, EventArgs e)
{
double.TryParse(s: textboxJulianDate.Text.Replace(oldValue: ",", newValue: "."), style: style, provider: culture, result: out double julianDate);
if (julianDate < julianDateMinimum)
{
julianDate = julianDateMinimum;
textboxJulianDate.Text = julianDate.ToString(provider: culture);
labelUtcTime.Text = Resources.strOutOfYearRange;
}
else if (julianDate > julianDateMaximum)
{
julianDate = julianDateMaximum;
textboxJulianDate.Text = julianDate.ToString(provider: culture);
labelUtcTime.Text = Resources.strOutOfYearRange;
}
else
{
labelUtcTime.Text = JulianDates.ConvertJulianDateToCivilCalendar(julianDate: julianDate).ToString(provider: culture);
}
textboxModifiedJulianDate.Text = JulianDates.ConvertJulianDateToModifiedJulianDate(julianDate: julianDate).ToString(provider: culture);
textboxReducedJulianDate.Text = JulianDates.ConvertJulianDateToReducedJulianDate(julianDate: julianDate).ToString(provider: culture);
textboxTruncatedJulianDate.Text = JulianDates.ConvertJulianDateToTruncatedJulianDate(julianDate: julianDate).ToString(provider: culture);
textboxDublinJulianDate.Text = JulianDates.ConvertJulianDateToDublinJulianDate(julianDate: julianDate).ToString(provider: culture);
textboxCnesJulianDate.Text = JulianDates.ConvertJulianDateToCnesJulianDate(julianDate: julianDate).ToString(provider: culture);
textboxCcsdsJulianDate.Text = JulianDates.ConvertJulianDateToCcsdsJulianDate(julianDate: julianDate).ToString(provider: culture);
textboxLopJulianDate.Text = JulianDates.ConvertJulianDateToLopJulianDate(julianDate: julianDate).ToString(provider: culture);
textboxMillenniumJulianDate.Text = JulianDates.ConvertJulianDateToMillenniumJulianDate(julianDate: julianDate).ToString(provider: culture);
textboxChronologicalJulianDate.Text = JulianDates.ConvertJulianDateToChronologicalJulianDate(julianDate: julianDate).ToString(provider: culture);
textboxChronologicalModifiedJulianDate.Text = JulianDates.ConvertJulianDateToChronologicalModifiedJulianDate(julianDate: julianDate).ToString(provider: culture);
textboxLilianDate.Text = JulianDates.ConvertJulianDateToLilianDate(julianDate: julianDate).ToString(provider: culture);
textboxRataDie.Text = JulianDates.ConvertJulianDateToRataDie(julianDate: julianDate).ToString(provider: culture);
textboxMarsSolDate.Text = JulianDates.ConvertJulianDateToMarsSolDate(julianDate: julianDate).ToString(provider: culture);
textboxUnixtime.Text = JulianDates.ConvertJulianDateToUnixtime(julianDate: julianDate).ToString(provider: culture);
}
private void TextboxModifiedJulianDate_TextChanged(object sender, EventArgs e)
{
double.TryParse(s: textboxModifiedJulianDate.Text.Replace(oldValue: ",", newValue: "."), style: style, provider: culture, result: out double julianModifiedDate);
double julianDate = JulianDates.ConvertModifiedJulianDateToJulianDate(julianModifiedDate: julianModifiedDate);
if (julianDate < julianDateMinimum)
{
julianDate = julianDateMinimum;
textboxJulianDate.Text = julianDate.ToString(provider: culture);
labelUtcTime.Text = Resources.strOutOfYearRange;
}
else if (julianDate > julianDateMaximum)
{
julianDate = julianDateMaximum;
textboxJulianDate.Text = julianDate.ToString(provider: culture);
labelUtcTime.Text = Resources.strOutOfYearRange;
}
else
{
labelUtcTime.Text = JulianDates.ConvertJulianDateToCivilCalendar(julianDate: julianDate).ToString(provider: culture);
}
textboxJulianDate.Text = julianDate.ToString(provider: culture);
textboxReducedJulianDate.Text = JulianDates.ConvertJulianDateToReducedJulianDate(julianDate: julianDate).ToString(provider: culture);
textboxTruncatedJulianDate.Text = JulianDates.ConvertJulianDateToTruncatedJulianDate(julianDate: julianDate).ToString(provider: culture);
textboxDublinJulianDate.Text = JulianDates.ConvertJulianDateToDublinJulianDate(julianDate: julianDate).ToString(provider: culture);
textboxCnesJulianDate.Text = JulianDates.ConvertJulianDateToCnesJulianDate(julianDate: julianDate).ToString(provider: culture);
textboxCcsdsJulianDate.Text = JulianDates.ConvertJulianDateToCcsdsJulianDate(julianDate: julianDate).ToString(provider: culture);
textboxLopJulianDate.Text = JulianDates.ConvertJulianDateToLopJulianDate(julianDate: julianDate).ToString(provider: culture);
textboxMillenniumJulianDate.Text = JulianDates.ConvertJulianDateToMillenniumJulianDate(julianDate: julianDate).ToString(provider: culture);
textboxChronologicalJulianDate.Text = JulianDates.ConvertJulianDateToChronologicalJulianDate(julianDate: julianDate).ToString(provider: culture);
textboxChronologicalModifiedJulianDate.Text = JulianDates.ConvertJulianDateToChronologicalModifiedJulianDate(julianDate: julianDate).ToString(provider: culture);
textboxLilianDate.Text = JulianDates.ConvertJulianDateToLilianDate(julianDate: julianDate).ToString(provider: culture);
textboxRataDie.Text = JulianDates.ConvertJulianDateToRataDie(julianDate: julianDate).ToString(provider: culture);
textboxMarsSolDate.Text = JulianDates.ConvertJulianDateToMarsSolDate(julianDate: julianDate).ToString(provider: culture);
textboxUnixtime.Text = JulianDates.ConvertJulianDateToUnixtime(julianDate: julianDate).ToString(provider: culture);
}
private void TextboxReducedJulianDate_TextChanged(object sender, EventArgs e)
{
}
private void TextboxTruncatedJulianDate_TextChanged(object sender, EventArgs e)
{
}
private void TextboxDublinJulianDate_TextChanged(object sender, EventArgs e)
{
}
private void TextboxCnesJulianDate_TextChanged(object sender, EventArgs e)
{
}
private void TextboxCcsdsJulianDate_TextChanged(object sender, EventArgs e)
{
}
private void TextboxLopJulianDate_TextChanged(object sender, EventArgs e)
{
}
private void TextboxMillenniumJulianDate_TextChanged(object sender, EventArgs e)
{
}
private void TextboxChronologicalJulianDate_TextChanged(object sender, EventArgs e)
{
}
private void TextboxChronologicalModifiedJulianDate_TextChanged(object sender, EventArgs e)
{
}
private void TextboxLilianDate_TextChanged(object sender, EventArgs e)
{
}
private void TextboxRataDie_TextChanged(object sender, EventArgs e)
{
}
private void TextboxMarsSolDate_TextChanged(object sender, EventArgs e)
{
}
private void TextboxUnixtime_TextChanged(object sender, EventArgs e)
{
}
#endregion
#region KeyPress-Eventhandlers
private void TextboxJulianDate_KeyPress(object sender, KeyPressEventArgs e) => e.Handled = !IsOKForDecimalTextBox(theCharacter: e.KeyChar, theTextBox: textboxJulianDate);
private void TextboxModifiedJulianDate_KeyPress(object sender, KeyPressEventArgs e) => e.Handled = !IsOKForDecimalTextBox(theCharacter: e.KeyChar, theTextBox: textboxModifiedJulianDate);
private void TextboxReducedJulianDate_KeyPress(object sender, KeyPressEventArgs e) => e.Handled = !IsOKForDecimalTextBox(theCharacter: e.KeyChar, theTextBox: textboxReducedJulianDate);
private void TextboxTruncatedJulianDate_KeyPress(object sender, KeyPressEventArgs e) => e.Handled = !IsOKForDecimalTextBox(theCharacter: e.KeyChar, theTextBox: textboxTruncatedJulianDate);
private void TextboxDublinJulianDate_KeyPress(object sender, KeyPressEventArgs e) => e.Handled = !IsOKForDecimalTextBox(theCharacter: e.KeyChar, theTextBox: textboxDublinJulianDate);
private void TextboxCnesJulianDate_KeyPress(object sender, KeyPressEventArgs e) => e.Handled = !IsOKForDecimalTextBox(theCharacter: e.KeyChar, theTextBox: textboxCnesJulianDate);
private void TextboxCcsdsJulianDate_KeyPress(object sender, KeyPressEventArgs e) => e.Handled = !IsOKForDecimalTextBox(theCharacter: e.KeyChar, theTextBox: textboxCcsdsJulianDate);
private void TextboxLopJulianDate_KeyPress(object sender, KeyPressEventArgs e) => e.Handled = !IsOKForDecimalTextBox(theCharacter: e.KeyChar, theTextBox: textboxLopJulianDate);
private void TextboxMillenniumJulianDate_KeyPress(object sender, KeyPressEventArgs e) => e.Handled = !IsOKForDecimalTextBox(theCharacter: e.KeyChar, theTextBox: textboxMillenniumJulianDate);
private void TextboxChronologicalJulianDate_KeyPress(object sender, KeyPressEventArgs e) => e.Handled = !IsOKForDecimalTextBox(theCharacter: e.KeyChar, theTextBox: textboxChronologicalJulianDate);
private void TextboxChronologicalModifiedJulianDate_KeyPress(object sender, KeyPressEventArgs e) => e.Handled = !IsOKForDecimalTextBox(theCharacter: e.KeyChar, theTextBox: textboxChronologicalModifiedJulianDate);
private void TextboxLilianDate_KeyPress(object sender, KeyPressEventArgs e) => e.Handled = !IsOKForDecimalTextBox(theCharacter: e.KeyChar, theTextBox: textboxLilianDate);
private void TextboxRataDie_KeyPress(object sender, KeyPressEventArgs e) => e.Handled = !IsOKForDecimalTextBox(theCharacter: e.KeyChar, theTextBox: textboxRataDie);
private void TextboxMarsSolDate_KeyPress(object sender, KeyPressEventArgs e) => e.Handled = !IsOKForDecimalTextBox(theCharacter: e.KeyChar, theTextBox: textboxMarsSolDate);
private void TextboxUnixTime_KeyPress(object sender, KeyPressEventArgs e) => e.Handled = !IsOKForDecimalTextBox(theCharacter: e.KeyChar, theTextBox: textboxUnixtime);
#endregion
}
}