-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.cs
1764 lines (1531 loc) · 68.2 KB
/
Form1.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.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
// This initalises all of the required modules for the program to run.
namespace EU_Voting_Calculator
{
public partial class Form1 : Form // This partial class for this 'Form' is used to store data into multiple files, but when compiling, brings them all back together as one.
{
static Country austria = new Country("Austria", 1.98f);
static Country belgium = new Country("Belgium", 2.56f);
static Country bulgaria = new Country("Bulgaria", 1.56f);
static Country croatia = new Country("Croatia", 0.91f);
static Country cyprus = new Country("Cyprus", 0.2f);
static Country czechia = new Country("Czech Republic", 2.35f);
static Country denmark = new Country("Denmark", 1.3f);
static Country estonia = new Country("Estonia", 0.3f);
static Country finland = new Country("Finland", 1.23f);
static Country france = new Country("France", 14.98f);
static Country germany = new Country("Germany", 18.54f);
static Country greece = new Country("Greece", 2.4f);
static Country hungary = new Country("Hungary", 2.18f);
static Country ireland = new Country("Ireland", 1.1f);
static Country italy = new Country("Italy", 13.65f);
static Country latvia = new Country("Latvia", 0.43f);
static Country lithuania = new Country("Lithuania", 0.62f);
static Country luxembourg = new Country("Luxembourg", 0.14f);
static Country malta = new Country("Malta", 0.11f);
static Country netherlands = new Country("Netherlands", 3.89f);
static Country poland = new Country("Poland", 8.49f);
static Country portugal = new Country("Portugal", 2.3f);
static Country romania = new Country("Romania", 4.34f);
static Country slovakia = new Country("Slovakia", 1.22f);
static Country slovenia = new Country("Slovenia", 0.47f);
static Country spain = new Country("Spain", 10.49f);
static Country sweden = new Country("Sweden", 2.29f);
// The above chunk of code defines the static objects of each country; the name of the country, and population percentage.
static List<Country> allCountriesparticipating = new List<Country> { austria, belgium, bulgaria, croatia, cyprus,
czechia,denmark, estonia, finland, france, germany, greece, hungary, ireland, italy, latvia, lithuania,
luxembourg, malta, netherlands, poland, portugal, romania, slovakia, slovenia, spain,sweden};
// The above code creates a list of all of the countries that participate in the voting.
// Like before, this is static so it does not change throughout the running of the program.
// The static objects from before are used in this list.
VotingRule qualifiedMajority = new VotingRule(15, 65, true);
VotingRule reinforcedQualifiedmajority = new VotingRule(20, 65, true);
VotingRule simpleMajority = new VotingRule(14, 0, false);
VotingRule unanimity = new VotingRule(27, 0, false);
// This code defines each of the types of voting that are available to choose from by the user,
//as objects using the VotingRule class. Each voting type has different requirements for an "approved" status to be reached.
// The first parameter in 'VotingRule' is the number of member states required to state "YES" for the vote to pass.
// The second parameter is the population percentage required.
// The third parameter determines if a blocking minority is available for that particular voting system or not.
public VotingRule currentRule;
// This stores the voting system that the user selects as public object variable that uses the VotingRule class
public Form1()
{
InitializeComponent();
}
public class Country
{
string name; // Each country is given a name as a string
float populationPercentage; // Each country is given a population percentage field as a floating point number
string vote;
// The vote that the country chooses is stored as a string value
//(this can be one of three values: "YES", "NO" or "ABSTAIN").
public string voteProperty
{
get { return vote; }
set { vote = value; }
}
// A property for the vote field. This is used to get and set the vote field outside of the class,
//as all attributes are kept private.
public float populationProperty
{
get { return populationPercentage; }
set { populationPercentage = value; }
}
// A property for the populationPercentage field. Used to get and set the populationPercentage outside of the class,
//as all attributes are kept private.
public Country(string givenName, float givenPercentage)
{
name = givenName;
populationPercentage = givenPercentage;
vote = "YES";
}
// Each country is defined by a name and a population value. This is the constructor for the Country class
// When the voting form initalises and first loads for the user, all country votes are automatically set to "YES".
}
// The class above is the 'Country' class.
public class VotingRule
{
int membersRequired;
int populationRequired;
// The above attributes are used to compare population values that are collected with each vote change
//against these fixed values. These determine what requirements need to be met in order for votes to be approved.
int amountYes;
int amountNo;
int amountAbstain;
// These integer fields are used to count the votes of each option ("YES", "NO" and "ABSTAIN").
float populationYes;
float populationNo;
float populationAbstain;
// These float values are used to count each country's population values in order to calculate
//if population values are met in order to pass votes.
bool blockingMinority;
// This is the boolean attribute for if the voting rule involves a blocking minority.
public VotingRule(int givenStates, int givenpopulation, bool givenBool)
{
membersRequired = givenStates;
populationRequired = givenpopulation;
blockingMinority = givenBool;
}
// Constructor for the VotingRule class. The three attributes are given values by the object declarartions.
public void GetResult(TextBox text)
{
amountYes = 0;
amountNo = 0;
amountAbstain = 0;
populationYes = 0.0f;
populationNo = 0.0f;
populationAbstain = 0.0f;
// All of the above values are currently set to '0', as they will be counted when votes are selected
//or changed by the user.
// This includes counting when the program starts, as all votes by default are set to "YES".
for(int i = 0; i < allCountriesparticipating.Count; i++)
{
if(allCountriesparticipating[i].voteProperty == "YES")
{
amountYes += 1;
populationYes += allCountriesparticipating[i].populationProperty;
}
if(allCountriesparticipating[i].voteProperty == "NO")
{
amountNo += 1;
populationNo += allCountriesparticipating[i].populationProperty;
}
if(allCountriesparticipating[i].voteProperty == "ABSTAIN")
{
amountAbstain += 1;
populationAbstain += allCountriesparticipating[i].populationProperty;
}
}
// For each country, the votes for each option of "YES", "NO" and "ABSTAIN" are counted,
//as well as the population of those countries.
if(blockingMinority == true)
{
BlockingMinority(text);
}
// If the selected voting system has the option of a blocking minority, the BlockingMinority method is called.
else if(membersRequired == 14)
{
SimpleMajority(text);
}
// If the selected voting system requires 14 member states to say "YES",
//the 'Simple Majority' method is called, as this can only occur if the rule is set to Simple Majority.
else if((populationYes >= populationRequired) && (amountYes >= (membersRequired - amountAbstain)))
{
text.Text = $"Result: Approved Member States: Yes: {amountYes} No: {amountNo} " +
$"Abstain: {amountAbstain} Population: Yes: {Math.Round(populationYes)}% No: {Math.Round(populationNo)}%" +
$" Abstain: {Math.Round(populationAbstain)}%";
}
// If the minimum population required value is met and the amount of member states required to say "YES" is met,
//the vote is approved.
else if((populationYes < populationRequired) && (amountYes < (membersRequired - amountAbstain)))
{
text.Text = $"Result: Rejected Member States: Yes: {amountYes} No: {amountNo} " +
$"Abstain: {amountAbstain} Population: Yes: {Math.Round(populationYes)}% No: {Math.Round(populationNo)}%" +
$" Abstain: {Math.Round(populationAbstain)}% ";
}
// If the population required isn't met and neither is the number of member states, the vote is rejected.
else
{
text.Text = $"Result: Rejected Member States: Yes: {amountYes} No: {amountNo} " +
$"Abstain: {amountAbstain} Population: Yes: {Math.Round(populationYes)}% No: {Math.Round(populationNo)}%" +
$" Abstain: {Math.Round(populationAbstain)}% ";
}
// If none of the above two conditions are met, the vote is automatically rejected.
}
private void BlockingMinority(TextBox text)
{
int noAndabstain = amountNo + amountAbstain;
// The member states that voted "NO" and "ABSTAIN" were counted previously, and are now combined.
if ((populationYes >= populationRequired) && (amountYes >= membersRequired))
{
text.Text = $"Result: Approved Member States: Yes: {amountYes} No: {amountNo} " +
$"Abstain: {amountAbstain} Population: Yes: {Math.Round(populationYes)}% No: {Math.Round(populationNo)}%" +
$" Abstain: {Math.Round(populationAbstain)}%";
}
else if ((populationYes < populationRequired) && (noAndabstain < 4))
{
text.Text = $"Result: Approved - Blocking Minority Member States: Yes: {amountYes} No: {amountNo} " +
$"Abstain: {amountAbstain} Population: Yes: {Math.Round(populationYes)}% No: {Math.Round(populationNo)}%" +
$" Abstain: {Math.Round(populationAbstain)}% ";
}
// If the number of member states that vote "NO" or "ABSTAIN" is less than 4, the vote is approved.
// This is because the minimum number of states required to reject a vote is 4.
else if ((populationNo > populationRequired) && (noAndabstain >= 4))
{
text.Text = $"Result: Rejected Member States: Yes: {amountYes} No: {amountNo} " +
$"Abstain: {amountAbstain} Population: Yes: {Math.Round(populationYes)}% No: {Math.Round(populationNo)}%" +
$" Abstain: {Math.Round(populationAbstain)}% ";
}
// If the population required of member states voting "NO" or "ABSTAIN" is greater than the minimum required
//for a blocking minority (above 35%), and if the number of states that vote for these options is greater than
//or equal to 4, the vote is rejected.
else
{
text.Text = $"Result: Rejected Member States: Yes: {amountYes} No: {amountNo} " +
$"Abstain: {amountAbstain} Population: Yes: {Math.Round(populationYes)}% No: {Math.Round(populationNo)}%" +
$" Abstain: {Math.Round(populationAbstain)}% ";
}
}
private void SimpleMajority(TextBox text)
{
if ((populationYes >= populationRequired) && (amountYes >= membersRequired))
{
text.Text = $"Result: Approved Member States: Yes: {amountYes} No: {amountNo} " +
$"Abstain: {amountAbstain} Population: Yes: {Math.Round(populationYes)}% No: {Math.Round(populationNo)}%" +
$" Abstain: {Math.Round(populationAbstain)}%";
}
else if ((populationYes < populationRequired) && (amountYes < membersRequired))
{
text.Text = $"Result: Rejected Member States: Yes: {amountYes} No: {amountNo} " +
$"Abstain: {amountAbstain} Population: Yes: {Math.Round(populationYes)}% No: {Math.Round(populationNo)}%" +
$" Abstain: {Math.Round(populationAbstain)}% ";
}
else
{
text.Text = $"Result: Rejected Member States: Yes: {amountYes} No: {amountNo} " +
$"Abstain: {amountAbstain} Population: Yes: {Math.Round(populationYes)}% No: {Math.Round(populationNo)}%" +
$" Abstain: {Math.Round(populationAbstain)}% ";
}
}
public void GetRequired(TextBox text)
{
if((blockingMinority == false) && (membersRequired != 14))
{
text.Text = $"Required For Adoption: Member States: {membersRequired - amountAbstain} Population: {populationRequired}%";
}
else
{
text.Text = $"Required For Adoption: Member States: {membersRequired} Population: {populationRequired}%";
}
}
// The above code displays the requirements for each voting system to the user.
// This states the number of member states and the population percentage required.
}
// The class above is the 'VotingRule' class.
private void Form1_Load(object sender, EventArgs e)
{
ruleBox.Items.Add("Qualified Majority");
ruleBox.Items.Add("Reinforced Qualified Majority");
ruleBox.Items.Add("Simple Majority");
ruleBox.Items.Add("Unanimity");
ruleBox.SelectedItem = "Qualified Majority";
currentRule = qualifiedMajority;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
List<CheckBox> yesCheckboxes = new List<CheckBox> { austriaYes, belgiumYes, bulgariaYes,
croatiaYes, cyprusYes, czechiaYes, denmarkYes, estoniaYes, finlandYes, franceYes, germanyYes, greeceYes,
hungaryYes, irelandYes, italyYes, latviaYes, lithuaniaYes, luxembourgYes, maltaYes, netherlandsYes,
polandYes, portugalYes, romaniaYes, slovakiaYes, sloveniaYes, spainYes, swedenYes};
}
// The above code runs when the form laods.
private void ruleBox_SelectedIndexChanged(object sender, EventArgs e)
{
if (ruleBox.SelectedItem == "Qualified Majority")
{
currentRule = qualifiedMajority;
}
else if(ruleBox.SelectedItem == "Reinforced Qualified Majority")
{
currentRule = reinforcedQualifiedmajority;
}
else if(ruleBox.SelectedItem =="Simple Majority")
{
currentRule = simpleMajority;
}
else if(ruleBox.SelectedItem == "Unanimity")
{
currentRule = unanimity;
}
else
{
currentRule = qualifiedMajority;
}
// The default option when the form loads is this 'Qualified Majority' voting system.
// The voting system can then be changed by the drop-down selection.
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
// The above code sets which voting system is the current voting system, as dictated by the user.
// The drop-down menu is available for the user to choose between the different voting systems.
private void austriaNo_CheckedChanged(object sender, EventArgs e)
{
if(austriaNo.Checked == true)
{
austria.voteProperty = "NO";
austriaAbstain.Checked = false;
austriaYes.Checked = false;
currentRule.GetResult(resultText);
// This calculates the result of the vote by calling a method.
currentRule.GetRequired(requiredText);
// This displays the requirements that need to be met in order for the vote to pass, by calling a method.
}
// If this is changed, the result of the vote is recalculated and displayed to the user.
else if (austriaYes.Checked == false && austriaNo.Checked == false && austriaAbstain.Checked == false){
austriaNo.Checked = true;
}
// If the user tries to deselect all of the checkbox options for the country, the checkbox is automatically selected.
}
// This runs when the state of the checkbox for Austria voting no changes.
private void austriaYes_CheckedChanged(object sender, EventArgs e)
{
if (austriaYes.Checked == true)
{
austria.voteProperty = "YES";
austriaAbstain.Checked = false;
austriaNo.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if(austriaYes.Checked == false && austriaNo.Checked == false && austriaAbstain.Checked == false){
austriaYes.Checked = true;
}
}
private void austriaAbstain_CheckedChanged(object sender, EventArgs e)
{
if (austriaAbstain.Checked == true)
{
austria.voteProperty = "ABSTAIN";
austriaNo.Checked = false;
austriaYes.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (austriaYes.Checked == false && austriaNo.Checked == false && austriaAbstain.Checked == false){
austriaAbstain.Checked = true;
}
}
private void belgiumYes_CheckedChanged(object sender, EventArgs e)
{
if (belgiumYes.Checked == true)
{
belgium.voteProperty = "YES";
belgiumAbstain.Checked = false;
belgiumNo.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (belgiumYes.Checked == false && belgiumNo.Checked == false && belgiumAbstain.Checked == false)
{
belgiumYes.Checked = true;
}
}
private void belgiumNo_CheckedChanged(object sender, EventArgs e)
{
if (belgiumNo.Checked == true)
{
belgium.voteProperty = "NO";
belgiumAbstain.Checked = false;
belgiumYes.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (belgiumYes.Checked == false && belgiumNo.Checked == false && belgiumAbstain.Checked == false)
{
belgiumNo.Checked = true;
}
}
private void belgiumAbstain_CheckedChanged(object sender, EventArgs e)
{
if (belgiumAbstain.Checked == true)
{
belgium.voteProperty = "ABSTAIN";
belgiumNo.Checked = false;
belgiumYes.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (belgiumYes.Checked == false && belgiumNo.Checked == false && belgiumAbstain.Checked == false)
{
belgiumAbstain.Checked = true;
}
}
private void bulgariaYes_CheckedChanged(object sender, EventArgs e)
{
if (bulgariaYes.Checked == true)
{
bulgaria.voteProperty = "YES";
bulgariaNo.Checked = false;
bulgariaAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (bulgariaYes.Checked == false && bulgariaNo.Checked == false && bulgariaAbstain.Checked == false)
{
bulgariaYes.Checked = true;
}
}
private void bulgariaNo_CheckedChanged(object sender, EventArgs e)
{
if (bulgariaNo.Checked == true)
{
bulgaria.voteProperty = "NO";
bulgariaYes.Checked = false;
bulgariaAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (bulgariaYes.Checked == false && bulgariaNo.Checked == false && bulgariaAbstain.Checked == false)
{
bulgariaNo.Checked = true;
}
}
private void bulgariaAbstain_CheckedChanged(object sender, EventArgs e)
{
if (bulgariaAbstain.Checked == true)
{
bulgaria.voteProperty = "ABSTAIN";
bulgariaNo.Checked = false;
bulgariaYes.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (bulgariaYes.Checked == false && bulgariaNo.Checked == false && bulgariaAbstain.Checked == false)
{
bulgariaAbstain.Checked = true;
}
}
private void croatiaYes_CheckedChanged(object sender, EventArgs e)
{
if (croatiaYes.Checked == true)
{
croatia.voteProperty = "YES";
croatiaNo.Checked = false;
croatiaAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (croatiaYes.Checked == false && croatiaNo.Checked == false && croatiaAbstain.Checked == false)
{
croatiaYes.Checked = true;
}
}
private void croatiaNo_CheckedChanged(object sender, EventArgs e)
{
if (croatiaNo.Checked == true)
{
croatia.voteProperty = "NO";
croatiaYes.Checked = false;
croatiaAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (croatiaYes.Checked == false && croatiaNo.Checked == false && croatiaAbstain.Checked == false)
{
croatiaNo.Checked = true;
}
}
private void croatiaAbstain_CheckedChanged(object sender, EventArgs e)
{
if (croatiaAbstain.Checked == true)
{
croatia.voteProperty = "ABSTAIN";
croatiaNo.Checked = false;
croatiaYes.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (croatiaYes.Checked == false && croatiaNo.Checked == false && croatiaAbstain.Checked == false)
{
croatiaAbstain.Checked = true;
}
}
private void cyprusYes_CheckedChanged(object sender, EventArgs e)
{
if (cyprusYes.Checked == true)
{
cyprus.voteProperty = "YES";
cyprusNo.Checked = false;
cyprusAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (cyprusYes.Checked == false && cyprusNo.Checked == false && cyprusAbstain.Checked == false)
{
cyprusYes.Checked = true;
}
}
private void cyprusNo_CheckedChanged(object sender, EventArgs e)
{
if (cyprusNo.Checked == true)
{
cyprus.voteProperty = "NO";
cyprusYes.Checked = false;
cyprusAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (cyprusYes.Checked == false && cyprusNo.Checked == false && cyprusAbstain.Checked == false)
{
cyprusNo.Checked = true;
}
}
private void cyprusAbstain_CheckedChanged(object sender, EventArgs e)
{
if (cyprusAbstain.Checked == true)
{
cyprus.voteProperty = "ABSTAIN";
cyprusNo.Checked = false;
cyprusYes.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (cyprusYes.Checked == false && cyprusNo.Checked == false && cyprusAbstain.Checked == false)
{
cyprusAbstain.Checked = true;
}
}
private void czechiaYes_CheckedChanged(object sender, EventArgs e)
{
if (czechiaYes.Checked == true)
{
czechia.voteProperty = "YES";
czechiaNo.Checked = false;
czechiaAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (czechiaYes.Checked == false && czechiaNo.Checked == false && czechiaAbstain.Checked == false)
{
czechiaYes.Checked = true;
}
}
private void czechiaNo_CheckedChanged(object sender, EventArgs e)
{
if (czechiaNo.Checked == true)
{
czechia.voteProperty = "NO";
czechiaYes.Checked = false;
czechiaAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (czechiaYes.Checked == false && czechiaNo.Checked == false && czechiaAbstain.Checked == false)
{
czechiaNo.Checked = true;
}
}
private void czechiaAbstain_CheckedChanged(object sender, EventArgs e)
{
if (czechiaAbstain.Checked == true)
{
czechia.voteProperty = "ABSTAIN";
czechiaNo.Checked = false;
czechiaYes.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (czechiaYes.Checked == false && czechiaNo.Checked == false && czechiaAbstain.Checked == false)
{
czechiaAbstain.Checked = true;
}
}
private void denmarkYes_CheckedChanged(object sender, EventArgs e)
{
if (denmarkYes.Checked == true)
{
denmark.voteProperty = "YES";
denmarkNo.Checked = false;
denmarkAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (denmarkYes.Checked == false && denmarkNo.Checked == false && denmarkAbstain.Checked == false)
{
denmarkYes.Checked = true;
}
}
private void denmarkNo_CheckedChanged(object sender, EventArgs e)
{
if (denmarkNo.Checked == true)
{
denmark.voteProperty = "NO";
denmarkYes.Checked = false;
denmarkAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (denmarkYes.Checked == false && denmarkNo.Checked == false && denmarkAbstain.Checked == false)
{
denmarkNo.Checked = true;
}
}
private void denmarkAbstain_CheckedChanged(object sender, EventArgs e)
{
if (denmarkAbstain.Checked == true)
{
denmark.voteProperty = "ABSTAIN";
denmarkNo.Checked = false;
denmarkYes.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (denmarkYes.Checked == false && denmarkNo.Checked == false && denmarkAbstain.Checked == false)
{
denmarkAbstain.Checked = true;
}
}
private void estoniaYes_CheckedChanged(object sender, EventArgs e)
{
if (estoniaYes.Checked == true)
{
estonia.voteProperty = "YES";
estoniaNo.Checked = false;
estoniaAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (estoniaYes.Checked == false && estoniaNo.Checked == false && estoniaAbstain.Checked == false)
{
estoniaYes.Checked = true;
}
}
private void estoniaNo_CheckedChanged(object sender, EventArgs e)
{
if (estoniaNo.Checked == true)
{
estonia.voteProperty = "NO";
estoniaYes.Checked = false;
estoniaAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (estoniaYes.Checked == false && estoniaNo.Checked == false && estoniaAbstain.Checked == false)
{
estoniaNo.Checked = true;
}
}
private void estoniaAbstain_CheckedChanged(object sender, EventArgs e)
{
if (estoniaAbstain.Checked == true)
{
estonia.voteProperty = "ABSTAIN";
estoniaNo.Checked = false;
estoniaYes.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (estoniaYes.Checked == false && estoniaNo.Checked == false && estoniaAbstain.Checked == false)
{
estoniaAbstain.Checked = true;
}
}
private void finlandYes_CheckedChanged(object sender, EventArgs e)
{
if (finlandYes.Checked == true)
{
finland.voteProperty = "YES";
finlandNo.Checked = false;
finlandAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (finlandYes.Checked == false && finlandNo.Checked == false && finlandAbstain.Checked == false)
{
finlandYes.Checked = true;
}
}
private void finlandNo_CheckedChanged(object sender, EventArgs e)
{
if (finlandNo.Checked == true)
{
finland.voteProperty = "NO";
finlandYes.Checked = false;
finlandAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (finlandYes.Checked == false && finlandNo.Checked == false && finlandAbstain.Checked == false)
{
finlandNo.Checked = true;
}
}
private void finlandAbstain_CheckedChanged(object sender, EventArgs e)
{
if (finlandAbstain.Checked == true)
{
finland.voteProperty = "ABSTAIN";
finlandNo.Checked = false;
finlandYes.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (finlandYes.Checked == false && finlandNo.Checked == false && finlandAbstain.Checked == false)
{
finlandAbstain.Checked = true;
}
}
private void franceYes_CheckedChanged(object sender, EventArgs e)
{
if (franceYes.Checked == true)
{
france.voteProperty = "YES";
franceNo.Checked = false;
franceAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (franceYes.Checked == false && franceNo.Checked == false && franceAbstain.Checked == false)
{
franceYes.Checked = true;
}
}
private void franceNo_CheckedChanged(object sender, EventArgs e)
{
if (franceNo.Checked == true)
{
france.voteProperty = "NO";
franceYes.Checked = false;
franceAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (franceYes.Checked == false && franceNo.Checked == false && franceAbstain.Checked == false)
{
franceNo.Checked = true;
}
}
private void franceAbstain_CheckedChanged(object sender, EventArgs e)
{
if (franceAbstain.Checked == true)
{
france.voteProperty = "ABSTAIN";
franceNo.Checked = false;
franceYes.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (franceYes.Checked == false && franceNo.Checked == false && franceAbstain.Checked == false)
{
franceAbstain.Checked = true;
}
}
private void germanyYes_CheckedChanged(object sender, EventArgs e)
{
if (germanyYes.Checked == true)
{
germany.voteProperty = "YES";
germanyNo.Checked = false;
germanyAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (germanyYes.Checked == false && germanyNo.Checked == false && germanyAbstain.Checked == false)
{
germanyYes.Checked = true;
}
}
private void germanyNo_CheckedChanged(object sender, EventArgs e)
{
if (germanyNo.Checked == true)
{
germany.voteProperty = "NO";
germanyYes.Checked = false;
germanyAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (germanyYes.Checked == false && germanyNo.Checked == false && germanyAbstain.Checked == false)
{
germanyNo.Checked = true;
}
}
private void germanyAbstain_CheckedChanged(object sender, EventArgs e)
{
if (germanyAbstain.Checked == true)
{
germany.voteProperty = "ABSTAIN";
germanyNo.Checked = false;
germanyYes.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (germanyYes.Checked == false && germanyNo.Checked == false && germanyAbstain.Checked == false)
{
germanyAbstain.Checked = true;
}
}
private void greeceYes_CheckedChanged(object sender, EventArgs e)
{
if (greeceYes.Checked == true)
{
greece.voteProperty = "YES";
greeceNo.Checked = false;
greeceAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (greeceYes.Checked == false && greeceNo.Checked == false && greeceAbstain.Checked == false)
{
greeceYes.Checked = true;
}
}
private void greeceNo_CheckedChanged(object sender, EventArgs e)
{
if (greeceNo.Checked == true)
{
greece.voteProperty = "NO";
greeceYes.Checked = false;
greeceAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (greeceYes.Checked == false && greeceNo.Checked == false && greeceAbstain.Checked == false)
{
greeceNo.Checked = true;
}
}
private void greeceAbstain_CheckedChanged(object sender, EventArgs e)
{
if (greeceAbstain.Checked == true)
{
greece.voteProperty = "ABSTAIN";
greeceNo.Checked = false;
greeceYes.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (greeceYes.Checked == false && greeceNo.Checked == false && greeceAbstain.Checked == false)
{
greeceAbstain.Checked = true;
}
}
private void hungaryYes_CheckedChanged(object sender, EventArgs e)
{
if (hungaryYes.Checked == true)
{
hungary.voteProperty = "YES";
hungaryNo.Checked = false;
hungaryAbstain.Checked = false;
currentRule.GetResult(resultText);
currentRule.GetRequired(requiredText);
}
else if (hungaryYes.Checked == false && hungaryNo.Checked == false && hungaryAbstain.Checked == false)
{
hungaryYes.Checked = true;
}
}
private void hungaryNo_CheckedChanged(object sender, EventArgs e)
{
if (hungaryNo.Checked == true)