-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTychoCatalogViewerForm.cs
1930 lines (1389 loc) · 171 KB
/
TychoCatalogViewerForm.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
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using System;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
using Hipparcos_DB.Properties;
namespace Hipparcos_DB
{
/// <summary>
/// TychoCatalogViewerForm : Form
/// </summary>
public partial class TychoCatalogViewerForm : Form
{
/// <summary>
/// AstroElement
/// </summary>
private enum AstroElement
{
None = 0,
CatalogDesc,
IdentifierDesc,
ProximityFlagDesc,
RightAscensionDesc,
DeclinationDesc,
MagnitudeJohnsonDesc,
SourceOfMagnitudeDesc,
AlphaDesc,
DeltaDesc,
ReferenceFlagForAstrometryDesc,
TrigonomicParallaxDesc,
ProperMotionAlphaDesc,
ProperMotionDeltaDesc,
StandardErrorRightAscensionDesc,
StandardErrorDeclinationDesc,
StandardErrorTrigonomicParallaxDesc,
StandardErrorProperMotionRightAscensionDesc,
StandardErrorProperMotionDeclinationDesc,
CorrelationDeclinationByRightAscensionDesc,
CorrelationTrigonomicParallaxByRightAscensionDesc,
CorrelationTrigonomicParallaxByDeclinationDesc,
CorrelationProperMotionRightAscensionByRightAscensionDesc,
CorrelationProperMotionRightAscensionByDeclinationDesc,
CorrelationProperMotionRightAscensionByTrigonomicParallaxDesc,
CorrelationProperMotionDeclinationByRightAscensionDesc,
CorrelationProperMotionDeclinationByDeclinationDesc,
CorrelationProperMotionDeclinationByTrigonomicParallaxDesc,
CorrelationProperMotionDeclinationByProperMotionRightAscensionDesc,
NumberOfTransitsForAstrometryDesc,
GoodnessOfFitParameterDesc,
HipparcosNumberDesc,
MeanBtMagnitudeDesc,
StandardErrorMeanBtMagnitudeDesc,
MeanVtMagnitudeDesc,
StandardErrorMeanVtMagnitudeDesc,
SourceOfPhotometryDesc,
JohnsonBvColorDesc,
StandardErrorJohnsonBvColorDesc,
AstrometricQualityFlagDesc,
SignalToNoiseRatioOfTheStarImageDesc,
SourceOfAstrometricDataDesc,
NumberOfTransitsForPhotometryDesc,
EstimateOfVtmagScatterDesc,
VtmagAtMaximumDesc,
VtmagAtMinimumDesc,
KnownVariabilityFromGcvsNsvDesc,
VariabilityFromTychoDesc,
DuplicityFromTychoDesc,
EpochPhotometryInAnnexDesc,
CcdmComponentIdentifierDesc,
PpmAndSupplementDesc,
HdNumberDesc,
BonnerDmDesc,
CordobaDmDesc,
CapePhotographicDmDesc,
NotesDesc,
CatalogData,
IdentifierData,
ProximityFlagData,
RightAscensionData,
DeclinationData,
MagnitudeJohnsonData,
SourceOfMagnitudeData,
AlphaData,
DeltaData,
ReferenceFlagForAstrometryData,
TrigonomicParallaxData,
ProperMotionAlphaData,
ProperMotionDeltaData,
StandardErrorRightAscensionData,
StandardErrorDeclinationData,
StandardErrorTrigonomicParallaxData,
StandardErrorProperMotionRightAscensionData,
StandardErrorProperMotionDeclinationData,
CorrelationDeclinationByRightAscensionData,
CorrelationTrigonomicParallaxByRightAscensionData,
CorrelationTrigonomicParallaxByDeclinationData,
CorrelationProperMotionRightAscensionByRightAscensionData,
CorrelationProperMotionRightAscensionByDeclinationData,
CorrelationProperMotionRightAscensionByTrigonomicParallaxData,
CorrelationProperMotionDeclinationByRightAscensionData,
CorrelationProperMotionDeclinationByDeclinationData,
CorrelationProperMotionDeclinationByTrigonomicParallaxData,
CorrelationProperMotionDeclinationByProperMotionRightAscensionData,
NumberOfTransitsForAstrometryData,
GoodnessOfFitParameterData,
HipparcosNumberData,
MeanBtMagnitudeData,
StandardErrorMeanBtMagnitudeData,
MeanVtMagnitudeData,
StandardErrorMeanVtMagnitudeData,
SourceOfPhotometryData,
JohnsonBvColorData,
StandardErrorJohnsonBvColorData,
AstrometricQualityFlagData,
SignalToNoiseRatioOfTheStarImageData,
SourceOfAstrometricDataData,
NumberOfTransitsForPhotometryData,
EstimateOfVtmagScatterData,
VtmagAtMaximumData,
VtmagAtMinimumData,
KnownVariabilityFromGcvsNsvData,
VariabilityFromTychoData,
DuplicityFromTychoData,
EpochPhotometryInAnnexData,
CcdmComponentIdentifierData,
PpmAndSupplementData,
HdNumberData,
BonnerDmData,
CordobaDmData,
CapePhotographicDmData,
NotesData
}
/// <summary>
/// Settings
/// </summary>
private readonly Settings settings = new Settings();
/// <summary>
/// True if database is loading
/// </summary>
private bool isDatabaseLoading = true;
/// <summary>
/// Catalog entries
/// </summary>
private string[] catalogEntries;
/// <summary>
/// Value of the enum of the astrophysical elements
/// </summary>
private uint astrophysicalElement = 0;
/// <summary>
/// Index variable
/// </summary>
private uint index = 0;
/// <summary>
/// Maximal value of the index variable
/// </summary>
private uint maxIndex = 0;
/// <summary>
/// Culture info
/// </summary>
private static readonly CultureInfo culture = CultureInfo.CurrentUICulture;
#region Local methods
/// <summary>
/// Copy a text to the clipbpard
/// </summary>
/// <param name="text">text to copy</param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1300:SpecifyMessageBoxOptions")]
private void CopyToClipboard(string text)
{
Clipboard.SetText(text: text);
MessageBox.Show(
owner: this,
text: Resources.copiedToClipboardText,
caption: Resources.copiedToClipboardTitle,
buttons: MessageBoxButtons.OK,
icon: MessageBoxIcon.Information,
defaultButton: MessageBoxDefaultButton.Button1);
}
/// <summary>
/// Copy a text to the clipboard while entering a control
/// </summary>
/// <param name="sender">object sender</param>
/// <param name="e">event arguments</param>
/// <remarks>The parameter <paramref name="e"/> is not needed, but must be indicated.</remarks>
private void CopyToClipboard(object sender, EventArgs e)
{
if (sender is Control control)
{
CopyToClipboard(text: control.Text);
}
else if (sender is ToolStripButton toolStripButton)
{
CopyToClipboard(text: toolStripButton.Text);
}
else if (sender is ToolStripMenuItem toolStripMenuItem)
{
CopyToClipboard(text: toolStripMenuItem.Text);
}
else if (sender is ToolStripLabel toolStripLabel)
{
CopyToClipboard(text: toolStripLabel.Text);
}
else if (sender is ToolStripComboBox toolStripComboBox)
{
CopyToClipboard(text: toolStripComboBox.Text);
}
else if (sender is ToolStripDropDown toolStripDropDown)
{
CopyToClipboard(text: toolStripDropDown.Text);
}
else if (sender is ToolStripDropDownButton toolStripDropDownButton)
{
CopyToClipboard(text: toolStripDropDownButton.Text);
}
else if (sender is ToolStripDropDownItem toolStripDropDownItem)
{
CopyToClipboard(text: toolStripDropDownItem.Text);
}
else if (sender is ToolStripDropDownMenu toolStripDropDownMenu)
{
CopyToClipboard(text: toolStripDropDownMenu.Text);
}
else if (sender is ToolStripProgressBar toolStripProgressBar)
{
CopyToClipboard(text: toolStripProgressBar.Text);
}
else if (sender is ToolStripSplitButton toolStripSplitButton)
{
CopyToClipboard(text: toolStripSplitButton.Text);
}
else if (sender is ToolStripSeparator toolStripSeparator)
{
CopyToClipboard(text: toolStripSeparator.Text);
}
else if (sender is ToolStripStatusLabel toolStripStatusLabel)
{
CopyToClipboard(text: toolStripStatusLabel.Text);
}
else if (sender is ToolStripTextBox toolStripTextBox)
{
CopyToClipboard(text: toolStripTextBox.Text);
}
}
/// <summary>
/// Set the information text in the status bar
/// </summary>
/// <param name="text">text to show</param>
private void SetStatusbar(string text) => toolStripStatusLabelInfo.Text = text;
/// <summary>
/// Set the information text in the status bar while entering a control
/// </summary>
/// <param name="sender">object sender</param>
/// <param name="e">event arguments</param>
/// <remarks>The parameter <paramref name="e"/> is not needed, but must be indicated.</remarks>
private void SetStatusbar(object sender, EventArgs e)
{
if (sender is Control control)
{
SetStatusbar(text: control.AccessibleDescription);
}
else if (sender is ToolStripButton toolStripButton)
{
SetStatusbar(text: toolStripButton.AccessibleDescription);
}
else if (sender is ToolStripMenuItem toolStripMenuItem)
{
SetStatusbar(text: toolStripMenuItem.AccessibleDescription);
}
else if (sender is ToolStripLabel toolStripLabel)
{
SetStatusbar(text: toolStripLabel.AccessibleDescription);
}
else if (sender is ToolStripComboBox toolStripComboBox)
{
SetStatusbar(text: toolStripComboBox.AccessibleDescription);
}
else if (sender is ToolStripDropDown toolStripDropDown)
{
SetStatusbar(text: toolStripDropDown.AccessibleDescription);
}
else if (sender is ToolStripDropDownButton toolStripDropDownButton)
{
SetStatusbar(text: toolStripDropDownButton.AccessibleDescription);
}
else if (sender is ToolStripDropDownItem toolStripDropDownItem)
{
SetStatusbar(text: toolStripDropDownItem.AccessibleDescription);
}
else if (sender is ToolStripDropDownMenu toolStripDropDownMenu)
{
SetStatusbar(text: toolStripDropDownMenu.AccessibleDescription);
}
else if (sender is ToolStripProgressBar toolStripProgressBar)
{
SetStatusbar(text: toolStripProgressBar.AccessibleDescription);
}
else if (sender is ToolStripSplitButton toolStripSplitButton)
{
SetStatusbar(text: toolStripSplitButton.AccessibleDescription);
}
else if (sender is ToolStripSeparator toolStripSeparator)
{
SetStatusbar(text: toolStripSeparator.AccessibleDescription);
}
else if (sender is ToolStripStatusLabel toolStripStatusLabel)
{
SetStatusbar(text: toolStripStatusLabel.AccessibleDescription);
}
else if (sender is ToolStripTextBox toolStripTextBox)
{
SetStatusbar(text: toolStripTextBox.AccessibleDescription);
}
}
/// <summary>
/// Clear the information text in the status bar
/// </summary>
private void ClearStatusbar() => toolStripStatusLabelInfo.Text = string.Empty;
/// <summary>
/// Set the highlight color to itself and set the information text in the status bar while entering the control
/// </summary>
/// <param name="astroElemId">id of the astrophysical element</param>
/// <param name="labelSelf">label of the astrophysical element</param>
/// <param name="color">highlight color</param>
/// <param name="sender">object sender</param>
/// <param name="e">event arguments</param>
private void SetColorSelfAndSetStatusbar(uint astroElemId, ref Label labelSelf, Color color, object sender, EventArgs e)
{
if (!isDatabaseLoading)
{
astrophysicalElement = astroElemId;
SetStatusbar(sender: sender, e: e);
if (settings.UserEnableHoverEffect)
{
SetColorSelf(labelSelf: ref labelSelf, color: color);
}
}
}
/// <summary>
/// Set the color to itself and clear the information text in the status bar while leaving the control
/// </summary>
/// <param name="labelSelf">label of the astrophysical element</param>
/// <param name="color">color</param>
private void SetColorSelfAndClearStatusbar(ref Label labelSelf, Color color)
{
if (!isDatabaseLoading)
{
ClearStatusbar();
if (settings.UserEnableHoverEffect)
{
SetColorSelf(labelSelf: ref labelSelf, color: color);
}
}
}
/// <summary>
/// Set the highlight color to itself and the neighbor field and set the information text in the status bar while entering the control
/// </summary>
/// <param name="astroElemId">id of the astrophysical element</param>
/// <param name="labelSelf">label of the astrophysical element</param>
/// <param name="labelNeighbor">label of the astrophysical element in the neighbor field</param>
/// <param name="color">highlight color</param>
/// <param name="sender">object sender</param>
/// <param name="e">event arguments</param>
private void SetColorSelfAndNeighborAndSetStatusbar(uint astroElemId, ref Label labelSelf, ref Label labelNeighbor, Color color, object sender, EventArgs e)
{
if (!isDatabaseLoading)
{
astrophysicalElement = astroElemId;
SetStatusbar(sender: sender, e: e);
if (settings.UserEnableHoverEffect)
{
SetColorSelfAndNeighbor(labelSelf: ref labelSelf, labelNeighbor: ref labelNeighbor, color: color);
}
}
}
/// <summary>
/// Set the color to itself and the neighbor field and clear the information text in the status bar while leaving the control
/// </summary>
/// <param name="labelSelf">label of the astrophysical element</param>
/// <param name="labelNeighbor">label of the astrophysical element in the neighbor field</param>
/// <param name="color">color</param>
private void SetColorSelfAndNeighborAndClearStatusbar(ref Label labelSelf, ref Label labelNeighbor, Color color)
{
if (!isDatabaseLoading)
{
ClearStatusbar();
if (settings.UserEnableHoverEffect)
{
SetColorSelfAndNeighbor(labelSelf: ref labelSelf, labelNeighbor: ref labelNeighbor, color: color);
}
}
}
/// <summary>
/// Set the color to itself
/// </summary>
/// <param name="labelSelf">label of the astrophysical element</param>
/// <param name="color">color</param>
private static void SetColorSelf(ref Label labelSelf, Color color) => labelSelf.BackColor = color;
/// <summary>
/// Set the color to itself and the neighbor field
/// </summary>
/// <param name="labelSelf">label of the astrophysical element</param>
/// <param name="labelNeighbor">label of the astrophysical element in the neighbor field</param>
/// <param name="color">color</param>
private static void SetColorSelfAndNeighbor(ref Label labelSelf, ref Label labelNeighbor, Color color) => labelSelf.BackColor = labelNeighbor.BackColor = color;
/// <summary>
/// Update the index label
/// </summary>
private void UpdateIndexLabel() => toolStripTextBoxGoToIndex.Text = index.ToString(provider: culture);
/// <summary>
/// Check if the index is the minimum
/// </summary>
private void CheckIndexMinimum()
{
if (index < 1 || index > maxIndex)
{
index = 1;
}
}
/// <summary>
/// Check if the index is the maximum
/// </summary>
private void CheckIndexMaximum()
{
if (index > maxIndex)
{
index = maxIndex;
}
}
/// <summary>
/// Show all astrophysical elements of the index
/// </summary>
private void ShowEntriesOnIndex()
{
labelCatalogData.Text = catalogEntries[index - 1].Substring(startIndex: 0, length: 1); //.Trim();
labelIdentifierData.Text = catalogEntries[index - 1].Substring(startIndex: 2, length: 12); //.Trim();
labelProximityFlagData.Text = catalogEntries[index - 1].Substring(startIndex: 15, length: 1); //.Trim();
labelRightAscensionData.Text = catalogEntries[index - 1].Substring(startIndex: 17, length: 11); //.Trim();
labelDeclinationData.Text = catalogEntries[index - 1].Substring(startIndex: 29, length: 11); //.Trim();
labelMagnitudeJohnsonData.Text = catalogEntries[index - 1].Substring(startIndex: 41, length: 5); //.Trim();
labelSourceOfMagnitudeData.Text = catalogEntries[index - 1].Substring(startIndex: 47, length: 1); //.Trim();
labelAlphaData.Text = catalogEntries[index - 1].Substring(startIndex: 51, length: 12); //.Trim();
labelDeltaData.Text = catalogEntries[index - 1].Substring(startIndex: 64, length: 12); //.Trim();
labelReferenceFlagForAstrometryData.Text = catalogEntries[index - 1].Substring(startIndex: 77, length: 1); //.Trim();
labelTrigonomicParallaxData.Text = catalogEntries[index - 1].Substring(startIndex: 79, length: 6); //.Trim();
labelProperMotionAlphaData.Text = catalogEntries[index - 1].Substring(startIndex: 87, length: 7); //.Trim();
labelProperMotionDeltaData.Text = catalogEntries[index - 1].Substring(startIndex: 96, length: 7); //.Trim();
labelStandardErrorRightAscensionData.Text = catalogEntries[index - 1].Substring(startIndex: 105, length: 5); //.Trim();
labelStandardErrorDeclinationData.Text = catalogEntries[index - 1].Substring(startIndex: 112, length: 5); //.Trim();
labelStandardErrorTrigonomicParallaxData.Text = catalogEntries[index - 1].Substring(startIndex: 119, length: 5); //.Trim();
labelStandardErrorProperMotionRightAscensionData.Text = catalogEntries[index - 1].Substring(startIndex: 126, length: 5); //.Trim();
labelStandardErrorProperMotionDeclinationData.Text = catalogEntries[index - 1].Substring(startIndex: 133, length: 5); //.Trim();
labelCorrelationDeclinationByRightAscensionData.Text = catalogEntries[index - 1].Substring(startIndex: 140, length: 5); //.Trim();
labelCorrelationTrigonomicParallaxByRightAscensionData.Text = catalogEntries[index - 1].Substring(startIndex: 146, length: 5); //.Trim();
labelCorrelationTrigonomicParallaxByDeclinationData.Text = catalogEntries[index - 1].Substring(startIndex: 152, length: 5); //.Trim();
labelCorrelationProperMotionRightAscensionByRightAscensionData.Text = catalogEntries[index - 1].Substring(startIndex: 158, length: 5); //.Trim();
labelCorrelationProperMotionRightAscensionByDeclinationData.Text = catalogEntries[index - 1].Substring(startIndex: 164, length: 5); //.Trim();
labelCorrelationProperMotionRightAscensionByTrigonomicParallaxData.Text = catalogEntries[index - 1].Substring(startIndex: 170, length: 5); //.Trim();
labelCorrelationProperMotionDeclinationByRightAscensionData.Text = catalogEntries[index - 1].Substring(startIndex: 176, length: 5); //.Trim();
labelCorrelationProperMotionDeclinationByTrigonomicParallaxData.Text = catalogEntries[index - 1].Substring(startIndex: 182, length: 5); //.Trim();
labelCorrelationProperMotionDeclinationByDeclinationData.Text = catalogEntries[index - 1].Substring(startIndex: 188, length: 5); //.Trim();
labelCorrelationProperMotionDeclinationByProperMotionRightAscensionData.Text = catalogEntries[index - 1].Substring(startIndex: 194, length: 5); //.Trim();
labelNumberOfTransitsForAstrometryData.Text = catalogEntries[index - 1].Substring(startIndex: 200, length: 3); //.Trim();
labelGoodnessOfFitParameterData.Text = catalogEntries[index - 1].Substring(startIndex: 204, length: 5); //.Trim();
labelHipparcosNumberData.Text = catalogEntries[index - 1].Substring(startIndex: 210, length: 6); //.Trim();
labelMeanBtMagnitudeData.Text = catalogEntries[index - 1].Substring(startIndex: 217, length: 6); //.Trim();
labelStandardErrorMeanBtMagnitudeData.Text = catalogEntries[index - 1].Substring(startIndex: 224, length: 5); //.Trim();
labelMeanVtMagnitudeData.Text = catalogEntries[index - 1].Substring(startIndex: 230, length: 6); //.Trim();
labelStandardErrorMeanVtMagnitudeData.Text = catalogEntries[index - 1].Substring(startIndex: 237, length: 5); //.Trim();
labelSourceOfPhotometryData.Text = catalogEntries[index - 1].Substring(startIndex: 243, length: 1); //.Trim();
labelJohnsonBvColorData.Text = catalogEntries[index - 1].Substring(startIndex: 245, length: 6); //.Trim();
labelStandardErrorJohnsonBvColorData.Text = catalogEntries[index - 1].Substring(startIndex: 252, length: 5); //.Trim();
labelAstrometricQualityFlagData.Text = catalogEntries[index - 1].Substring(startIndex: 260, length: 1); //.Trim();
labelSignalToNoiseRatioOfTheStarImageData.Text = catalogEntries[index - 1].Substring(startIndex: 262, length: 4); //.Trim();
labelSourceOfAstrometricDataData.Text = catalogEntries[index - 1].Substring(startIndex: 267, length: 1); //.Trim();
labelNumberOfTransitsForPhotometryData.Text = catalogEntries[index - 1].Substring(startIndex: 269, length: 3); //.Trim();
labelEstimateOfVtmagScatterData.Text = catalogEntries[index - 1].Substring(startIndex: 273, length: 5); //.Trim();
labelVtmagAtMaximumData.Text = catalogEntries[index - 1].Substring(startIndex: 279, length: 5); //.Trim();
labelVtmagAtMinimumData.Text = catalogEntries[index - 1].Substring(startIndex: 285, length: 5); //.Trim();
labelKnownVariabilityFromGcvsNsvData.Text = catalogEntries[index - 1].Substring(startIndex: 291, length: 1); //.Trim();
labelVariabilityFromTychoData.Text = catalogEntries[index - 1].Substring(startIndex: 293, length: 1); //.Trim();
labelDuplicityFromTychoData.Text = catalogEntries[index - 1].Substring(startIndex: 295, length: 1); //.Trim();
labelEpochPhotometryInAnnexData.Text = catalogEntries[index - 1].Substring(startIndex: 297, length: 1); //.Trim();
labelCcdmComponentIdentifierData.Text = catalogEntries[index - 1].Substring(startIndex: 299, length: 2).Trim();
labelPpmAndSupplementData.Text = catalogEntries[index - 1].Substring(startIndex: 302, length: 6); //.Trim();
labelHdNumberData.Text = catalogEntries[index - 1].Substring(startIndex: 309, length: 6); //.Trim();
labelBonnerDmData.Text = catalogEntries[index - 1].Substring(startIndex: 316, length: 10).Trim();
labelCordobaDmData.Text = catalogEntries[index - 1].Substring(startIndex: 327, length: 10); //.Trim();
labelCapePhotographicDmData.Text = catalogEntries[index - 1].Substring(startIndex: 338, length: 10); //.Trim();
labelNotesData.Text = catalogEntries[index - 1].Substring(startIndex: 349, length: 1); //.Trim();
}
/// <summary>
/// Go the a specified index number
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1300:SpecifyMessageBoxOptions")]
private void GoToIndex()
{
if (int.TryParse(s: toolStripTextBoxGoToIndex.Text, result: out int tempIndex))
{
if (tempIndex < 1 || tempIndex > maxIndex)
{
MessageBox.Show(
owner: this,
text: Resources.numberOutOfRangeText,
caption: Resources.numberOutOfRangeTitle,
buttons: MessageBoxButtons.OK,
icon: MessageBoxIcon.Error,
defaultButton: MessageBoxDefaultButton.Button1);
}
else
{
index = Convert.ToUInt32(value: tempIndex);
UpdateIndexLabel();
ShowEntriesOnIndex();
}
}
else
{
MessageBox.Show(
owner: this,
text: Resources.wrongNumberFormatText,
caption: Resources.wrongNumberFormatTitle,
buttons: MessageBoxButtons.OK,
icon: MessageBoxIcon.Error,
defaultButton: MessageBoxDefaultButton.Button1);
}
}
/// <summary>
/// Set a double buffer to a specified control
/// </summary>
/// <param name="control">double buffered control</param>
private static void SetDoubleBuffered(Control control)
{
if (SystemInformation.TerminalServerSession)
{
return;
}
PropertyInfo aProp = typeof(Control).GetProperty(name: "DoubleBuffered", bindingAttr: BindingFlags.NonPublic | BindingFlags.Instance);
aProp.SetValue(obj: control, value: true, index: null);
}
#endregion
#region Con- and destructor
/// <summary>
/// Constructor
/// </summary>
public TychoCatalogViewerForm()
{
InitializeComponent();
switch (settings.UserDataTableStyle)
{
case 0: tableLayoutPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.OutsetDouble; break;
case 1: tableLayoutPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.InsetDouble; break;
default: tableLayoutPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.OutsetDouble; break;
}
switch (settings.UserStartPosition)
{
case 0: StartPosition = FormStartPosition.CenterParent; break;
case 1: StartPosition = FormStartPosition.CenterScreen; break;
default: StartPosition = FormStartPosition.CenterParent; break;
}
}
#endregion
#region Form* event handlers
/// <summary>
/// Load the window
/// </summary>
/// <param name="sender">object sender</param>
/// <param name="e">event arguments</param>
/// <remarks>The parameters <paramref name="sender"/> and <paramref name="e"/> are not needed, but must be indicated.</remarks>
private void TychoCatalogViewerForm_Load(object sender, EventArgs e)
{
switch (settings.UserEnableHoverEffect)
{
default:
toolStripButtonChangeHoverEffect.Checked = true;
toolStripButtonChangeHoverEffect.Image = Resources.fugue_table_select_row_16px_shadowless;
break;
case false:
toolStripButtonChangeHoverEffect.Checked = false;
toolStripButtonChangeHoverEffect.Image = Resources.fugue_table_16px_shadowless;
break;
}
switch (settings.UserDataTableStyle)
{
default:
tableLayoutPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.OutsetDouble;
break;
case 1:
tableLayoutPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.InsetDouble;
break;
}
SetDoubleBuffered(control: tableLayoutPanel);
backgroundWorker.RunWorkerAsync();
}
/// <summary>
/// Save the settings while closing the window
/// </summary>
/// <param name="sender">object sender</param>
/// <param name="e">event arguments</param>
/// <remarks>The parameters <paramref name="sender"/> and <paramref name="e"/> are not needed, but must be indicated.</remarks>
private void TychoCatalogViewerForm_FormClosing(object sender, FormClosingEventArgs e) => settings.Save();
#endregion
#region BackgroundWorker event handler
/// <summary>
/// Load the Hipparcos-DB in background
/// </summary>
/// <param name="sender">object sender</param>
/// <param name="e">event arguments</param>
/// <remarks>The parameters <paramref name="sender"/> and <paramref name="e"/> are not needed, but must be indicated.</remarks>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1300:SpecifyMessageBoxOptions")]
private void BackgroundWorker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
{
string dataFile = settings.UserHipparcosCatalogDirectory + "tyc_main.dat";
if (File.Exists(path: dataFile))
{
menuStrip.Enabled = toolStrip.Visible = false;
toolStripStatusLabelInfo.Text = Resources.loadingFile;
catalogEntries = File.ReadAllLines(path: dataFile);
index = 1;
maxIndex = Convert.ToUInt32(value: catalogEntries.Length);
toolStripLabelMaxIndex.Text = "of " + maxIndex.ToString(provider: culture);
progressBar.Visible = false;
isDatabaseLoading = false;
menuStrip.Enabled = toolStrip.Visible = true;
ClearStatusbar();
UpdateIndexLabel();
ShowEntriesOnIndex();
}
else
{
MessageBox.Show(
owner: this,
text: Resources.missingDownloadFilesText1,
caption: Resources.missingDownloadFilesTitle,
buttons: MessageBoxButtons.OK,
icon: MessageBoxIcon.Error,
defaultButton: MessageBoxDefaultButton.Button1);
Close();
}
}
#endregion
#region Click event handlers
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", MessageId = "System.GC.Collect")]
private void MenuitemClose_Click(object sender, EventArgs e)
{
Array.Clear(array: catalogEntries, index: 0, length: catalogEntries.Length);
GC.Collect();
Close();
}
private void ToolStripButtonStepToBegin_Click(object sender, EventArgs e)
{
index = 1;
UpdateIndexLabel();
ShowEntriesOnIndex();
}
private void ToolStripButtonStepFastBackward_Click(object sender, EventArgs e)
{
index -= 1000;
CheckIndexMinimum();
UpdateIndexLabel();
ShowEntriesOnIndex();
}
private void ToolStripButtonStepBackward_Click(object sender, EventArgs e)
{
index--;
CheckIndexMinimum();
UpdateIndexLabel();
ShowEntriesOnIndex();
}
private void ToolStripButtonStepForward_Click(object sender, EventArgs e)
{
index++;
CheckIndexMaximum();
UpdateIndexLabel();
ShowEntriesOnIndex();
}
private void ToolStripButtonStepFastForward_Click(object sender, EventArgs e)
{
index += 1000;
CheckIndexMaximum();
UpdateIndexLabel();
ShowEntriesOnIndex();
}
private void ToolStripButtonStepToEnd_Click(object sender, EventArgs e)
{
index = maxIndex;
UpdateIndexLabel();
ShowEntriesOnIndex();
}
private void ToolStripButtonGoToIndex_Click(object sender, EventArgs e) => GoToIndex();
private void ToolStripMenuItemInfo_Click(object sender, EventArgs e)
{
using (AboutBoxForm formAboutBox = new AboutBoxForm())
{
formAboutBox.ShowDialog();
}
}
private void ToolStripMenuItemCopyData_Click(object sender, EventArgs e)
{
switch (astrophysicalElement)
{
case (uint)AstroElement.None: break;
case (uint)AstroElement.CatalogDesc: CopyToClipboard(text: labelCatalogDesc.Text); break;
case (uint)AstroElement.IdentifierDesc: CopyToClipboard(text: labelIdentifierDesc.Text); break;
case (uint)AstroElement.ProximityFlagDesc: CopyToClipboard(text: labelProximityFlagDesc.Text); break;
case (uint)AstroElement.RightAscensionDesc: CopyToClipboard(text: labelRightAscensionDesc.Text); break;
case (uint)AstroElement.DeclinationDesc: CopyToClipboard(text: labelDeclinationDesc.Text); break;
case (uint)AstroElement.MagnitudeJohnsonDesc: CopyToClipboard(text: labelMagnitudeJohnsonDesc.Text); break;
case (uint)AstroElement.SourceOfMagnitudeDesc: CopyToClipboard(text: labelSourceOfMagnitudeDesc.Text); break;
case (uint)AstroElement.AlphaDesc: CopyToClipboard(text: labelAlphaDesc.Text); break;
case (uint)AstroElement.DeltaDesc: CopyToClipboard(text: labelDeltaDesc.Text); break;
case (uint)AstroElement.ReferenceFlagForAstrometryDesc: CopyToClipboard(text: labelReferenceFlagForAstrometryDesc.Text); break;
case (uint)AstroElement.TrigonomicParallaxDesc: CopyToClipboard(text: labelTrigonomicParallaxDesc.Text); break;
case (uint)AstroElement.ProperMotionAlphaDesc: CopyToClipboard(text: labelProperMotionAlphaDesc.Text); break;
case (uint)AstroElement.ProperMotionDeltaDesc: CopyToClipboard(text: labelProperMotionDeltaDesc.Text); break;
case (uint)AstroElement.StandardErrorRightAscensionDesc: CopyToClipboard(text: labelStandardErrorRightAscensionDesc.Text); break;
case (uint)AstroElement.StandardErrorDeclinationDesc: CopyToClipboard(text: labelStandardErrorDeclinationDesc.Text); break;
case (uint)AstroElement.StandardErrorTrigonomicParallaxDesc: CopyToClipboard(text: labelStandardErrorTrigonomicParallaxDesc.Text); break;
case (uint)AstroElement.StandardErrorProperMotionRightAscensionDesc: CopyToClipboard(text: labelStandardErrorProperMotionRightAscensionDesc.Text); break;
case (uint)AstroElement.StandardErrorProperMotionDeclinationDesc: CopyToClipboard(text: labelStandardErrorProperMotionDeclinationDesc.Text); break;
case (uint)AstroElement.CorrelationDeclinationByRightAscensionDesc: CopyToClipboard(text: labelCorrelationDeclinationByRightAscensionDesc.Text); break;
case (uint)AstroElement.CorrelationTrigonomicParallaxByRightAscensionDesc: CopyToClipboard(text: labelCorrelationTrigonomicParallaxByRightAscensionDesc.Text); break;
case (uint)AstroElement.CorrelationTrigonomicParallaxByDeclinationDesc: CopyToClipboard(text: labelCorrelationTrigonomicParallaxByDeclinationDesc.Text); break;
case (uint)AstroElement.CorrelationProperMotionRightAscensionByRightAscensionDesc: CopyToClipboard(text: labelCorrelationProperMotionRightAscensionByRightAscensionDesc.Text); break;
case (uint)AstroElement.CorrelationProperMotionRightAscensionByDeclinationDesc: CopyToClipboard(text: labelCorrelationProperMotionRightAscensionByDeclinationDesc.Text); break;
case (uint)AstroElement.CorrelationProperMotionRightAscensionByTrigonomicParallaxDesc: CopyToClipboard(text: labelCorrelationProperMotionRightAscensionByTrigonomicParallaxDesc.Text); break;
case (uint)AstroElement.CorrelationProperMotionDeclinationByRightAscensionDesc: CopyToClipboard(text: labelCorrelationProperMotionDeclinationByRightAscensionDesc.Text); break;
case (uint)AstroElement.CorrelationProperMotionDeclinationByDeclinationDesc: CopyToClipboard(text: labelCorrelationProperMotionDeclinationByDeclinationDesc.Text); break;
case (uint)AstroElement.CorrelationProperMotionDeclinationByTrigonomicParallaxDesc: CopyToClipboard(text: labelCorrelationProperMotionDeclinationByTrigonomicParallaxDesc.Text); break;
case (uint)AstroElement.CorrelationProperMotionDeclinationByProperMotionRightAscensionDesc: CopyToClipboard(text: labelCorrelationProperMotionDeclinationByProperMotionRightAscensionDesc.Text); break;
case (uint)AstroElement.NumberOfTransitsForAstrometryDesc: CopyToClipboard(text: labelNumberOfTransitsForAstrometryDesc.Text); break;
case (uint)AstroElement.GoodnessOfFitParameterDesc: CopyToClipboard(text: labelGoodnessOfFitParameterDesc.Text); break;
case (uint)AstroElement.HipparcosNumberDesc: CopyToClipboard(text: labelHipparcosNumberDesc.Text); break;
case (uint)AstroElement.MeanBtMagnitudeDesc: CopyToClipboard(text: labelMeanBtMagnitudeDesc.Text); break;
case (uint)AstroElement.StandardErrorMeanBtMagnitudeDesc: CopyToClipboard(text: labelStandardErrorMeanBtMagnitudeDesc.Text); break;
case (uint)AstroElement.MeanVtMagnitudeDesc: CopyToClipboard(text: labelMeanVtMagnitudeDesc.Text); break;
case (uint)AstroElement.StandardErrorMeanVtMagnitudeDesc: CopyToClipboard(text: labelStandardErrorMeanVtMagnitudeDesc.Text); break;
case (uint)AstroElement.SourceOfPhotometryDesc: CopyToClipboard(text: labelSourceOfPhotometryDesc.Text); break;
case (uint)AstroElement.JohnsonBvColorDesc: CopyToClipboard(text: labelJohnsonBvColorDesc.Text); break;
case (uint)AstroElement.StandardErrorJohnsonBvColorDesc: CopyToClipboard(text: labelStandardErrorJohnsonBvColorDesc.Text); break;
case (uint)AstroElement.AstrometricQualityFlagDesc: CopyToClipboard(text: labelAstrometricQualityFlagDesc.Text); break;
case (uint)AstroElement.SignalToNoiseRatioOfTheStarImageDesc: CopyToClipboard(text: labelSignalToNoiseRatioOfTheStarImageDesc.Text); break;
case (uint)AstroElement.SourceOfAstrometricDataDesc: CopyToClipboard(text: labelSourceOfAstrometricDataDesc.Text); break;
case (uint)AstroElement.NumberOfTransitsForPhotometryDesc: CopyToClipboard(text: labelNumberOfTransitsForPhotometryDesc.Text); break;
case (uint)AstroElement.EstimateOfVtmagScatterDesc: CopyToClipboard(text: labelEstimateOfVtmagScatterDesc.Text); break;
case (uint)AstroElement.VtmagAtMaximumDesc: CopyToClipboard(text: labelVtmagAtMaximumDesc.Text); break;
case (uint)AstroElement.VtmagAtMinimumDesc: CopyToClipboard(text: labelVtmagAtMinimumDesc.Text); break;
case (uint)AstroElement.KnownVariabilityFromGcvsNsvDesc: CopyToClipboard(text: labelKnownVariabilityFromGcvsNsvDesc.Text); break;
case (uint)AstroElement.VariabilityFromTychoDesc: CopyToClipboard(text: labelVariabilityFromTychoDesc.Text); break;
case (uint)AstroElement.DuplicityFromTychoDesc: CopyToClipboard(text: labelDuplicityFromTychoDesc.Text); break;
case (uint)AstroElement.EpochPhotometryInAnnexDesc: CopyToClipboard(text: labelEpochPhotometryInAnnexDesc.Text); break;
case (uint)AstroElement.CcdmComponentIdentifierDesc: CopyToClipboard(text: labelCcdmComponentIdentifierDesc.Text); break;
case (uint)AstroElement.PpmAndSupplementDesc: CopyToClipboard(text: labelPpmAndSupplementDesc.Text); break;
case (uint)AstroElement.HdNumberDesc: CopyToClipboard(text: labelHdNumberDesc.Text); break;
case (uint)AstroElement.BonnerDmDesc: CopyToClipboard(text: labelBonnerDmDesc.Text); break;
case (uint)AstroElement.CordobaDmDesc: CopyToClipboard(text: labelCordobaDmDesc.Text); break;
case (uint)AstroElement.CapePhotographicDmDesc: CopyToClipboard(text: labelCapePhotographicDmDesc.Text); break;
case (uint)AstroElement.NotesDesc: CopyToClipboard(text: labelNotesDesc.Text); break;
case (uint)AstroElement.CatalogData: CopyToClipboard(text: labelCatalogData.Text); break;
case (uint)AstroElement.IdentifierData: CopyToClipboard(text: labelIdentifierData.Text); break;
case (uint)AstroElement.ProximityFlagData: CopyToClipboard(text: labelProximityFlagData.Text); break;
case (uint)AstroElement.RightAscensionData: CopyToClipboard(text: labelRightAscensionData.Text); break;
case (uint)AstroElement.DeclinationData: CopyToClipboard(text: labelDeclinationData.Text); break;
case (uint)AstroElement.MagnitudeJohnsonData: CopyToClipboard(text: labelMagnitudeJohnsonData.Text); break;
case (uint)AstroElement.SourceOfMagnitudeData: CopyToClipboard(text: labelSourceOfMagnitudeData.Text); break;
case (uint)AstroElement.AlphaData: CopyToClipboard(text: labelAlphaData.Text); break;
case (uint)AstroElement.DeltaData: CopyToClipboard(text: labelDeltaData.Text); break;
case (uint)AstroElement.ReferenceFlagForAstrometryData: CopyToClipboard(text: labelReferenceFlagForAstrometryData.Text); break;
case (uint)AstroElement.TrigonomicParallaxData: CopyToClipboard(text: labelTrigonomicParallaxData.Text); break;
case (uint)AstroElement.ProperMotionAlphaData: CopyToClipboard(text: labelProperMotionAlphaData.Text); break;
case (uint)AstroElement.ProperMotionDeltaData: CopyToClipboard(text: labelProperMotionDeltaData.Text); break;
case (uint)AstroElement.StandardErrorRightAscensionData: CopyToClipboard(text: labelStandardErrorRightAscensionData.Text); break;
case (uint)AstroElement.StandardErrorDeclinationData: CopyToClipboard(text: labelStandardErrorDeclinationData.Text); break;
case (uint)AstroElement.StandardErrorTrigonomicParallaxData: CopyToClipboard(text: labelStandardErrorTrigonomicParallaxData.Text); break;
case (uint)AstroElement.StandardErrorProperMotionRightAscensionData: CopyToClipboard(text: labelStandardErrorProperMotionRightAscensionData.Text); break;
case (uint)AstroElement.StandardErrorProperMotionDeclinationData: CopyToClipboard(text: labelStandardErrorProperMotionDeclinationData.Text); break;
case (uint)AstroElement.CorrelationDeclinationByRightAscensionData: CopyToClipboard(text: labelCorrelationDeclinationByRightAscensionData.Text); break;
case (uint)AstroElement.CorrelationTrigonomicParallaxByRightAscensionData: CopyToClipboard(text: labelCorrelationTrigonomicParallaxByRightAscensionData.Text); break;
case (uint)AstroElement.CorrelationTrigonomicParallaxByDeclinationData: CopyToClipboard(text: labelCorrelationTrigonomicParallaxByDeclinationData.Text); break;
case (uint)AstroElement.CorrelationProperMotionRightAscensionByRightAscensionData: CopyToClipboard(text: labelCorrelationProperMotionRightAscensionByRightAscensionData.Text); break;
case (uint)AstroElement.CorrelationProperMotionRightAscensionByDeclinationData: CopyToClipboard(text: labelCorrelationProperMotionRightAscensionByDeclinationData.Text); break;
case (uint)AstroElement.CorrelationProperMotionRightAscensionByTrigonomicParallaxData: CopyToClipboard(text: labelCorrelationProperMotionRightAscensionByTrigonomicParallaxData.Text); break;
case (uint)AstroElement.CorrelationProperMotionDeclinationByRightAscensionData: CopyToClipboard(text: labelCorrelationProperMotionDeclinationByRightAscensionData.Text); break;
case (uint)AstroElement.CorrelationProperMotionDeclinationByDeclinationData: CopyToClipboard(text: labelCorrelationProperMotionDeclinationByTrigonomicParallaxData.Text); break;
case (uint)AstroElement.CorrelationProperMotionDeclinationByTrigonomicParallaxData: CopyToClipboard(text: labelCorrelationProperMotionDeclinationByDeclinationData.Text); break;
case (uint)AstroElement.CorrelationProperMotionDeclinationByProperMotionRightAscensionData: CopyToClipboard(text: labelCorrelationProperMotionDeclinationByProperMotionRightAscensionData.Text); break;
case (uint)AstroElement.NumberOfTransitsForAstrometryData: CopyToClipboard(text: labelNumberOfTransitsForAstrometryData.Text); break;
case (uint)AstroElement.GoodnessOfFitParameterData: CopyToClipboard(text: labelGoodnessOfFitParameterData.Text); break;
case (uint)AstroElement.HipparcosNumberData: CopyToClipboard(text: labelHipparcosNumberData.Text); break;
case (uint)AstroElement.MeanBtMagnitudeData: CopyToClipboard(text: labelMeanBtMagnitudeData.Text); break;
case (uint)AstroElement.StandardErrorMeanBtMagnitudeData: CopyToClipboard(text: labelStandardErrorMeanBtMagnitudeData.Text); break;
case (uint)AstroElement.MeanVtMagnitudeData: CopyToClipboard(text: labelMeanVtMagnitudeData.Text); break;
case (uint)AstroElement.StandardErrorMeanVtMagnitudeData: CopyToClipboard(text: labelStandardErrorMeanVtMagnitudeData.Text); break;
case (uint)AstroElement.SourceOfPhotometryData: CopyToClipboard(text: labelSourceOfPhotometryData.Text); break;
case (uint)AstroElement.JohnsonBvColorData: CopyToClipboard(text: labelJohnsonBvColorData.Text); break;
case (uint)AstroElement.StandardErrorJohnsonBvColorData: CopyToClipboard(text: labelStandardErrorJohnsonBvColorData.Text); break;
case (uint)AstroElement.AstrometricQualityFlagData: CopyToClipboard(text: labelAstrometricQualityFlagData.Text); break;
case (uint)AstroElement.SignalToNoiseRatioOfTheStarImageData: CopyToClipboard(text: labelSignalToNoiseRatioOfTheStarImageData.Text); break;
case (uint)AstroElement.SourceOfAstrometricDataData: CopyToClipboard(text: labelSourceOfAstrometricDataData.Text); break;
case (uint)AstroElement.NumberOfTransitsForPhotometryData: CopyToClipboard(text: labelNumberOfTransitsForPhotometryData.Text); break;
case (uint)AstroElement.EstimateOfVtmagScatterData: CopyToClipboard(text: labelEstimateOfVtmagScatterData.Text); break;
case (uint)AstroElement.VtmagAtMaximumData: CopyToClipboard(text: labelVtmagAtMaximumData.Text); break;
case (uint)AstroElement.VtmagAtMinimumData: CopyToClipboard(text: labelVtmagAtMinimumData.Text); break;
case (uint)AstroElement.KnownVariabilityFromGcvsNsvData: CopyToClipboard(text: labelKnownVariabilityFromGcvsNsvData.Text); break;
case (uint)AstroElement.VariabilityFromTychoData: CopyToClipboard(text: labelVariabilityFromTychoData.Text); break;
case (uint)AstroElement.DuplicityFromTychoData: CopyToClipboard(text: labelDuplicityFromTychoData.Text); break;
case (uint)AstroElement.EpochPhotometryInAnnexData: CopyToClipboard(text: labelEpochPhotometryInAnnexData.Text); break;
case (uint)AstroElement.CcdmComponentIdentifierData: CopyToClipboard(text: labelCcdmComponentIdentifierData.Text); break;
case (uint)AstroElement.PpmAndSupplementData: CopyToClipboard(text: labelPpmAndSupplementData.Text); break;
case (uint)AstroElement.HdNumberData: CopyToClipboard(text: labelHdNumberData.Text); break;
case (uint)AstroElement.BonnerDmData: CopyToClipboard(text: labelBonnerDmData.Text); break;
case (uint)AstroElement.CordobaDmData: CopyToClipboard(text: labelCordobaDmData.Text); break;
case (uint)AstroElement.CapePhotographicDmData: CopyToClipboard(text: labelCapePhotographicDmData.Text); break;
case (uint)AstroElement.NotesData: CopyToClipboard(text: labelNotesData.Text); break;
default: break;
}
}
private void ToolStripButtonChangeDataTableStyle_Click(object sender, EventArgs e)
{
if (tableLayoutPanel.CellBorderStyle == TableLayoutPanelCellBorderStyle.InsetDouble)
{
tableLayoutPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.OutsetDouble;
settings.UserDataTableStyle = 0;
}
else if (tableLayoutPanel.CellBorderStyle == TableLayoutPanelCellBorderStyle.OutsetDouble)
{
tableLayoutPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.InsetDouble;
settings.UserDataTableStyle = 1;
}
}
private void ToolStripButtonChangeHoverEffect_Click(object sender, EventArgs e)
{
toolStripButtonChangeHoverEffect.Checked = !toolStripButtonChangeHoverEffect.Checked;
settings.UserEnableHoverEffect = !settings.UserEnableHoverEffect;
if (toolStripButtonChangeHoverEffect.Checked)
{
toolStripButtonChangeHoverEffect.Image = Resources.fugue_table_select_row_16px_shadowless;
}
else if (!toolStripButtonChangeHoverEffect.Checked)
{
toolStripButtonChangeHoverEffect.Image = Resources.fugue_table_16px_shadowless;
}
}
private void ProgressBar_Click(object sender, EventArgs e)
{
MessageBox.Show(
owner: this,
text: Resources.jokeLoadingText,
caption: Resources.jokeLoadingTitle,
buttons: MessageBoxButtons.OK,
icon: MessageBoxIcon.Exclamation,
defaultButton: MessageBoxDefaultButton.Button1,
options: MessageBoxOptions.DefaultDesktopOnly);
}
#endregion
#region DoubleClick event handlers
private void CopyToClipboard_DoubleClick(object sender, EventArgs e)
{
if (settings.UserEnableCopyMethod)
{
CopyToClipboard(sender: sender, e: e);
}
}
#endregion
#region Enter event handlers
private void LabelCatalogDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.CatalogDesc, labelSelf: ref labelCatalogDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelCatalogData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.CatalogData, labelSelf: ref labelCatalogData, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelIdentifierDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.IdentifierDesc, labelSelf: ref labelIdentifierDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelIdentifierData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.IdentifierData, labelSelf: ref labelIdentifierData, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelProximityFlagDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.ProximityFlagDesc, labelSelf: ref labelProximityFlagDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelProximityFlagData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.ProximityFlagData, labelSelf: ref labelProximityFlagData, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelRightAscensionDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.RightAscensionDesc, labelSelf: ref labelRightAscensionDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelRightAscensionData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.RightAscensionData, labelSelf: ref labelRightAscensionData, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelDeclinationDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.DeclinationDesc, labelSelf: ref labelDeclinationDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelDeclinationData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.DeclinationData, labelSelf: ref labelDeclinationData, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelMagnitudeJohnsonDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.MagnitudeJohnsonDesc, labelSelf: ref labelMagnitudeJohnsonDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelMagnitudeJohnsonData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.MagnitudeJohnsonData, labelSelf: ref labelMagnitudeJohnsonData, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelSourceOfMagnitudeDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.SourceOfMagnitudeDesc, labelSelf: ref labelSourceOfMagnitudeDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelSourceOfMagnitudeData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.SourceOfMagnitudeData, labelSelf: ref labelSourceOfMagnitudeData, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelAlphaDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.AlphaDesc, labelSelf: ref labelAlphaDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelAlphaData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.AlphaData, labelSelf: ref labelAlphaData, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelDeltaDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.DeltaDesc, labelSelf: ref labelDeltaDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelDeltaData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.DeltaData, labelSelf: ref labelDeltaData, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelReferenceFlagForAstrometryDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.ReferenceFlagForAstrometryDesc, labelSelf: ref labelReferenceFlagForAstrometryDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelReferenceFlagForAstrometryData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.ReferenceFlagForAstrometryData, labelSelf: ref labelReferenceFlagForAstrometryData, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelTrigonomicParallaxDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.TrigonomicParallaxDesc, labelSelf: ref labelTrigonomicParallaxDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelTrigonomicParallaxData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.TrigonomicParallaxData, labelSelf: ref labelTrigonomicParallaxData, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelProperMotionAlphaDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.ProperMotionAlphaDesc, labelSelf: ref labelProperMotionAlphaDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelProperMotionAlphaData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.ProperMotionAlphaData, labelSelf: ref labelProperMotionAlphaData, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelProperMotionDeltaDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.ProperMotionDeltaDesc, labelSelf: ref labelProperMotionDeltaDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelProperMotionDeltaData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.ProperMotionDeltaData, labelSelf: ref labelProperMotionDeltaData, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelStandardErrorRightAscensionDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.StandardErrorRightAscensionDesc, labelSelf: ref labelStandardErrorRightAscensionDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelStandardErrorRightAscensionData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.StandardErrorRightAscensionData, labelSelf: ref labelStandardErrorRightAscensionData, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelStandardErrorDeclinationDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.StandardErrorDeclinationDesc, labelSelf: ref labelStandardErrorDeclinationDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelStandardErrorDeclinationData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.StandardErrorDeclinationData, labelSelf: ref labelStandardErrorDeclinationData, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelStandardErrorTrigonomicParallaxDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.StandardErrorTrigonomicParallaxDesc, labelSelf: ref labelStandardErrorTrigonomicParallaxDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelStandardErrorTrigonomicParallaxData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.StandardErrorTrigonomicParallaxData, labelSelf: ref labelStandardErrorTrigonomicParallaxData, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelStandardErrorProperMotionRightAscensionDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.StandardErrorProperMotionRightAscensionDesc, labelSelf: ref labelStandardErrorProperMotionRightAscensionDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelStandardErrorProperMotionRightAscensionData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.StandardErrorProperMotionRightAscensionData, labelSelf: ref labelStandardErrorProperMotionRightAscensionData, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelStandardErrorProperMotionDeclinationDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.StandardErrorProperMotionDeclinationDesc, labelSelf: ref labelStandardErrorProperMotionDeclinationDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelStandardErrorProperMotionDeclinationData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.StandardErrorProperMotionDeclinationData, labelSelf: ref labelStandardErrorProperMotionDeclinationData, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelCorrelationDeclinationByRightAscensionDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.CorrelationDeclinationByRightAscensionDesc, labelSelf: ref labelCorrelationDeclinationByRightAscensionDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelCorrelationDeclinationByRightAscensionData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.CorrelationDeclinationByRightAscensionData, labelSelf: ref labelCorrelationDeclinationByRightAscensionData, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelCorrelationTrigonomicParallaxByRightAscensionDesc_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.CorrelationTrigonomicParallaxByRightAscensionDesc, labelSelf: ref labelCorrelationTrigonomicParallaxByRightAscensionDesc, color: SystemColors.ControlLightLight, sender: sender, e: e);
private void LabelCorrelationTrigonomicParallaxByRightAscensionData_Enter(object sender, EventArgs e) => SetColorSelfAndSetStatusbar(astroElemId: (uint)AstroElement.CorrelationTrigonomicParallaxByRightAscensionData, labelSelf: ref labelCorrelationTrigonomicParallaxByRightAscensionData, color: SystemColors.ControlLightLight, sender: sender, e: e);