rbSunVoteARS.cs
153 KB
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
/*-------------------------------------------------------------------------------------------
* PowerPoint的Ribbon加载界面
* 修改:杨斌 2012-03-19
* ----------------------------------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Tools.Ribbon;
using SunVoteARSPPT;
using System.Windows.Forms;
using System.Drawing;
using GeneralLib;
using System.Runtime.InteropServices;
using Microsoft.Office.Interop.PowerPoint;
using System.IO;
using ProService;
namespace SunVoteARSPPT
{
/// <summary>
/// 隐藏面板触发事件
/// //2012-05-25 赵丽 隐藏面板后,添加幻灯片,面板位置不准确
/// </summary>
public delegate void HidePanelEventHander();
public partial class rbSunVoteARS
{
//2012-05-25 赵丽 隐藏面板后,添加幻灯片,面板位置不准确
public static event HidePanelEventHander HidePanelEvent;
/// <summary>
/// 检测是否存在打开的PPT
/// </summary>
public Timer tmrCheckActivePres = new Timer();
//public System.Timers.Timer tmrCheckActivePres = new System.Timers.Timer();
//private bool thisEnabled = true;
public bool VoteListEnabled
{
set
{
//屏蔽下面一行。杨斌 2015-03-09 office64位报错。
//System.Data.OleDb.OleDbException: 对象无效或不再被设置。
//GlobalInfo.response.EnableList = value;
chkVoterEnabled.Checked = value;
if (value)
menuVoter.Image = VoteListEnabledImage;//杨斌 2019-01-25
else
menuVoter.Image = Properties.Resources.VoterList;
}
}
/// <summary>
/// 启用名单的图标。Angage和PowerVote独树一帜用对比度差的绿色打勾图标呵呵。杨斌 2019-01-25
/// </summary>
public Image VoteListEnabledImage
{
get
{
switch (GlobalInfo.OEMLogo)
{
case OEMLogos.oemPowerVote:
case OEMLogos.oemAngage:
return Properties.Resources.MemberEnabled_Green;
default:
return Properties.Resources.MemberEnabled;
}
}
}
/// <summary>
/// 初始化SDK显示,屏蔽不支持的
/// 杨斌 2015-03-13
/// </summary>
private void InitSdkType()
{
//if (GlobalInfo.GetSdkType() == 0)
//{
chkKeypadOffNever.Visible = true;
//杨斌 2016-10-26
btnKeypadTest.Visible = false;
btnChannelSet.Visible = false;
btnDeviceSet.Visible = false;
chkKeypadOffNever.Visible = false;
chkKeypadBeep.Visible = false;
btnKeypadShutdown.Visible = false;
//}
//else if (GlobalInfo.GetSdkType() == 1)
//{
// chkKeypadOffNever.Visible = false;
//}
}
void baseConnect_ConnectStatusEvent(int BaseID)
{
InitSdkType();//杨斌 2015-03-13
//spbHardwareSet.Enabled = CheckConnectStatus();
bool bConnect = GlobalInfo.baseConnect.CheckConnectStatus();//便于调试。杨斌 2015-03-13
SetBaseConnectStatus(bConnect);
}
private void rbSunVoteARS_Load(object sender, RibbonUIEventArgs e)
{
try
{
GlobalInfo.InitMain();//也可能先运行rbSunVoteARS_Load,再运行ThisAddIn_Startup,杨斌 2012-02-27
Globals.SunVoteARSAddIn.AddinStartupInit();
SetRibbonLanguage();
if (GlobalInfo.baseConnect != null)//杨斌 2016-12-13
{
GlobalInfo.baseConnect.ConnectStatusEvent += new ConnectStatusEvent(baseConnect_ConnectStatusEvent);
GlobalInfo.baseConnect.OnReTryConnectEvt += baseConnect_OnReTryConnectEvt;
GlobalInfo.baseConnect.ResponseStateEvent += new ResponseStateEventHander(baseConnect_ResponseStateEvent);
}
GlobalInfo.hardwareManage.ReadOnlyEvent += new ReadOnlyEvent(hardwareManage_ReadOnlyEvent);
GlobalInfo.response.VoteListEnabledEvent += new VoteListEnabledEventHander(response_VoteListEnabledEvent);
GlobalInfo.hardwareManage.ReadBaseInfo = true;
FrmSystemSet.LanguageSetEvent += new FrmSystemSet.LanguageSetEventHander(FrmSystemSet_LanguageSetEvent);
GlobalInfo.response.IsResponsedEvent += new IsResponsedEventHander(response_IsResponsedEvent);
//tmrCheckActivePres.AutoReset = false;//杨斌 2018-03-02
//tmrCheckActivePres.Elapsed += TmrCheckActivePres_Elapsed;//杨斌 2018-03-02
tmrCheckActivePres.Tick += new EventHandler(tmrCheckActivePres_Tick);
tmrCheckActivePres.Interval = 300;//杨斌 2017-01-06
tmrCheckActivePres.Enabled = true;
//chkKeypadOffNever.Checked = (GlobalInfo.hardwareManage.KeyPowerOffModel == HardwareManageARS.EKeyPowerOffModel.kmForbid);
//chkKeypadBeep.Checked = (GlobalInfo.hardwareManage.BuzzerModel == HardwareManageARS.EBuzzerModel.bmAllow);
if (GlobalInfo.baseConnect != null)//杨斌 2016-12-13
{
chkKeypadBeep.Checked = (GlobalInfo.baseConnect.BuzzerMode != 0) ? true : false;
chkKeypadOffNever.Checked = (GlobalInfo.baseConnect.KeyOffTime == 255) ? true : false;
chkKeypadBeep.Enabled = (!GlobalInfo.hardwareManage.ReadBaseInfo) && (!GlobalInfo.baseConnect.IsResponse);
chkKeypadOffNever.Enabled = (!GlobalInfo.hardwareManage.ReadBaseInfo) && (!GlobalInfo.baseConnect.IsResponse);
btnKeypadShutdown.Enabled = (!GlobalInfo.hardwareManage.ReadBaseInfo) && (!GlobalInfo.baseConnect.IsResponse);
}
//btnSlideResult.Visible = false;
//btnVoterDetail.Visible = false;
//menuReport.Items.Remove(separatorReport);
LoadCorrectShape();//杨斌 2015-01-22
InitSdkType();//杨斌 2015-03-13
}
catch (Exception ex)
{
SystemLog.WriterLog(ex);
}
}
void baseConnect_OnReTryConnectEvt()
{
GlobalInfo.baseConnect.ConnectReTry();
}
void response_IsResponsedEvent()
{
//chkVoterEnabled.Enabled = false;//屏蔽。杨斌 2018-03-02
}
bool IsShowMsgPresCount = false;
/// <summary>
/// 计时器,检测是否存在活动的PPT,不存在活动PPT,面板不可用
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
//private void TmrCheckActivePres_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
void tmrCheckActivePres_Tick(object sender, EventArgs e)
{
try//杨斌 2018-03-16
{
GlobalInfo.RefreshConnectState();//杨斌 2016-10-24
Globals.SunVoteARSAddIn.GetRequestPress();//杨斌 2016-10-25
}
catch (Exception ex)
{
string ss = ex + "";
}
try//杨斌 2018-03-16
{
GlobalInfo.RefreshConnectState();//杨斌 2016-10-24
if ((GlobalInfo.response.BusinessStatus == ResponseStatus.bsStart) || (GlobalInfo.response.IsStartRunshAnswer))
GlobalInfo.response.GetKeyPress();//杨斌 2016-10-25
}
catch (Exception ex)
{
string ss = ex + "";
}
try//杨斌 2017-03-06
{
if (Globals.SunVoteARSAddIn.Application.Presentations.Count < 1)
{
if (Globals.SunVoteARSAddIn.Application.Visible == Microsoft.Office.Core.MsoTriState.msoFalse)
{
if (IsShowMsgPresCount)
{
IsShowMsgPresCount = true;
MessageBox.Show("Presentations.Count=0 && Visible=False");
}
}
}
}
catch { }
if (Globals.SunVoteARSAddIn.IsExitApp)//杨斌 2015-11-10
return;
bool enabled = true;
try
{
enabled = (Globals.SunVoteARSAddIn.PPTEdit.PPT.ActivePresentation != null);
if (enabled)//杨斌 2014-12-05
enabled = (PublicFunction.CheckPath(GlobalInfo.APP_DIR));
}
catch
{
enabled = false;
}
try
{
//杨斌 2018-03-02
if (menuNewPPT.Enabled != enabled)
menuNewPPT.Enabled = enabled;
if (menuInsertObject.Enabled != enabled)
menuInsertObject.Enabled = enabled;
if (spbtnClearData.Enabled != enabled)
spbtnClearData.Enabled = enabled;
if (btnVoteDetail.Enabled != enabled)
btnVoteDetail.Enabled = enabled;
if (tgbShowPanel.Enabled != enabled)
tgbShowPanel.Enabled = enabled;
if (menuVoter.Enabled != enabled)
menuVoter.Enabled = enabled;
if (menuAnalyze.Enabled != enabled)
menuAnalyze.Enabled = enabled;
if (menuReport.Enabled != enabled)
menuReport.Enabled = enabled;
if (btnDataExport.Enabled != enabled)
btnDataExport.Enabled = enabled;
if (btnFTPSet.Enabled != enabled)
btnFTPSet.Enabled = enabled;
if (btnStartSever.Enabled != enabled)
btnStartSever.Enabled = enabled;
//if (thisEnabled != enabled)
//{
// thisEnabled = enabled;
// this.menuNewPPT.Enabled = enabled;
// EnabledInsertObject(enabled);//杨斌 2012-03-26
// this.spbtnClearData.Enabled = enabled;
// this.tgbShowPanel.Enabled = enabled;
// this.btnDataExport.Enabled = enabled;
// this.btnDataImport.Enabled = enabled;
// this.menuAnalyze.Enabled = enabled;
// this.menuReport.Enabled = enabled;
// this.menuVoter.Enabled = enabled;
// this.spbHardwareSet.Enabled = enabled;
// this.btnAbout.Enabled = enabled;
// this.btnSystemSet.Enabled = enabled;
// this.btnHelp.Enabled = enabled && EnabledHelp;//杨斌 2013-03-29
// tgbShowPanel.Checked = enabled;
// tgbShowPanel_Click(null, null);
//}
}
catch { }
if (!tmrCheckActivePres.Enabled)//杨斌 2018-03-02
tmrCheckActivePres.Enabled = true;
if ((GlobalInfo.OEMLogo == OEMLogos.oemiPericles) && (GlobalInfo.OEMLogo2 == OEMLogos2.oemHideData))//杨斌 2020-03-06
{
btnVoteDetail.Enabled = menuAnalyze.Enabled = menuReport.Enabled = false;
}
}
/// <summary>
/// 设置插入对象启用
/// 创建:杨斌 2012-03-26
/// </summary>
/// <param name="enabled"></param>
public void EnabledInsertObject(bool enabled)
{
try
{
if (enabled)
{
if (Globals.SunVoteARSAddIn.PPTEdit != null)
{
if (Globals.SunVoteARSAddIn.PPTEdit.SlideEdit != null)
{
switch (Globals.SunVoteARSAddIn.PPTEdit.ResponseTypeSlideEdit)
{
case ResponseType.None:
case ResponseType.Slide:
//if (GlobalInfo.OEMLogo == OEMLogos.oemPowerVote && oemAngage)//杨斌 2018-01-23
// enabled = true;
//else
enabled = false;
break;
}
}
else
{
enabled = false;
}
}
else
{
enabled = false;
}
}
menuInsertObject.Enabled = enabled;
}
catch (Exception ex)
{
SystemLog.WriterLog(ex, false);
}
}
/// <summary>
/// 启用名单事件,更改按钮图标
/// </summary>
/// <param name="enabled"></param>
void response_VoteListEnabledEvent(bool enabled)
{
chkVoterEnabled.Checked = enabled;
if (enabled)
menuVoter.Image = VoteListEnabledImage;//杨斌 2019-01-25
else
menuVoter.Image = Properties.Resources.VoterList;
}
void baseConnect_ResponseStateEvent(bool isResponse)
{
chkKeypadBeep.Enabled = (!GlobalInfo.hardwareManage.ReadBaseInfo) && (!isResponse);
chkKeypadOffNever.Enabled = (!GlobalInfo.hardwareManage.ReadBaseInfo) && (!isResponse);
btnKeypadShutdown.Enabled = (!GlobalInfo.hardwareManage.ReadBaseInfo) && (!isResponse);
}
void FrmSystemSet_LanguageSetEvent()
{
SetRibbonLanguage();
}
void hardwareManage_ReadOnlyEvent(bool ReadOnly)
{
return;//杨斌 2016-12-01
//杨斌 2015-03-18
if (GlobalInfo.GetSdkType() == 1)
{
bool bConnect = GlobalInfo.baseConnect.CheckConnectStatus();
ReadOnly = !bConnect;
ReadOnly = false;
}
//if ((!GlobalInfo.baseConnect.IsResponse) || (!ReadOnly))
//{
chkKeypadBeep.Enabled = (!ReadOnly) && (!GlobalInfo.baseConnect.IsResponse);
chkKeypadOffNever.Enabled = (!ReadOnly) && (!GlobalInfo.baseConnect.IsResponse);
btnKeypadShutdown.Enabled = (!ReadOnly) && (!GlobalInfo.baseConnect.IsResponse);
//}
}
/// <summary>
/// 新建签到
/// 修改:杨斌 2012-05-29
/// </summary>
void btnSignIn_Click(object sender, RibbonControlEventArgs e)
{
InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.SignIn);
Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.SignIn, 2, 1);
Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
}
/// <summary>
/// 新建分组
/// 修改:杨斌 2012-05-29
/// </summary>
void btnGroup_Click(object sender, RibbonControlEventArgs e)
{
//InsertSlideInfo.ResponseType = ResponseType.Group;
//if (e.Control.Id == btnGroupSex.Id)
//{
// InsertSlideInfo.OptionCount = 2;
// InsertSlideInfo.OptionText = new string[InsertSlideInfo.OptionCount];
// InsertSlideInfo.OptionText[0] = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "Man", "男");
// InsertSlideInfo.OptionText[1] = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "Woman", "女");
//}
//else
//{
// Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.Group, 2, 1);
//}
RibbonButton btn = (RibbonButton)sender;
int optionCount = new ConvertOper(btn.Name.Substring("btnGroup".Length)).ToInt;
if (optionCount < 1) return;
InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.Group);
Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.Group, optionCount, 1);
Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
}
/// <summary>
/// 新建单选
/// 修改:杨斌 2012-05-29
/// </summary>
void btnChoiceS_Click(object sender, RibbonControlEventArgs e)
{
RibbonButton btn = (RibbonButton)sender;
int optionCount = new ConvertOper(btn.Name.Substring("btnChoiceS".Length)).ToInt;
//InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.Choice);
InsertSlideInfo.TitleText = PPTOper.GetChoiseTitle(ResponseType.Choice, 0);
Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.Choice, optionCount, 1);
Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
}
/// <summary>
/// 新建多选
/// 修改:杨斌 2012-05-29
/// </summary>
void btnChoiceM_Click(object sender, RibbonControlEventArgs e)
{
RibbonButton btn = (RibbonButton)sender;
int optionCout = new ConvertOper(btn.Name.Substring("btnChoiceM".Length)).ToInt;
//InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.Choice);
InsertSlideInfo.TitleText = PPTOper.GetChoiseTitle(ResponseType.Choice, 1);
Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.Choice, optionCout, optionCout);
Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
}
/// <summary>
/// 新建评分
/// 修改:杨斌 2012-05-29
/// </summary>
private void btnScore_Click(object sender, RibbonControlEventArgs e)
{
InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.Score);
Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.Score, 0, 0);
Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
}
/// <summary>
/// 新建选举
/// 修改:杨斌 2012-05-29
/// </summary>
private void btnPoll_Click(object sender, RibbonControlEventArgs e)
{
InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.Poll);
Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.Poll, 0, 0);
Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
}
/// <summary>
/// 新建排序
/// 修改:杨斌 2012-05-29
/// </summary>
private void btnOrder_Click(object sender, RibbonControlEventArgs e)
{
RibbonButton btn = (RibbonButton)sender;
int optionCount = new ConvertOper(btn.Name.Substring("btnOrder".Length)).ToInt;
InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.Order);
Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.Order, optionCount, optionCount);
Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
}
/// <summary>
/// 新建判断
/// 修改:杨斌 2012-05-29
/// </summary>
private void btnJudge_Click(object sender, RibbonControlEventArgs e)
{
RibbonButton btn = (RibbonButton)sender;
InsertSlideInfo.ResponseType = ResponseType.Judge;
InsertSlideInfo.OptionCount = 2;
//Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.Order, optionCount, optionCount);
InsertSlideInfo.OptionText = new string[InsertSlideInfo.OptionCount];
//默认值
InsertSlideInfo.OptionText[0] = "Yes";
InsertSlideInfo.OptionText[1] = "No";
//从语言包加载,不成功则为默认值
string str = btn.Label;//GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnJudgeYesNo", "Yes/No");
string style = btn.Name.Replace("btnJudge", "");
//switch (style)
//{
// case "YesNo":
// InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.Judge, 0);
// break;
// case "TrueFalse":
// InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.Judge, 1);
// break;
// case "RightWrong":
// InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.Judge, 2);
// break;
//}
//2012-05-30
InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.Judge, 0);
char[] split = new char[] { '/' };
string[] sAry = str.Split(split);
if (sAry.Length >= 1)
InsertSlideInfo.OptionText[0] = sAry[0];
if (sAry.Length >= 2)
InsertSlideInfo.OptionText[1] = sAry[1];
Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
}
/// <summary>
/// 新建表决
/// 修改:杨斌 2012-05-29
/// </summary>
private void btnVote_Click(object sender, RibbonControlEventArgs e)
{
RibbonButton btn = (RibbonButton)sender;
InsertSlideInfo.ResponseType = ResponseType.Vote;
InsertSlideInfo.OptionCount = 3;
InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.Vote);
Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.Vote, InsertSlideInfo.OptionCount, 1);
Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
}
/// <summary>
/// 新建评议
/// 修改:杨斌 2012-05-29
/// </summary>
private void btnGrade_Click(object sender, RibbonControlEventArgs e)
{
RibbonButton btn = (RibbonButton)sender;
InsertSlideInfo.ResponseType = ResponseType.Grade;
//Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.Grade, optionCount, 1);
//从语言包加载,不成功则为默认值
string str = btn.Label;//GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnJudgeYesNo", "Yes/No");
char[] split = new char[] { '/' };
string[] sAry = str.Split(split);
InsertSlideInfo.OptionCount = sAry.Length;
InsertSlideInfo.OptionText = sAry;
InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.Grade);
Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
}
/// <summary>
/// 新建数字
/// 修改:杨斌 2012-05-29
/// </summary>
private void btnNumber_Click(object sender, RibbonControlEventArgs e)
{
InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.Number);
Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.Number, 0, 0);
Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
}
/// <summary>
/// 新建文本题
/// 杨斌 2015-01-12
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnText_Click(object sender, RibbonControlEventArgs e)
{
InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.Text);
Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.Text, 0, 0);
Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
}
private void btnVoterView_Click(object sender, RibbonControlEventArgs e)
{
new FrmVoterList().ShowDialog();
FrmVoteBar.ActivateSlideShowWindow();
}
private void btnVoterImport_Click(object sender, RibbonControlEventArgs e)
{
//NameList.Load();
//if (NameList.Count > 0)
//{
//if (MessageBox.Show("此操作将清空现有名单!是否继续?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.None) == DialogResult.No)
//{
// return;
//}
//}
OpenFileDialog ofd = new OpenFileDialog();
//ofd.Filter = "Excel(*.xls;*.xlsx)|*.xls;*.xlsx|CSV(*.csv)|*.csv";//杨斌 2017-10-27
ofd.Filter = "Excel(*.xlsx)|*.xlsx|CSV(*.csv)|*.csv";//杨斌 2018-12-18。不兼容2003格式
//杨斌 2014-08-12
string path = Properties.Settings.Default.VoterListPath;
//杨斌 2014-10-21
path = new DirectoryInfo(GlobalInfo.GetAppWorkDir()).Parent.FullName;
path += @"\Resources\RosterList\";
if (!string.IsNullOrEmpty(path))
{
ofd.InitialDirectory = Path.GetDirectoryName(path);
//if (File.Exists(path))
// ofd.InitialDirectory = new DirectoryInfo(path).Parent.FullName;
//else if (Directory.Exists(path))
// ofd.InitialDirectory = path;
}
if (ofd.ShowDialog() == DialogResult.OK)
{
if (ofd.FileName != "" || ofd.FileName != string.Empty)
{
//导入名单到Access
//if (!MemberList.ImportMember(ofd.FileName))
//{
// return;
//}
if (MessageBox.Show(GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "WarningInfo1", "此操作将清空现有名单!是否继续?"),
GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "Warning", "警告"), MessageBoxButtons.YesNo, MessageBoxIcon.None) == DialogResult.No)
{
return;
}
//杨斌 2014-08-12
Properties.Settings.Default.VoterListPath = ofd.FileName;
Properties.Settings.Default.Save();
new FrmVoterList().ShowImportList(ofd.FileName);
//FrmVoterList frm = new FrmVoterList();
//frm.Hide();
//frm.ImportList(ofd.FileName);
//frm.ShowDialog();
}
////改更是否启用名单状态为启用名单
//Globals.Ribbons.rbSunVoteARSPPT.chkEnableList.Checked = true;
//Globals.SunVoteARSAddIn.PPT.ActivePresentation.Tags.Add(PPTTags.ENABLED_MEMBER_LIST, "1");
}
FrmVoteBar.ActivateSlideShowWindow();
}
//导出名单
private void btnVoterExport_Click(object sender, RibbonControlEventArgs e)
{
FrmVoterList.ExportListNoVisible();
//SaveFileDialog sfd = new SaveFileDialog();
//sfd.Filter = "Excel(*.xlsx)|*.xlsx";
//sfd.AddExtension = true;
//sfd.OverwritePrompt = true;
//sfd.ValidateNames = true;
//sfd.ShowDialog();
//sfd.FilterIndex = 2;
//DataSet ds = MemberList.GetMenberList();
//if (ds != null && ds.Tables.Count > 0)
//{
// MemberList.ExportMemberList(sfd.FileName, ds.Tables[0]);
//}
}
//设置键盘个数
private void btnSetVoterCount_Click(object sender, RibbonControlEventArgs e)
{
new FrmKeypadCountSet().ShowDialog();
FrmVoteBar.ActivateSlideShowWindow();
}
//设置键盘类型
private void btnKeypadType_Click(object sender, RibbonControlEventArgs e)
{
new FrmKeypadType().ShowDialog();
FrmVoteBar.ActivateSlideShowWindow();
EnabledSlideResponseType();//杨斌 2019-12-09
}
//键盘测试
private void btnKeypadTest_Click(object sender, RibbonControlEventArgs e)
{
//if ((SystemConfig.MultiBase == 0) || (SystemConfig.BaseCount==1))
//{
FrmKeypadTest frmKeypadTest = new FrmKeypadTest();
frmKeypadTest.ShowDialog();
frmKeypadTest.ShowSingle = true;
frmKeypadTest.BaseID = GlobalInfo.baseConnect[0].BaseID;
//}//单基站模式
//else
//{
// FrmMonitorAll frmMonitorAll = new FrmMonitorAll();
// Rectangle ScreenArea = System.Windows.Forms.Screen.GetWorkingArea(frmMonitorAll);
// frmMonitorAll.Width = ScreenArea.Width; //屏幕宽度
// frmMonitorAll.Height = ScreenArea.Height;
// frmMonitorAll.ShowDialog();
//}//多基站模式
FrmVoteBar.ActivateSlideShowWindow();
}
/// <summary>
/// 键盘替换
/// 修改:杨斌 2012-06-01,基站连接状态时,若为非模式窗体置顶则会PowerPoint会死掉,改为弹出模式窗体
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnKeypadReplace_Click(object sender, RibbonControlEventArgs e)
{
FrmKeypadReplace frm = new FrmKeypadReplace();
//frm.TopMost = true;
//frm.Show();
frm.ShowDialog();
FrmVoteBar.ActivateSlideShowWindow();
}
//键盘遥控关机
private void btnKeypadShutdown_Click(object sender, RibbonControlEventArgs e)
{
if (GlobalInfo.hardwareManage.KeyPowerOffModel == HardwareManageARS.EKeyPowerOffModel.kmForbid)
{
if (MessageBox.Show(GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "ShutWarning", "系统处于禁止键盘关机状态,是否强制关机?")
, GlobalInfo.GetAppName(), MessageBoxButtons.YesNo,
MessageBoxIcon.Question) == DialogResult.Yes)
{
//强制关机
GlobalInfo.hardwareManage.KeyPowerOffModel = HardwareManageARS.EKeyPowerOffModel.kmAllow;
chkKeypadOffNever.Checked = false;
}
else
{
return;
}
}
new FrmKeypadShutdown().ShowDialog();//要启用监控,速度很慢
GlobalInfo.hardwareManage.RemoteOff();
//MessageBox.Show("关机成功,请查看键盘", "ARS2011");
FrmVoteBar.ActivateSlideShowWindow();
}
//硬件设置
private void btnDeviceSet_Click(object sender, RibbonControlEventArgs e)
{
new FrmDeviceSet().ShowDialog();
//new FrmDeviceSet().Show();
//Form frm = new FrmDeviceSet();
//frm.TopMost = true;
//frm.Visible = true;
//if (BaseConnect.FmDeviceSet != null)
// BaseConnect.FmDeviceSet.ShowDialog();
//FrmVoteBar.ActivateSlideShowWindow();
}
//频点更换
private void btnChannelSet_Click(object sender, RibbonControlEventArgs e)
{
if (GlobalInfo.GetSdkType() == 0)
{
if (GlobalInfo.baseConnect.MultiBase == 0)
{
new FrmChannelReplace().ShowDialog();
}
else
{
//多基站模式
new FrmDeviceSet().ShowDialog();
//new FrmDeviceSet().Show();
//Form frm = new FrmDeviceSet();
//frm.TopMost = true;
//frm.Visible = true;
//if (BaseConnect.FmDeviceSet != null)
// BaseConnect.FmDeviceSet.ShowDialog();
}
}
else if (GlobalInfo.GetSdkType() == 1)
{
new FrmChannelReplace().ShowDialog();
}
//FrmVoteBar.ActivateSlideShowWindow();
}
//键盘个数设置
private void btnKeypadCountSet_Click(object sender, RibbonControlEventArgs e)
{
new FrmKeypadCountSet().ShowDialog();
FrmVoteBar.ActivateSlideShowWindow();
}
//答题正确率
private void btnRateCorrect_Click(object sender, RibbonControlEventArgs e)
{
new FrmAnalyzeRateCorrect().ShowDialog();
FrmVoteBar.ActivateSlideShowWindow();
}
//选项选择率
private void btnRateOption_Click(object sender, RibbonControlEventArgs e)
{
new FrmAnalyzeRateOption().ShowDialog();
FrmVoteBar.ActivateSlideShowWindow();
}
//多题分项对比
private void btnAnalyzeSlideOption_Click(object sender, RibbonControlEventArgs e)
{
new FrmAnalyzeSlide(false).ShowDialog();
FrmVoteBar.ActivateSlideShowWindow();
}
//二题交叉对比
private void btnAnalyzeSlideCross_Click(object sender, RibbonControlEventArgs e)
{
new FrmAnalyzeSlide(true).ShowDialog();
FrmVoteBar.ActivateSlideShowWindow();
}
//答题分组对比
private void btnAnalyzeSlideGroup_Click(object sender, RibbonControlEventArgs e)
{
new FrmAnalyzeSlideGroup().ShowDialog();
FrmVoteBar.ActivateSlideShowWindow();
}
//人员排行
private void btnRankVoter_Click(object sender, RibbonControlEventArgs e)
{
new FrmRankVoter().ShowDialog();
FrmVoteBar.ActivateSlideShowWindow();
}
//分组排行
private void btnRankGroup_Click(object sender, RibbonControlEventArgs e)
{
new FrmRankGroup().ShowDialog();
FrmVoteBar.ActivateSlideShowWindow();
}
//评分排行
private void btnRankScore_Click(object sender, RibbonControlEventArgs e)
{
new FrmRankScore().ShowDialog();
FrmVoteBar.ActivateSlideShowWindow();
}
//选举排行
private void btnRankPoll_Click(object sender, RibbonControlEventArgs e)
{
new FrmRankPoll().ShowDialog();
FrmVoteBar.ActivateSlideShowWindow();
}
//数据备份
private void btnDataExport_Click(object sender, RibbonControlEventArgs e)
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "BackupFile (*.arsz)|*.arsz";//杨斌 2012-05-23
sfd.AddExtension = true;
sfd.OverwritePrompt = true;
sfd.ValidateNames = true;
if (sfd.ShowDialog() == DialogResult.OK)
{
//修改标志 赵丽 2012-06-06 全角转半角
sfd.FileName = PublicFunction.ToDBC(sfd.FileName);
PPTOper.Exportmdb(sfd.FileName, Globals.SunVoteARSAddIn.PPTEdit.PPT.ActivePresentation);
MessageBox.Show(GlobalInfo.SysLanguage.LPT.ReadString(this.Name, "successisderiveds", "成功备份反馈数据!"));
}
FrmVoteBar.ActivateSlideShowWindow();
}
//数据还原
private void btnDataImport_Click(object sender, RibbonControlEventArgs e)
{
try
{
if (MessageBox.Show(GlobalInfo.SysLanguage.LPT.ReadString(this.Name, "btnImportResponseMessage", "此操作将覆盖现有数据,是否继续?"),
GlobalInfo.SysLanguage.LPT.ReadString(this.Name, "prompt", "提示"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
return;
}
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "BackupFile (*.arsz)|*.arsz";//杨斌 2012-05-23
ofd.CheckFileExists = true;
ofd.CheckPathExists = true;
ofd.InitialDirectory = System.Environment.CurrentDirectory;//文件当前目录
if (ofd.ShowDialog() == DialogResult.OK)
{
if (PPTOper.Importmdb(ofd.FileName, Globals.SunVoteARSAddIn.PPTEdit.PPT.ActivePresentation))
MessageBox.Show(GlobalInfo.SysLanguage.LPT.ReadString(this.Name, "Documents", "文件还原成功!"));
else
MessageBox.Show(GlobalInfo.SysLanguage.LPT.ReadString(this.Name, "RestoreError", "文件丢失,无法还原"), GlobalInfo.GetAppName());
}
}
catch
{
MessageBox.Show(GlobalInfo.SysLanguage.LPT.ReadString(this.Name, "RestoreError", "文件丢失,无法还原"), GlobalInfo.GetAppName());
}
FrmVoteBar.ActivateSlideShowWindow();
}
//系统设置
private void btnSystemSet_Click(object sender, RibbonControlEventArgs e)
{
new FrmSystemSet().ShowDialog();
FrmVoteBar.ActivateSlideShowWindow();
}
//按键明细报表
private void btnVoterDetail_Click(object sender, RibbonControlEventArgs e)
{
new FrmReport(0).ShowDialog();
FrmVoteBar.ActivateSlideShowWindow();
}
//答题结果报表
private void btnSlideResult_Click(object sender, RibbonControlEventArgs e)
{
new FrmReport(1).ShowDialog();
FrmVoteBar.ActivateSlideShowWindow();
}
//清除当前反馈
private void btnClearCurrent_Click(object sender, RibbonControlEventArgs e)
{
if (MessageBox.Show(GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "ClearCurrWarning",
"将清空当前幻灯片的反馈数据,并保存当前幻灯片的内容,是否继续?"), GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "Warning", "警告"),
MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
{
PPTOper.RefreshOneIsExistChart(Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
PPTOper.ClearCurrentSlide();
FrmVoteBar.PanelEnabled = true;
//2012-12-04 赵丽 清除当前数据 保存幻灯片
if (Globals.SunVoteARSAddIn.PPTEdit.PPT.ActivePresentation.Path != "")
Globals.SunVoteARSAddIn.PPTEdit.PPT.ActivePresentation.Save();
}
}
//清除所有反馈
private void btnClearAll_Click(object sender, RibbonControlEventArgs e)
{
if (MessageBox.Show(GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "ClearAllWarning", "将清空所有幻灯片的反馈数据,并保存所有幻灯片的内容,是否继续?")
, GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "Warning", "警告"),
MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
{
PPTOper.RefreshAllIsExistChart();
PPTOper.ClearAllSlide();
FrmVoteBar.PanelEnabled = true;
//chkVoterEnabled.Enabled = true;//屏蔽。杨斌 2018-03-02
//2012-12-04 赵丽 清除所有数据 保存幻灯片
if (Globals.SunVoteARSAddIn.PPTEdit.PPT.ActivePresentation.Path != "")
Globals.SunVoteARSAddIn.PPTEdit.PPT.ActivePresentation.Save();
}
}
//默认,清除当前反馈
private void spbtnClearData_Click(object sender, RibbonControlEventArgs e)
{
if (btnClearCurrent.Enabled)//杨斌 2012-03-13
btnClearCurrent_Click(null, null);
}
//硬件设置
private void spbHardwareSet_Click(object sender, RibbonControlEventArgs e)
{
GlobalInfo.ShowToolKit();//杨斌 2017-12-21
}
//键盘不自动关机
private void chkKeypadOffNever_Click(object sender, RibbonControlEventArgs e)
{
return;//杨斌 2017-04-19
if (chkKeypadOffNever.Checked) //禁止键盘关机
{
GlobalInfo.hardwareManage.KeyPowerOffModel = HardwareManageARS.EKeyPowerOffModel.kmForbid;
}//禁止关机
else
{
GlobalInfo.hardwareManage.KeyPowerOffModel = HardwareManageARS.EKeyPowerOffModel.kmAllow;
}//允许关机
int PowerOffMode = (chkKeypadOffNever.Checked) ? 255 : 0;
GlobalInfo.sysConfig.WriteSysConfig("Device", "PowerOffMode", PowerOffMode);
}
//启用蜂鸣器
private void chkKeypadBeep_Click(object sender, RibbonControlEventArgs e)
{
return;//杨斌 2017-04-19
if (chkKeypadBeep.Checked)
{
GlobalInfo.hardwareManage.BuzzerModel = HardwareManageARS.EBuzzerModel.bmAllow;
}
else
{
GlobalInfo.hardwareManage.BuzzerModel = HardwareManageARS.EBuzzerModel.bmForbid;
}
int BuzzerMode = (chkKeypadBeep.Checked) ? 1 : 0;
GlobalInfo.sysConfig.WriteSysConfig("Device", "BuzzerMode", BuzzerMode);
}
/// <summary>
/// 判断是否启用单基站
/// </summary>
/// <returns></returns>
public bool SingleBase()
{
int BaseNum = 0;
for (int i = 0; i < GlobalInfo.baseConnect.BaseList.Count; i++)
{
if (GlobalInfo.baseConnect[i].EnableStatus)
{
BaseNum += 1;
}
}
if (BaseNum == 1) { return true; } else { return false; }
}
/// <summary>
/// 屏蔽编辑工具
/// </summary>
/// <param name="enabled"></param>
public void EnabledEditTools(bool enabled)
{
menuInsertObject.Enabled = enabled;
//spbtnClearData.Enabled = enabled;
//杨斌 2012-03-13
bool isResponseType = false;
switch (Globals.SunVoteARSAddIn.PPTEdit.ResponseTypeSlideEdit)
{
case ResponseType.None:
case ResponseType.Slide:
isResponseType = false;
break;
default:
isResponseType = true;
break;
}
btnClearCurrent.Enabled = enabled && isResponseType;
btnClearAll.Enabled = (Globals.SunVoteARSAddIn.PPTEdit.PPT.ActivePresentation.Slides.Count > 0);
spbtnClearData.Enabled = btnClearAll.Enabled;
}
/// <summary>
/// 当前显示面板按钮状态
/// </summary>
public bool ShowPanelChecked
{
get { return tgbShowPanel.Checked; }
set { tgbShowPanel.Checked = value; }
}
//是否显示参数面板
private void tgbShowPanel_Click(object sender, RibbonControlEventArgs e)
{
try
{
//2012-05-25 赵丽 隐藏面板后,添加幻灯片,面板位置不准确
if (!tgbShowPanel.Checked)
{
if (HidePanelEvent != null)
HidePanelEvent();
}
ShowPanelClick();
}
catch (Exception ex)
{
SystemLog.WriterLog(ex);
}
}
/// <summary>
/// 改变按钮Check状态没有触发_Click事件,因此需要手动调用
/// </summary>
public void ShowPanelClick()
{
Globals.SunVoteARSAddIn.PPTEdit.ShowEditPanel();
tgbShowPanel.Label = tgbShowPanel.Checked ? GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "Hide", " 隐藏") + "\r\n" + GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "Panel", "设置面板")
: GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "Show", " 显示") + "\r\n" + GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "Panel", "设置面板"); ;
}
/// <summary>
/// 基站连接状态
/// 杨斌 2012-04-17
/// PowerPoint2007在刷新Ribbon时,会影响动画选择菜单(展开下拉列表时,自动滚动到已经选择的菜单项)
/// </summary>
public void SetBaseConnectStatus(bool status)
{
if (status)
{
if (spbHardwareSet.Tag == null)
{
spbHardwareSet.Image = Properties.Resources.BaseOnLine;
spbHardwareSet.Tag = 1;
}
GlobalInfo.InitRemontControl();//杨斌 2017-03-31
}//连接成功
else
{
if (spbHardwareSet.Tag == null)//空条件未判断,可能导致异常。杨斌 2012-05-09
{
}
else if (ConvertOper.Convert(spbHardwareSet.Tag.ToString()).ToInt == 1)
{
spbHardwareSet.Image = Properties.Resources.BaseOffLine;
spbHardwareSet.Tag = null;
}
GlobalInfo.hardwareManage.ReadBaseInfo = true;
}
//杨斌 2019-03-04
if (Globals.SunVoteARSAddIn.frmVoteBar != null)
{
Globals.SunVoteARSAddIn.frmVoteBar.ShowBaseConnectState();
}
}
private void chkVoterEnabled_Click(object sender, RibbonControlEventArgs e)
{
//是否启用名单
VoteListEnabled = chkVoterEnabled.Checked;
//杨斌 2015-03-09。在上面一行代码中写数据库,office64位报错。
//System.Data.OleDb.OleDbException: 对象无效或不再被设置。
GlobalInfo.response.EnableList = chkVoterEnabled.Checked;
//TagSet tagSet = new TagSet();
//foreach (Slide slide in Globals.SunVoteARSAddIn.PPTEdit.PPT.ActivePresentation.Slides)
//{
// string slideID = slide.SlideID.ToString();
// tagSet.Tags = slide.Tags;
// ResponseType responseType = EnumName<ResponseType>.GetEnum(tagSet.GetValue(TagKey.ResponseType).Value);
// if ((responseType != ResponseType.None) && (responseType != ResponseType.Slide))
// {
// GlobalInfo.response.RefreshResult(slideID, responseType);
// }
//}
//GlobalInfo.sysConfig.WriteSysConfig("Device","EnabledPerson", chkVoterEnabled.Checked);
(Globals.SunVoteARSAddIn.PPTEdit.Panel.PanelShow as IPanel).LoadData();//杨斌 2015-01-15
}
/// <summary>
/// 设置Ribbon语言
/// 修改:杨斌 2012-03-23
/// </summary>
private void SetRibbonLanguage()
{
try
{
tabSunVoteARS.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "tabSunVoteARS", GlobalInfo.GetAppName());
grpHardware.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "grpHardware", "硬件管理");
grpPPTEdit.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "grpPPTEdit", "幻灯片编辑");
//grpPPTEdit.Label= INIControl.GetInstances(GlobalInfo.SysLanguage.LANGUAGE_PATH+GlobalInfo.SysLanguage.LanguageName+".ini").ReadString("rbSunVoteARS", "grpHardware", "硬件管理");
grpVoter.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "grpVoter", "参与者管理");
grpReport.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "grpReport", "数据分析和报表");
grpData.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "grpData", "反馈数据");
grpSystem.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "grpSystem", "系统设置与帮助");
spbHardwareSet.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "spbHardwareSet", "硬件设置 ").Replace(',', ' ');
spbHardwareSet.ScreenTip = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "spbHardwareSet_Tip", "硬件设置");
btnKeypadType.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnKeypadType", "键盘型号");
btnKeypadCountSet.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnKeypadCountSet", "键盘个数设置");
btnKeypadTest.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnKeypadTest", "键盘测试");
btnKeypadReplace.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnKeypadReplace", "键盘替换");
btnChannelSet.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChannelSet", "基站频点更换");
btnDeviceSet.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnDeviceSet", "硬件设置");
chkKeypadOffNever.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "chkKeypadOffNever", "禁止键盘关机");
chkKeypadBeep.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "chkKeypadBeep", "键盘蜂鸣");
btnKeypadShutdown.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnKeypadShutdown", "遥控关机");
menuNewPPT.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "new", " 新建") + "\r\n" + GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "PPTSlide", "幻灯片");
menuNewPPT.ScreenTip = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuNewPPT_Tip", "插入各种反馈类型的幻灯片模板");
btnSignIn.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnSignIn", "签到");
menuGroup.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuGroup", "分组");
btnGroupSex.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGroupSex", "性别");
btnGroupCustom.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "bt.nGroupCustom", "自定义...");
//杨斌 2012-05-29
btnGroup1.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGroup1", "1个组");
btnGroup2.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGroup2", "2个组");
btnGroup3.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGroup3", "3个组");
btnGroup4.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGroup4", "4个组");
btnGroup5.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGroup5", "5个组");
btnGroup6.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGroup6", "6个组");
btnGroup7.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGroup7", "7个组");
btnGroup8.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGroup8", "8个组");
btnGroup9.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGroup9", "9个组");
btnGroup10.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGroup10", "10个组");
menuChoiseSingle.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuChoiseSingle", "单选");
btnChoiceS1.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChoiceS1", "1个选项");
btnChoiceS2.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChoiceS2", "2个选项");
btnChoiceS3.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChoiceS3", "3个选项");
btnChoiceS4.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChoiceS4", "4个选项");
btnChoiceS5.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChoiceS5", "5个选项");
btnChoiceS6.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChoiceS6", "6个选项");
btnChoiceS7.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChoiceS7", "7个选项");
btnChoiceS8.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChoiceS8", "8个选项");
btnChoiceS9.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChoiceS9", "9个选项");
btnChoiceS10.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChoiceS10", "10个选项");
menuChoiseMulti.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuChoiseMulti", "多选");
btnChoiceM2.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChoiceM2", "2个选项");
btnChoiceM3.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChoiceM3", "3个选项");
btnChoiceM4.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChoiceM4", "4个选项");
btnChoiceM5.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChoiceM5", "5个选项");
btnChoiceM6.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChoiceM6", "6个选项");
btnChoiceM7.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChoiceM7", "7个选项");
btnChoiceM8.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChoiceM8", "8个选项");
btnChoiceM9.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChoiceM9", "9个选项");
btnChoiceM10.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChoiceM10", "10个选项");
menuJudge.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuJudge", "判断");
btnJudgeYesNo.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnJudgeYesNo", "是/否");
btnJudgeTrueFalse.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnJudgeTrueFalse", "真/假");
btnJudgeRightWrong.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnJudgeRightWrong", "对/错");
menuOrder.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuOrder", "排序");
btnOrder2.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnOrder2", "2个选项");
btnOrder3.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnOrder3", "3个选项");
btnOrder4.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnOrder4", "4个选项");
btnOrder5.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnOrder5", "5个选项");
btnOrder6.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnOrder6", "6个选项");
btnOrder7.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnOrder7", "7个选项");
btnOrder8.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnOrder8", "8个选项");
btnOrder9.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnOrder9", "9个选项");
btnOrder10.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnOrder10", "10个选项");
menuNumber.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnNumber", "数字");//杨斌 2014-11-04
btnNumber.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnNumber", "数字");
btnText.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnText", "文本");//杨斌 2015-01-15
btnVote.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnVote", "表决");
menuGrade.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuGrade", "评议");
btnGradeAgree2.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGradeAgree2", "同意/不同意");
btnGradeAgree31.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGradeAgree31", "同意/中立/不同意");
btnGradeAgree32.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGradeAgree32", "同意/基本同意/不同意");
btnGradeLevel3.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGradeLevel3", "高/中/低");
btnGradeNo3.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGradeNo3", "+/0/-");
btnGradeNo5.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGradeN5", "++/+/0/-/--");
btnGradeGood4.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGradeGood4", "优/良/中/差");
btnGradeSatisfy4.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGradeSatisfy4", "满意/基本满意/不满意/弃权");
btnGradeCustom.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGradeCustom", "自定义...");
btnScore.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnScore", "评分");
btnPoll.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnPoll", "选举");
//杨斌 2015-06-30
btnRankChartGroupMVP.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnRankChartGroupMVP", "团队最佳个人排行");
btnAutoTest.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnAutoTest", "自动测试");
btnInport.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnInport", "导入题库..");
//杨斌 2015-08-19
btnInport2.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnInport2", "导入题库(EasyTest)..");
menuInsertObject.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuInsertObject", "插入对象 ").Replace(',', ' ');
menuInsertObject.ScreenTip = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuInsertObject_Tip", "插入反馈对象");
menuChart.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuChart", "图表");
btnChartColumn.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChartColumn", "垂直柱状图");
btnChartBar.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChartBar", "水平柱状图");
btnChartPie.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChartPie", "饼图");
btnChartColumn3D.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChartColumn3D", "3D垂直柱状图");
btnChartBar3D.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChartBar3D", "3D水平柱状图");
btnChartPie3D.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChartPie3D", "3D饼图");
//杨斌 2014-07-30
btnChartColumnBox.Label = GlobalInfo.SysLanguage.LPT.ReadString("ucChartPara", "cboChartType_Text_2", "垂直方块图");
btnChartBarBox.Label = GlobalInfo.SysLanguage.LPT.ReadString("ucChartPara", "cboChartType_Text_3", "水平方块图");
btnChartColumnBox3D.Label = "3D " + GlobalInfo.SysLanguage.LPT.ReadString("ucChartPara", "cboChartType_Text_2", "垂直方块图");
btnChartBarBox3D.Label = "3D " + GlobalInfo.SysLanguage.LPT.ReadString("ucChartPara", "cboChartType_Text_3", "水平方块图");
btnChartColumn3D.Label = "3D " + GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChartColumn", "垂直柱状图");
btnChartBar3D.Label = "3D " + GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChartBar", "水平柱状图");
btnChartPie3D.Label = "3D " + GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnChartPie", "饼图");
btnTime.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnTime", "计时器");
btnDueCount.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnDueCount", "应到人数");
btnSignedCount.Label = GlobalInfo.SysLanguage.LPT.ReadString("PPTOper", "SIGNED", "实到人数");//杨斌 2018-12-25
btnNotSignedCount.Label = GlobalInfo.SysLanguage.LPT.ReadString("PPTOper", "NOTSIGNED", "未到人数");//杨斌 2019-01-14
btnVotingMissSigned.Label = GlobalInfo.SysLanguage.LPT.ReadString("PPTOper", "VotingMissSigned", "已到未按人数");//杨斌 2019-01-14
menuVotedCount.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuVoteCount", "反馈人数");
btnVoterCount.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnVoterCount", "参与人数");
btnVotedCountNum.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnVoteCountNum", "数字");
btnVotedCountRate.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnVoteCountRate", "百分比");
btnVotedCountNumRate.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnVoteCountNumRate", "数字+百分比");
btnMean.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnMean", "平均值");//杨斌 2014-04-16
btnVoteCount.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnVoteCount", "投票人数和选项人数");//杨斌 2016-11-12
btnGradeAvg.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGradeAvg", "评议平均分");//杨斌 2019-06-27
//杨斌 2018-07-25
menuVotedCountMen.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuVoteCountMen", "反馈人数(不算权重)");
btnVotedCountNumMen.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnVoteCountNum", "数字");
btnVotedCountRateMen.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnVoteCountRate", "百分比");
btnVotedCountNumRateMen.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnVoteCountNumRate", "数字+百分比");
//杨斌 2016-03-29
btnMedian.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnMedian", "中间值");//杨斌 2016-03-29
btnRange.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnRange", "选择范围");//杨斌 2016-03-29
btnVoterDetailPV.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnVoterDetailPV", "个人反馈明细");//杨斌 2016-03-29
//杨斌 2015-04-30
menuNoVoteCount.Label = GlobalInfo.SysLanguage.LPT.ReadString("PPTOper", "VotingMiss", "未按人数");
btnNoVoteCountNum.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnVoteCountNum", "数字");
btnNoVoteCountRate.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnVoteCountRate", "百分比");
btnNoVoteCountNumRate.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnVoteCountNumRate", "数字+百分比");
menuCorrectAnswer.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuCorrectAnswer", "正确答案");//杨斌 2015-01-26
btnCorrectAnswer.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnCorrectAnswer", "正确答案");
//杨斌 2015-01-22
btnCorrectShape.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnCorrectShape", "正确标记");
btnCorrectShapeFile.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnCorrectShapeFile", "正确标记图片...");
menuRigntCount.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuRigntCount", "答对人数");
btnRightCountNum.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnRightCountNum", "数字");
btnRightCountRate.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnRightCountRate", "百分比");
btnRightCountNumRate.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnRightCountNumRate", "数字+百分比");
btnScoreJudge.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnScoreJudge", "评委分");
btnScoreAvg.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnScoreAvg", "评分平均分");
btnScoreSum.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnScoreSum", "评分总分");
spbtnClearData.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "spbtnClearData", "清除数据 ").Replace(',', ' '); ;
spbtnClearData.ScreenTip = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "spbtnClearData_Tip", "清除反馈数据,单击清除当前幻灯片数据");
btnClearCurrent.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnClearCurrent", "当前幻灯片");
btnClearAll.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnClearAll", "所有幻灯片");
tgbShowPanel.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "Hide", " 隐藏") + "\r\n" + GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "Panel", "设置面板");
tgbShowPanel.ScreenTip = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "tgbShowPanel_Tip", "隐藏参数面板");
btnSetVoterCount.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnSetVoterCount", "键盘个数-硬件");
menuVoter.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuVoter", "人员名单 ").Replace(',', ' ');
menuVoter.ScreenTip = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuVoter_Tip", "参与者相关设置");
btnVoterImport.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnVoterImport", "导入名单");
btnVoterImportSQLServer.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnVoterImportSQLServer", "导入名单(从SQL Server)");//杨斌 2018-07-02
btnVoterExport.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnVoterExport", "导出名单");
btnVoterView.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnVoterView", "查看名单");
chkVoterEnabled.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "chkVoterEnabled", "启用名单");
menuAnalyze.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuAnalyze", "数据分析 ").Replace(',', ' ');
menuAnalyze.ScreenTip = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuAnalyze_Tip", "导出Excel报表");
btnRateCorrect.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnRateCorrect", "答题正确率");
btnRateOption.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnRateOption", "选项选择率");
btnAnalyzeSlideOption.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnAnalyzeSlideOption", "多题分项对比");
btnAnalyzeSlideCross.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnAnalyzeSlideCross", "二题交叉对比");
btnAnalyzeSlideGroup.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnAnalyzeSlideGroup", "答题分组对比");
btnRankVoter.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnRankVoter", "人员排行");
btnRankGroup.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnRankGroup", "分组排行");
btnRankScore.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnRankScore", "评分排行");
btnRankPoll.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnRankPoll", "选举排行");
btnScoreRank.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnScoreRank", "竞价排行");//需翻译
//杨斌 2014-08-11
btnRankChartVoter.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnRankVoter", "人员排行");
btnRankChartGroup.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnRankGroup", "分组排行");
//杨斌 2019-05-29
btnGradeColor.Label = GlobalInfo.SysLanguage.LPT.ReadString("FrmAnalyzeGradeColor", "FrmAnalyzeGradeColor", "评议颜色矩阵");//需翻译
//杨斌 2014-12-12
btnSlideCompChart.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnSlideCompChart", "对比分析");
//杨斌 2017-01-18
btnSlideCompGroup.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnAnalyzeSlideGroup", "分组对比");
menuReport.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuReport", "报表 ").Replace(',', ' ');
menuReport.ScreenTip = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "menuReport_Tip", "导出Excel报表");
btnVoterDetail.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnVoterDetail", "人员按键明细");
btnSlideResult.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnSlideResult", "反馈题目结果");
//杨斌 2014-07-24
btnReportCorrectRate.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnReportCorrectRate", "答题正确率");
//杨斌 2014-11-03
btnReportQuestion.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnReportQuestion", "按题目分析");
btnReportVoter.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnReportVoter", "按人员分析");
btnReportVoterDetail.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnReportVoterDetail", "按人员详细分析");
//杨斌 2019-08-20
btnReportVoterDetailPerson.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnReportVoterDetailPerson", "按人员分析(个体)");
btnReportScore.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnReportScore", "个人成绩与答题明细");
btnReportScore2.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnReportScore2", btnReportScore.Label + "2");
//杨斌 2017-06-06
btnVoteResult.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnVoteResult", "表决结果");
//杨斌 2017-06-07
btnCompVote.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnCompVote", "YNA Result");
//杨斌 2018-07-24
btnVotePassResult.Label = GlobalInfo.SysLanguage.LPT.ReadString("PanelVote", "VotePassResult", "表决通过结果");
//杨斌 2016-09-30
btnGroupSurvey.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGroupSurvey", "Group Survey");
//杨斌 2019-06-11
btnGradeScoreReport.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnGradeScoreReport", "Grade Score");
//杨斌 2016-12-26
btnResultDetailPic.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnResultDetailPic", "Voter Details");
btnResultDetailPicPDF.Label = btnResultDetailPic.Label + "(PDF)";
//杨斌 2015-08-14
btnReportQuestionPDF.Label = btnReportQuestion.Label + "(PDF)";
btnReportVoterPDF.Label = btnReportVoter.Label + "(PDF)";
btnReportScorePDF.Label = btnReportScore.Label + "(PDF)";
btnReportVoterDetailPersonPDF.Label = btnReportVoterDetailPerson.Label + "(PDF)";
//杨斌 2016-01-12
btnSelectCountDetail.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnSelectCountDetail", "总得分(按选项次数)");
btnSelectCountVoter.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnSelectCountVoter", "个人成绩(按选项次数)");
//杨斌 2016-05-25
btnSynthesis.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnSynthesis", btnSynthesis.Label);
btnDataExport.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnDataExport", "备 份 ").Replace(',', ' ');
btnDataImport.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnDataImport", "还 原 ").Replace(',', ' ');
btnUpload.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnUpload", "数据上传 ").Replace(',', ' ');//杨斌 2014-07-07
btnUploadWoAHui.Label = btnUpload.Label;//杨斌 2019-03-30
btnSystemSet.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnSystemSet", "系统设置 ").Replace(',', ' ');
btnSystemSet.ScreenTip = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnSystemSet_Tip", "系统设置");
btnHelp.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnHelp", "帮助 ").Replace(',', ' ');
btnHelp.ScreenTip = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnHelp_Tip", "打开帮助文档");
btnAbout.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnAbout", "关于 ").Replace(',', ' ');
btnAbout.ScreenTip = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnAbout_Tip", "关于");
////btnAbout.ScreenTip = GlobalInfo.SysLanguage.LPT.ReadString("Other", "ToClosePresenter", "Office 2010及以上版本在开启投票前,请先取消“使用演示者视图”勾选,否则会影响投票。");
btnVoteDetail.Label = GlobalInfo.SysLanguage.LPT.ReadString("FrmVoteDetail", "FrmVoteDetail", "按键明细");
//杨斌 2015-07-22
btnOperatorSlide.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnOperatorSlide", "操作员幻灯片");
//杨斌 2017-12-08
grpNetMeet.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "grpNetMeet", "Net Meeting");
btnStartSever.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnStartSever", "Meeting Server");
//杨斌 2017-12-18
grpFTPServer.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "grpFTPServer", "FTP Server");
btnFTPSet.Label = GlobalInfo.SysLanguage.LPT.ReadString("rbSunVoteARS", "btnFTPSet", "New Exam");
InitLogo();//杨斌 2012-05-15
}
catch (Exception ex)
{
SystemLog.WriterLog(ex);
}
}
/// <summary>
/// 是否启用帮助按钮
/// 创建:杨斌 2013-03-29
/// </summary>
private bool EnabledHelp = true;
/// <summary>
/// 初始化Logo(OEM)
/// 创建:杨斌 2012-05-15
/// 修改:杨斌 2012-06-11
/// </summary>
private void InitLogo()
{
tabSunVoteARS.Label = GlobalInfo.GetAppTitle();//杨斌 2012-11-13
btnHelp.Visible = btnHelp.Enabled = EnabledHelp;//杨斌 2020-06-23
btnUpload.Visible = false;//杨斌 2014-07-07
if (GlobalInfo.OEMLogo != OEMLogos.SunVote)
{
btnText.Visible = false;
}
btnInport2.Visible = false;//杨斌 2015-08-17
btnVoterDetailPV.Visible = false;//杨斌 2016-03-29
btnMedian.Visible = false;//开放此功能。杨斌 2020-05-08
btnRange.Visible = false;//开放此功能。杨斌 2020-05-08
btnReportScore2.Visible = false;//杨斌 2016-05-03
btnSynthesis.Visible = false;//杨斌 2016-05-19
btnVoteDetail.Visible = false;//杨斌 2016-12-05
btnVoteResult.Visible = false;//杨斌 2017-05-05
btnSlideResult.Visible = false;
btnVoterDetail.Visible = false;
//杨斌 2016-09-30
string ReportDirTemp = GlobalInfo.APP_DIR + @"\Resources\Template\";
string ReportFileTemp = ReportDirTemp + "GroupSurvey.xlsx";
btnGroupSurvey.Visible = File.Exists(ReportFileTemp)
&& (GlobalInfo.SysLanguage.LanguageName.ToLower().IndexOf("Chinese".ToLower()) >= 0);//杨斌 2016-12-15
btnResultDetailPic.Visible = btnResultDetailPicPDF.Visible = false;
btnSlideCompGroup.Visible = APanel.BeEnabledSlideCompGroup;//分组对比图表实现。杨斌 2017-02-17
btnCompVote.Visible = false;//杨斌 2017-06-07
btnScoreRank.Visible = false;
//杨斌 2020-10-16
grpAdminErr.Visible = false;
grpHardware.Visible = true;
grpPPTEdit.Visible = true;
grpVoter.Visible = true;
grpReport.Visible = true;
grpData.Visible = true;
grpSystem.Visible = true;
grpFTPServer.Visible = false;//杨斌 2017-12-28
grpNetMeet.Visible = false;//杨斌 2017-12-28
btnVoterImportSQLServer.Visible = false;//杨斌 2018-06-28
btnUploadWoAHui.Visible = false;//杨斌 2019-03-30
btnGradeColor.Visible = false;//评议颜色矩阵。杨斌 2019-05-20
btnGradeScoreReport.Visible = false;//杨斌 2019-06-06
btnReportVoterDetailPerson.Visible = false;//杨斌 2019-08-20
btnReportVoterDetailPersonPDF.Visible = false;//杨斌 2020-01-10
switch (GlobalInfo.OEMLogo)
{
case OEMLogos.oem3eAnalyzer:
//系统设置
btnAbout.Visible = false;
btnHelp.Visible = false;
//硬件
btnKeypadType.Visible = false;
btnKeypadReplace.Visible = false;
btnChannelSet.Visible = false;
chkKeypadOffNever.Visible = false;
chkKeypadOffNever.Checked = false;
//插入幻灯片
menuJudge.Visible = false;
menuGrade.Visible = false;
//分组容器
foreach (RibbonGroup obj in tabSunVoteARS.Groups)
{
obj.Label = "";
}
break;
case OEMLogos.ZX:
btnHelp.Visible = false;//中性版开启Help目录?刘振中未下单。2019-11-28
btnAbout.Visible = false;
break;
case OEMLogos.oemCustom://杨斌 2020-06-23
string dir = GlobalInfo.APP_DIR + @"\Help\";
btnHelp.Visible = btnHelp.Enabled = EnabledHelp && Directory.Exists(dir);
break;
case OEMLogos.oemMyVote:
btnHelp.Visible = false;
break;
case OEMLogos.oemApaczaiKiado:
btnHelp.Visible = false;
break;
case OEMLogos.oemEasyTest://杨斌 2015-08-17
btnHelp.Visible = false;
btnInport2.Visible = false;//暂时屏蔽,需要时开放。杨斌 2015-09-23
//杨斌 2016-01-08
btnSelectCountDetail.Visible = true;
btnSelectCountVoter.Visible = true;
grpFTPServer.Visible = true;//杨斌 2017-12-28
grpFTPServer.Visible = false;//杨斌 2019-01-03
grpNetMeet.Visible = true;//杨斌 2018-12-17
btnReportVoterDetailPerson.Visible = true;//杨斌 2019-08-20
btnReportVoterDetailPersonPDF.Visible = true;//杨斌 2020-01-10
break;
case OEMLogos.oemXDServer://杨斌 2014-07-07
btnUpload.Visible = true;
break;
case OEMLogos.oemSmartVote://杨斌 2014-07-10
btnHelp.Visible = false;
break;
case OEMLogos.oemOptionMaker://杨斌 2015-07-22
btnOperatorSlide.Visible = true;
break;
case OEMLogos.oemPowerVote://杨斌 2016-02-23
case OEMLogos.oemAngage://杨斌 2018-03-22
btnHelp.Visible = true;
try
{
btnAbout.Image = Image.FromFile(GlobalInfo.APP_DIR + @"\Resources\Image\Ribbon\About2.png");
}
catch { }
btnSynthesis.Visible = true;//杨斌 2016-05-19
btnVoteDetail.Visible = true;//杨斌 2016-12-05
btnVoteResult.Visible = true;//杨斌 2017-05-05
if (GlobalInfo.OEMLogo2 == OEMLogos2.oemPowerVoteMRCQuiz)
{
btnVoterDetailPV.Visible = true;//杨斌 2016-03-29
btnMedian.Visible = true;
btnRange.Visible = true;
}
btnResultDetailPic.Visible = btnResultDetailPicPDF.Visible = true;
//if (GlobalInfo.OEMLogo2 == OEMLogos2.oemPowerVoteForORPI)//杨斌 2017-06-07
//{
// btnCompVote.Visible = true;
//}
//开放分股权投票功能。杨斌 2018-07-31。需搜索所有oemPowerVoteForORPI的修改
btnCompVote.Visible = true;
btnGradeColor.Visible = true;//评议颜色矩阵。杨斌 2019-05-20
break;
case OEMLogos.oemVoteExplorer:
btnSynthesis.Visible = true;//杨斌 2016-05-19
break;
case OEMLogos.oemiPericles:
btnHelp.Visible = true;
btnAbout.Visible = true;
btnVoteDetail.Visible = true;//杨斌 2019-05-14
break;
case OEMLogos.oemClickmaster:
btnHelp.Visible = false;
break;
case OEMLogos.SunVote:
//default:
//特殊版本,数据库上传到信德服务器
if (System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() == "1.2.8.9")
{
(separatorReport as RibbonControl).Visible = false;
btnReportCorrectRate.Visible = false;
btnReportScore.Visible = false;
}
if (GlobalInfo.OEMLogo2 == OEMLogos2.oemSunVoteOEMReportAddComment)
{
btnReportScore2.Visible = true;//杨斌 2016-05-03
//btnReportScore.Visible = false;
}
if (GlobalInfo.OEMLogo2 == OEMLogos2.oemSunVoteOldReportVoterDetail)
{
btnVoterDetail.Visible = true;//2017-04-11
}
if (GlobalInfo.OEMLogo2 == OEMLogos2.oemHBXK)
{
btnVoterImportSQLServer.Visible = true;//杨斌 2018-06-28
}
btnUploadWoAHui.Visible = (GlobalInfo.OEMLogo2 == OEMLogos2.oemWoAHuiUpload);//杨斌 2019-03-30
btnHelp.Visible = false;//杨斌 2014-10-16 刘红英提出隐藏
//杨斌 2017-03-23
btnHelp.Visible = btnHelp.Enabled = true;
grpNetMeet.Visible = true;//杨斌 2017-12-28
btnVoteResult.Visible = true;//杨斌 2019-05-21
//btnGradeScoreReport.Visible = true;//国防科大定制,标准版隐藏掉。2020-08-28
break;
case OEMLogos.oemBOAVC:
btnScoreRank.Visible = true;//杨斌 2017-09-21
btnSelectCountDetail.Visible = true;
break;
//case OEMLogos.oemWeVote:
// btnHelp.Visible = true;
// btnAbout.Visible = true;
// break;
default:
btnHelp.Visible = true;
btnAbout.Visible = true;
break;
}
separatorAnalyze4.Visible = btnGradeColor.Visible;//杨斌 2019-05-20
//杨斌 2020-03-06
if ((GlobalInfo.OEMLogo== OEMLogos.oemiPericles) && (GlobalInfo.OEMLogo2== OEMLogos2.oemHideData))
{
btnVoteDetail.Enabled = menuAnalyze.Enabled = menuReport.Enabled = false;
}
EnabledSlideResponseType();//杨斌 2017-08-18
}
/// <summary>
/// 键盘型号屏蔽不支持的功能。杨斌 2017-08-18
/// </summary>
public void EnabledSlideResponseType()
{
bool isOK = (GlobalInfo.hardwareManage.KeyModel != "S60");
menuNumber.Visible = isOK;
menuOrder.Visible = isOK;
btnText.Visible = isOK;
btnShowDownload.Visible = (GlobalInfo.hardwareManage.KeyModel == "E11");//杨斌 2019-12-09
}
private void tmrRefreshRibbon_Tick(object sender, EventArgs e)
{
if (Globals.SunVoteARSAddIn.IsExitApp)//杨斌 2015-11-10
return;
}
/// <summary>
/// 关于
/// 修改:杨斌 2012-05-15
/// </summary>
private void btnAbout_Click(object sender, RibbonControlEventArgs e)
{
switch (GlobalInfo.OEMLogo)
{
case OEMLogos.oemMyVote:
new FrmAboutUsMyVote().ShowDialog();
break;
case OEMLogos.oemApaczaiKiado:
new FrmAboutUsApaczaiKiado().ShowDialog();
break;
case OEMLogos.oemEasyTest://杨斌 2013-05-03
new FrmAboutEasyTest().ShowDialog();
break;
case OEMLogos.oemRealVote://杨斌 2015-01-21
new FrmAboutUsRealVote().ShowDialog();
break;
case OEMLogos.oemCustomVote://杨斌 2015-01-26
new FrmAboutCustomVote().ShowDialog();
break;
case OEMLogos.oemPowerVote://杨斌 2015-11-02
new FrmAboutPowerVote().ShowDialog();
break;
case OEMLogos.oemAngage://杨斌 2018-03-22
new FrmAboutAngage().ShowDialog();
break;
case OEMLogos.oemSmartVote://杨斌 2016-01-25
new FrmAboutSmartVote().ShowDialog();
break;
case OEMLogos.oemiPericles://杨斌 2016-04-28
new FrmAboutIPericles().ShowDialog();
break;
case OEMLogos.oemClickmaster://杨斌 2016-09-20
new FrmAboutClickmaster().ShowDialog();
break;
case OEMLogos.oemShoutPoll://杨斌 2016-12-16
new FrmAboutShoutPoll().ShowDialog();
break;
case OEMLogos.oemSolutionsBox://杨斌 2017-03-17
new FrmAboutSolutionsBox().ShowDialog();
break;
case OEMLogos.oemBOAVC:
new FrmAboutBOAVC().ShowDialog();
break;
case OEMLogos.oemMinistr:
new FrmAboutMinistr().ShowDialog();
break;
case OEMLogos.oemKlickrQuiz:
new FrmAboutKlickr().ShowDialog();
break;
case OEMLogos.oemDrawViewVote:
new FrmAboutDrawViewVote().ShowDialog();
break;
case OEMLogos.oemWeVote:
new FrmAboutIWeVote().ShowDialog();
break;
case OEMLogos.oemVoteExplorer:
new FrmAboutVoteExplorer().ShowDialog();
break;
case OEMLogos.oemQResponse:
new FrmAboutQResponse().ShowDialog();
break;
case OEMLogos.oemCustom:
new FrmAboutAny().ShowDialog();
break;
case OEMLogos.SunVote:
default:
new FrmAboutUs().ShowDialog();
break;
}
FrmVoteBar.ActivateSlideShowWindow();
}
[DllImport("shell32.dll")]
private static extern int ShellExecute(int hwnd, String lpszOp, String lpszFile, String lpszParams, String lpszDir, int FsShowCmd);
private void btnHelp_Click(object sender, RibbonControlEventArgs e)
{
//杨斌 2018-03-07
string file = "";
if (GlobalInfo.OEMLogo == OEMLogos.oemVoteExplorer)
file = GlobalInfo.APP_DIR + @"\Help\help.html";
//杨斌 2018-07-13
string dir = GlobalInfo.APP_DIR + @"\Help\";//杨斌 2019-11-28
//switch (GlobalInfo.OEMLogo)//杨斌 2018-08-22
//{
// case OEMLogos.SunVote:
// case OEMLogos.oemAngage:
// case OEMLogos.oemiPericles://杨斌 2019-05-17
// dir = GlobalInfo.APP_DIR + @"\Help\";
// break;
//}
if (File.Exists(file))
{
try
{
ShellExecute(0, "", file, "", "", 1);
}
catch (Exception ex)
{
SystemLog.WriterLog(ex);
}
}
else if (Directory.Exists(dir))//杨斌 2018-07-13
{
try
{
ShellExecute(0, "", dir, "", "", 1);
}
catch (Exception ex)
{
SystemLog.WriterLog(ex);
}
}
else
{
//杨斌 2017-03-23
MessageBox.Show(GlobalInfo.SysLanguage.LPT.ReadString("Other", "ToClosePresenter", "Office 2010及以上版本在开启投票前,请先取消“使用演示者视图”勾选,否则会影响投票。"));
}
}
//插入对象-图表 杨斌 2012-03-22
private void btnChart_Click(object sender, RibbonControlEventArgs e)
{
//Tag值0-5,ucChartPara的控件和事件public
//2012-11-09 添加图表
TagSet tagSet = new TagSet();
tagSet.Tags = Globals.SunVoteARSAddIn.PPTEdit.SlideEdit.Tags;
tagSet.SetValue(TagKey.IsExistChart, true);
RibbonButton btn = (RibbonButton)sender;
int i = ConvertOper.Convert(btn.Tag.ToString()).ToInt;
bool is3D = (i > 4);
if (i > 4) i = i - 5;
if (Globals.SunVoteARSAddIn.PPTEdit.Panel.ucChartPara.cboChartType.SelectedIndex == i)
Globals.SunVoteARSAddIn.PPTEdit.Panel.ucChartPara.cboChartType_SelectedIndexChanged(null, null);
else
Globals.SunVoteARSAddIn.PPTEdit.Panel.ucChartPara.cboChartType.SelectedIndex = i;
if (Globals.SunVoteARSAddIn.PPTEdit.Panel.ucChartPara.chk3D.Checked != is3D)
{
Globals.SunVoteARSAddIn.PPTEdit.Panel.ucChartPara.chk3D_CheckedChanged(null, null);
Globals.SunVoteARSAddIn.PPTEdit.Panel.ucChartPara.chk3D.Checked = is3D;
}
}
//插入对象-计时器 杨斌 2012-03-13
private void btnTime_Click(object sender, RibbonControlEventArgs e)
{
//杨斌 2018-06-22
foreach (Shape v in Globals.SunVoteARSAddIn.PPTEdit.SlideEdit.Shapes)
{
if (v.Name == "TIMER")
{
v.Select();
return;
}
}
Shape sha = PPTOper.MenuInsertDataTab(0, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
if (sha != null) sha.Select(Microsoft.Office.Core.MsoTriState.msoTrue);
}
//插入对象-应到人数 杨斌 2012-03-13
private void btnDueCount_Click(object sender, RibbonControlEventArgs e)
{
Shape sha = PPTOper.MenuInsertDataTab(1, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.DUENO);
if (sha != null) sha.Select(Microsoft.Office.Core.MsoTriState.msoTrue);
}
//插入对象-实到人数 杨斌 2018-12-20
private void btnSignedCount_Click(object sender, RibbonControlEventArgs e)
{
Shape sha = PPTOper.MenuInsertDataTab(26, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.SIGNED);
if (sha != null) sha.Select(Microsoft.Office.Core.MsoTriState.msoTrue);
}
//未到人数。杨斌 2019-01-14
private void btnNotSignedCount_Click(object sender, RibbonControlEventArgs e)
{
Shape sha = PPTOper.MenuInsertDataTab(27, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.NOTSIGNED);
if (sha != null) sha.Select(Microsoft.Office.Core.MsoTriState.msoTrue);
}
//已到未按人数。杨斌 2019-01-14
private void btnVotingMissSigned_Click(object sender, RibbonControlEventArgs e)
{
Shape sha = PPTOper.MenuInsertDataTab(28, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.VotingMissSigned);
if (sha != null) sha.Select(Microsoft.Office.Core.MsoTriState.msoTrue);
}
//插入对象-参与人数(带权重) 杨斌 2012-03-13
private void btnVoterCount_Click(object sender, RibbonControlEventArgs e)
{
Shape sha = PPTOper.MenuInsertDataTab(11, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.PARTICIPATE);
if (sha != null) sha.Select(Microsoft.Office.Core.MsoTriState.msoTrue);
}
//插入对象-反馈人数(不带权重) 杨斌 2018-07-25
private void btnVotedCountMen_Click(object sender, RibbonControlEventArgs e)
{
RibbonButton btn = (RibbonButton)sender;
Shape sha = null;
switch (btn.Name)
{
case "btnVotedCountNumMen":
sha = PPTOper.MenuInsertDataTab(23, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.VOTENO_Men);
break;
case "btnVotedCountRateMen":
sha = PPTOper.MenuInsertDataTab(24, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.VOTENOP_Men);
break;
case "btnVotedCountNumRateMen":
sha = PPTOper.MenuInsertDataTab(25, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.VOTENOPV_Men);
break;
}
if (sha != null) sha.Select(Microsoft.Office.Core.MsoTriState.msoTrue);
}
//插入对象-反馈人数(带权重) 杨斌 2012-03-13
private void btnVotedCount_Click(object sender, RibbonControlEventArgs e)
{
RibbonButton btn = (RibbonButton)sender;
Shape sha = null;
switch (btn.Name)
{
case "btnVotedCountNum":
sha = PPTOper.MenuInsertDataTab(2, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.VOTENO);
break;
case "btnVotedCountRate":
sha = PPTOper.MenuInsertDataTab(7, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.VOTENOP);
break;
case "btnVotedCountNumRate":
sha = PPTOper.MenuInsertDataTab(8, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.VOTENOPV);
break;
}
if (sha != null) sha.Select(Microsoft.Office.Core.MsoTriState.msoTrue);
}
//插入对象-未按人数(带权重)
private void btnNoVoteCount_Click(object sender, RibbonControlEventArgs e)
{
RibbonButton btn = (RibbonButton)sender;
Shape sha = null;
switch (btn.Name)
{
case "btnNoVoteCountNum":
sha = PPTOper.MenuInsertDataTab(13, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.VOTEMiss);
break;
case "btnNoVoteCountRate":
sha = PPTOper.MenuInsertDataTab(14, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.VOTEMissP);
break;
case "btnNoVoteCountNumRate":
sha = PPTOper.MenuInsertDataTab(15, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.VOTEMissPV);
break;
}
if (sha != null) sha.Select(Microsoft.Office.Core.MsoTriState.msoTrue);
}
/// <summary>
/// 不计算权重的反馈人数和选项数(表格显示),PowerVote定制。杨斌 2016-11-11
/// 英文:voters in number
/// </summary>
private void btnVoteCount_Click(object sender, RibbonControlEventArgs e)
{
Globals.SunVoteARSAddIn.PPTEdit.InitChart(true, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit, false, true);
}
//插入对象-平均值 杨斌 2014-04-14
private void btnMean_Click(object sender, RibbonControlEventArgs e)
{
Shape sha = PPTOper.MenuInsertDataTab(12, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.VOTEMEAN);
}
/// <summary>
/// 插入对象-评议平均分。杨斌 2019-06-27
/// </summary>
private void btnGradeAvg_Click(object sender, RibbonControlEventArgs e)
{
Shape sha = PPTOper.MenuInsertDataTab(29, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.GradeAvg);
}
//插入对象-正确答案 杨斌 2012-03-13
private void btnCorrectAnswer_Click(object sender, RibbonControlEventArgs e)
{
Shape sha = PPTOper.MenuInsertDataTab(3, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.ANSWER);
if (sha != null) sha.Select(Microsoft.Office.Core.MsoTriState.msoTrue);
}
//插入对象-正确答案标记 杨斌 2015-01-22
private void btnCorrectShape_Click(object sender, RibbonControlEventArgs e)
{
Slide sld = Globals.SunVoteARSAddIn.PPTEdit.SlideEdit;
PPTOper.SetCorrectShape(sld, true, btnCorrectShape.Image);
}
//插入对象-正确答案标记文件 杨斌 2015-01-22
private void btnCorrectShapeFile_Click(object sender, RibbonControlEventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.InitialDirectory = GlobalInfo.APP_DIR + @"\Resources\Image\Shaps";
dlg.Filter = "Png(*.png)|*.png";
if (dlg.ShowDialog() == DialogResult.OK)
{
string path = dlg.FileName;
if (SetCorrectShape(path))
btnCorrectShape_Click(null, null);
}
}
/// <summary>
/// 设置插入对象-正确答案标记文件
/// 杨斌 2015-01-22
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
private bool SetCorrectShape(string path)
{
bool res = false;
if (File.Exists(path))
{
btnCorrectShape.Image = Image.FromFile(path);
string file = path;
if (Path.GetDirectoryName(path).ToLower() == (GlobalInfo.APP_DIR + @"\Resources\Image\Shaps").ToLower())
file = Path.GetFileName(path);
GlobalInfo.sysConfig.CorrectShape = file;
GlobalInfo.sysConfig.WriteSysConfig("System", "CorrectShape", GlobalInfo.sysConfig.CorrectShape);
res = true;
}
return res;
}
private void LoadCorrectShape()
{
try
{
string path = "";
if (GlobalInfo.sysConfig.CorrectShape.IndexOf(':') > 0)
path = GlobalInfo.sysConfig.CorrectShape;
else
path = GlobalInfo.APP_DIR + @"\Resources\Image\Shaps\" + GlobalInfo.sysConfig.CorrectShape;
if (File.Exists(path))
{
//btnCorrectShape.Image = Image.FromFile(path);
//杨斌 2015-09-15
System.IO.FileStream fs = null;
fs = new System.IO.FileStream(path, System.IO.FileMode.Open, System.IO.FileAccess.Read);
btnCorrectShape.Image = System.Drawing.Image.FromStream(fs);
fs.Close();
}
}
catch { }
}
//插入对象-答对人数 杨斌 2012-03-13
private void btnRightCount_Click(object sender, RibbonControlEventArgs e)
{
RibbonButton btn = (RibbonButton)sender;
Shape sha = null;
switch (btn.Name)
{
case "btnRightCountNum":
sha = PPTOper.MenuInsertDataTab(4, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.CRRECTNO);
break;
case "btnRightCountRate":
sha = PPTOper.MenuInsertDataTab(9, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.CRRECTNOP);
break;
case "btnRightCountNumRate":
sha = PPTOper.MenuInsertDataTab(10, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.CRRECTNOPV);
break;
}
if (sha != null) sha.Select(Microsoft.Office.Core.MsoTriState.msoTrue);
}
//插入对象-评委分数 杨斌 2012-03-13
private void btnScoreJudge_Click(object sender, RibbonControlEventArgs e)
{
}
//插入对象-评分总分 杨斌 2012-03-13
private void btnScoreSum_Click(object sender, RibbonControlEventArgs e)
{
Shape sha = PPTOper.MenuInsertDataTab(5, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.SUMSCORE);
if (sha != null) sha.Select(Microsoft.Office.Core.MsoTriState.msoTrue);
}
//插入对象-评分平均分 杨斌 2012-03-13
private void btnScoreAvg_Click(object sender, RibbonControlEventArgs e)
{
Shape sha = PPTOper.MenuInsertDataTab(6, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.AVGSCORE);
if (sha != null) sha.Select(Microsoft.Office.Core.MsoTriState.msoTrue);
}
/// <summary>
/// 2012-10-17 增加选举排行
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnPollRank_Click(object sender, RibbonControlEventArgs e)
{
//bool bResult=false;
//foreach (Shape s in Globals.SunVoteARSAddIn.PPTEdit.SlideEdit.Shapes)
//{
// if (s.Name == "PollRank")
// bResult = true;
//}
//if(!bResult)
// PPTOper.AddRankTable(Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
}
private void btnInport_Click(object sender, RibbonControlEventArgs e)
{
FrmProgress frmPro = null;
try
{
Presentation pres = Globals.SunVoteARSAddIn.Application.ActivePresentation;
if (pres == null) return;
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.InitialDirectory = new DirectoryInfo(GlobalInfo.GetAppWorkDir()).Parent.FullName;
//openFileDialog.Filter = "Excel(*.xls;*.xlsx)|*.xls;*.xlsx";
openFileDialog.Filter = "Excel(*.xlsx)|*.xlsx";//杨斌 2018-12-18。不兼容2003格式
if (openFileDialog.ShowDialog() != DialogResult.OK)
return;
string fileName = openFileDialog.FileName;
if (!File.Exists(fileName))
return;
frmPro = new FrmProgress();
frmPro.Show();
ExcelOper exl = new ExcelOper();
exl.OpenExcel(fileName);
string[,] aryTable = exl.ImportToSheetBySheetNum(1);
exl.CloseExcel();
int count = aryTable.GetUpperBound(0);
int colCountIndex = aryTable.GetUpperBound(1);
if (count > 0)
{
Slide sldAdd = null;
TagSet tagSet = null;
frmPro.proBar.Maximum = count;
frmPro.proBar.Value = 0;
for (int i = 1; i <= count; i++)
{
Globals.SunVoteARSAddIn.PPTEdit.EditSelOK = false;
string title = aryTable[i, 0];
int tmType = ConvertOper.Convert(aryTable[i, 2]).ToInt;
string optionStr = aryTable[i, 1];
string[] optText = optionStr.Split(new string[] { "\n" }, StringSplitOptions.RemoveEmptyEntries);
string optionText = "";
int scoreMode = 0;
string correctAsw = "";
string scoreStr = aryTable[i, 5];
int scoreInt = 0;
string[] ary = null;
int timerSec = 0;
if (colCountIndex >= 6)
timerSec = ConvertOper.Convert(aryTable[i, 6]).ToInt;//倒计时。杨斌 2019-03-28
string sTimerValue = Response.GetTimerValue(timerSec.ToString());
//处理选项编号
bool isABC = false;
if ((optionStr.Length > 0) && (optText[0].Length > 0))
{
string firstS = optText[0][0].ToString();
switch (firstS)
{
case "A":
case "a":
isABC = true;
for (int n = 0; n < optText.Length; n++)
{
optText[n] = optText[n].Substring(2);
}
break;
case "1":
isABC = false;
for (int n = 0; n < optText.Length; n++)
{
optText[n] = optText[n].Substring(2);
}
break;
default:
isABC = false;
break;
}
}
InsertSlideInfo.TitleText = title;
switch (tmType)
{
case 1://选择
InsertSlideInfo.ResponseType = ResponseType.Choice;
//选项个数
InsertSlideInfo.OptionCount = optText.Length;
InsertSlideInfo.OptionText = optText;
InsertSlideInfo.OptionLimit = ConvertOper.Convert(aryTable[i, 3]).ToInt;
//Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
//while (!Globals.SunVoteARSAddIn.PPTEdit.EditSelOK)
//{
// System.Windows.Forms.Application.DoEvents();
//}
//插入幻灯片
sldAdd = pres.Slides.Add(pres.Slides.Count + 1, PpSlideLayout.ppLayoutTitleOnly);
PPTOper.SetSlideTitle(sldAdd, title);//设置标题
sldAdd.Select();
tagSet = new TagSet(sldAdd.Tags);
//插入选项文本
tagSet.SetValue(TagKey.KeypadPara_OptionMode, isABC ? 1 : 0);
optionText = PPTOper.FormatShapeOptionText(optText);
PPTOper.AddShapeOptionText(sldAdd, optionText, isABC);
//图表位置与参数,选项个数,数据标签
Globals.SunVoteARSAddIn.PPTEdit.InitSlideEdit(sldAdd);
//插入图表
Globals.SunVoteARSAddIn.PPTEdit.InitChart(true, sldAdd, autoFit: true);
//得分格式
ary = scoreStr.Split(new char[] { '/' });
if (ary.Length > 1)
{
scoreMode = 1;
tagSet.SetValue(TagKey.Choice_ScoreMode, scoreMode);
List<string> lstScore = new List<string>();
for (int n = 0; n < ary.Length; n++)
{
lstScore.Add((n + 1).ToString() + "=" + ary[n]);
}
//杨斌 2019-07-19
tagSet.SetValue(TagKey.Choice_ScoreOption, string.Join(PublicFunction.SplitItemScore.ToString(), lstScore.ToArray()));
}
else
{
scoreMode = 0;
tagSet.SetValue(TagKey.Choice_ScoreMode, scoreMode);
scoreInt = ConvertOper.Convert(scoreStr).ToInt;
tagSet.SetValue(TagKey.Choice_ScoreRight, scoreInt);
}
//正确答案
correctAsw = PanelOrder.GetOrderCorrectAnswer(aryTable[i, 4]);
//正确答案格式
correctAsw = PPTOper.FormartABCNum(correctAsw);
if (scoreMode == 0)
tagSet.SetValue(TagKey.Choice_CorrectAnswer, correctAsw);
if (timerSec > 0)//杨斌 2019-03-29
{
Shape sha = PPTOper.MenuInsertDataTab(0, sldAdd);
tagSet.SetValue(TagKey.ResponseTimer, sTimerValue);
sha.TextFrame.TextRange.Text = sTimerValue;
}
break;
case 2://判断
InsertSlideInfo.ResponseType = ResponseType.Judge;
//选项个数
InsertSlideInfo.OptionCount = 2;
InsertSlideInfo.OptionText = new string[] { "", "" };
for (int n = 0; n < optText.Length; n++)
{
if (n >= 2) break;
InsertSlideInfo.OptionText[n] = optText[n];
}
InsertSlideInfo.OptionLimit = 1;
//插入幻灯片
sldAdd = pres.Slides.Add(pres.Slides.Count + 1, PpSlideLayout.ppLayoutTitleOnly);
PPTOper.SetSlideTitle(sldAdd, title);//设置标题
sldAdd.Select();
tagSet = new TagSet(sldAdd.Tags);
//插入选项文本
tagSet.SetValue(TagKey.KeypadPara_OptionMode, isABC ? 1 : 0);
optionText = PPTOper.FormatShapeOptionText(optText);
PPTOper.AddShapeOptionText(sldAdd, optionText, isABC);
//图表位置与参数,选项个数,数据标签
Globals.SunVoteARSAddIn.PPTEdit.InitSlideEdit(sldAdd);
//插入图表
Globals.SunVoteARSAddIn.PPTEdit.InitChart(true, sldAdd, autoFit: true);
//得分格式
ary = scoreStr.Split(new char[] { '/' });
if (ary.Length > 1)
{
scoreMode = 1;
//tagSet.SetValue(TagKey.Choice_ScoreMode, scoreMode);
tagSet.SetValue(TagKey.Judge_ScoreMode, scoreMode);//杨斌 2015-06-24
List<string> lstScore = new List<string>();
for (int n = 0; n < ary.Length; n++)
{
lstScore.Add((n + 1).ToString() + "=" + ary[n]);
}
//杨斌 2019-07-19
//tagSet.SetValue(TagKey.Choice_ScoreOption, string.Join(PublicFunction.SplitItemScore.ToString(), lstScore.ToArray()));
tagSet.SetValue(TagKey.Judge_ScoreOption, string.Join(PublicFunction.SplitItemScore.ToString(), lstScore.ToArray()));//杨斌 2015-06-24
}
else
{
scoreMode = 0;
//tagSet.SetValue(TagKey.Choice_ScoreMode, scoreMode);
tagSet.SetValue(TagKey.Judge_ScoreMode, scoreMode);//杨斌 2015-06-24
scoreInt = ConvertOper.Convert(scoreStr).ToInt;
//tagSet.SetValue(TagKey.Choice_ScoreRight, scoreInt);
tagSet.SetValue(TagKey.Judge_ScoreRight, scoreInt);//杨斌 2015-06-24
}
//正确答案
correctAsw = PanelOrder.GetOrderCorrectAnswer(aryTable[i, 4]);
//正确答案格式
correctAsw = PPTOper.FormartABCNum(correctAsw);
if (scoreMode == 0)
tagSet.SetValue(TagKey.Judge_CorrectAnswer, correctAsw);
if (timerSec > 0)//杨斌 2019-03-29
{
Shape sha = PPTOper.MenuInsertDataTab(0, sldAdd);
tagSet.SetValue(TagKey.ResponseTimer, sTimerValue);
sha.TextFrame.TextRange.Text = sTimerValue;
}
break;
case 3://排序
InsertSlideInfo.ResponseType = ResponseType.Order;
//选项个数
InsertSlideInfo.OptionCount = optText.Length;
InsertSlideInfo.OptionText = optText;
InsertSlideInfo.OptionLimit = InsertSlideInfo.OptionCount;
//插入幻灯片
sldAdd = pres.Slides.Add(pres.Slides.Count + 1, PpSlideLayout.ppLayoutTitleOnly);
PPTOper.SetSlideTitle(sldAdd, title);//设置标题
sldAdd.Select();
tagSet = new TagSet(sldAdd.Tags);
//插入选项文本
isABC = false;//排序题只能按1234
tagSet.SetValue(TagKey.KeypadPara_OptionMode, isABC ? 1 : 0);
optionText = PPTOper.FormatShapeOptionText(optText);
PPTOper.AddShapeOptionText(sldAdd, optionText, isABC);
//图表位置与参数,选项个数,数据标签
Globals.SunVoteARSAddIn.PPTEdit.InitSlideEdit(sldAdd);
//正确答案
correctAsw = PanelOrder.GetOrderCorrectAnswer(aryTable[i, 4]);
tagSet.SetValue(TagKey.Order_CorrectAnswer, correctAsw);
//得分
scoreInt = ConvertOper.Convert(scoreStr).ToInt;
tagSet.SetValue(TagKey.Order_ScoreRight, scoreInt);
if (timerSec > 0)//杨斌 2019-03-29
{
Shape sha = PPTOper.MenuInsertDataTab(0, sldAdd);
tagSet.SetValue(TagKey.ResponseTimer, sTimerValue);
sha.TextFrame.TextRange.Text = sTimerValue;
}
break;
case 4://数值
InsertSlideInfo.ResponseType = ResponseType.Number;
//插入幻灯片
sldAdd = pres.Slides.Add(pres.Slides.Count + 1, PpSlideLayout.ppLayoutTitleOnly);
PPTOper.SetSlideTitle(sldAdd, title);//设置标题
sldAdd.Select();
tagSet = new TagSet(sldAdd.Tags);
//图表位置与参数,选项个数,数据标签
Globals.SunVoteARSAddIn.PPTEdit.InitSlideEdit(sldAdd);
//正确答案
tagSet.SetValue(TagKey.Number_CorrectAnswer, aryTable[i, 4]);
//得分
scoreInt = ConvertOper.Convert(scoreStr).ToInt;
tagSet.SetValue(TagKey.Number_ScoreRight, scoreInt);
if (timerSec > 0)//杨斌 2019-03-29
{
Shape sha = PPTOper.MenuInsertDataTab(0, sldAdd);
tagSet.SetValue(TagKey.ResponseTimer, sTimerValue);
sha.TextFrame.TextRange.Text = sTimerValue;
}
break;
}
frmPro.proBar.Value = i;
frmPro.proBar.Refresh();
frmPro.Refresh();
System.Windows.Forms.Application.DoEvents();
}
}
frmPro.Close();
InsertSlideInfo.SlideMode = 0;
}
catch (Exception ex)
{
if ((frmPro != null) && (!frmPro.IsDisposed))
frmPro.Close();
SystemLog.WriterLog(ex);
}
}
private void btnUpload_Click(object sender, RibbonControlEventArgs e)
{
new FrmUploadServerXD().ShowDialog();
}
private void btnUploadWoAHui_Click(object sender, RibbonControlEventArgs e)
{
new FrmWoAHuiUpload().ShowDialog();
}
private void btnReportCorrectRate_Click(object sender, RibbonControlEventArgs e)
{
ResponseDB.UpdateSlideIndexToDB();
ReportEx.ExportReportCorrectRate();
}
/// <summary>
/// 按题目分析
/// 杨斌 2014-10-28
/// </summary>
private void btnReportQuestion_Click(object sender, RibbonControlEventArgs e)
{
ResponseDB.UpdateSlideIndexToDB();
ReportEx.ExportReportQuestion();
}
private void btnReportVoterDetail_Click(object sender, RibbonControlEventArgs e)
{
}
/// <summary>
/// 按人员分析
/// 杨斌 2014-10-28
/// </summary>
private void btnReportVoter_Click(object sender, RibbonControlEventArgs e)
{
ResponseDB.UpdateSlideIndexToDB();
ReportEx.ExportReportVoter();
}
private void btnReportVoterDetailPerson_Click(object sender, RibbonControlEventArgs e)
{
ResponseDB.UpdateSlideIndexToDB();
ReportEx.ExportReportVoter("", true);
}
private void btnReportVoterDetailPersonPDF_Click(object sender, RibbonControlEventArgs e)
{
FolderBrowserDialog folder = new FolderBrowserDialog();
if (folder.ShowDialog() != DialogResult.OK)
return;
string folderPath = folder.SelectedPath;
string dir = folderPath + @"\" + btnReportVoterDetailPerson.Label + @"\";
Directory.CreateDirectory(dir);
ResponseDB.UpdateSlideIndexToDB();
ReportEx.ExportReportVoter(dir, true, true);
}
/// <summary>
/// 个人成绩与答题明细
/// </summary>
private void btnReportScore_Click(object sender, RibbonControlEventArgs e)
{
ResponseDB.UpdateSlideIndexToDB();
ReportEx.ExportReportScore(GlobalInfo.response.ShowNameCol);
}
/// <summary>
/// 个人成绩与答题明细;新加坡HumanspherePte Ltd新增定制报表Polling Data Report Example
/// </summary>
private void btnReportScore2_Click(object sender, RibbonControlEventArgs e)
{
ReportEx.ExportReportScore2(GlobalInfo.response.ShowNameCol, "");
}
private void btnRankChartVoter_Click(object sender, RibbonControlEventArgs e)
{
RibbonButton btn = (RibbonButton)sender;
InsertSlideInfo.ResponseType = ResponseType.ScoreRankChart;
InsertSlideInfo.OptionCount = 3;
InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.ScoreRankChart);
Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.ScoreRankChart, InsertSlideInfo.OptionCount, 1);
Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
}
private void btnRankChartGroup_Click(object sender, RibbonControlEventArgs e)
{
RibbonButton btn = (RibbonButton)sender;
InsertSlideInfo.ResponseType = ResponseType.ScoreRankGroupChart;
InsertSlideInfo.OptionCount = 3;
InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.ScoreRankGroupChart);
Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.ScoreRankGroupChart, InsertSlideInfo.OptionCount, 1);
Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
}
private void btnSlideCompChart_Click(object sender, RibbonControlEventArgs e)
{
RibbonButton btn = (RibbonButton)sender;
InsertSlideInfo.ResponseType = ResponseType.SlideCompChart;
InsertSlideInfo.OptionCount = 3;
InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.SlideCompChart);
Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.SlideCompChart, InsertSlideInfo.OptionCount, 1);
Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
}
private void btnSlideCompGroup_Click(object sender, RibbonControlEventArgs e)
{
RibbonButton btn = (RibbonButton)sender;
InsertSlideInfo.ResponseType = ResponseType.SlideCompGroup;
InsertSlideInfo.OptionCount = 3;
InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.SlideCompGroup);
Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.SlideCompGroup, InsertSlideInfo.OptionCount, 1);
Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
}
private void btnRankChartGroupMVP_Click(object sender, RibbonControlEventArgs e)
{
RibbonButton btn = (RibbonButton)sender;
InsertSlideInfo.ResponseType = ResponseType.ScoreRankGroupMVP;
InsertSlideInfo.OptionCount = 3;
InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.ScoreRankGroupMVP);
Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.ScoreRankGroupMVP, InsertSlideInfo.OptionCount, 1);
Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
}
private void btnOperatorSlide_Click(object sender, RibbonControlEventArgs e)
{
InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.OperatorSlide);
Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.OperatorSlide, 0, 0);
Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
}
/// <summary>
/// 显示保存对话框
/// 杨斌 2015-08-13
/// </summary>
/// <param name="defFileName"></param>
/// <returns></returns>
private string ShowSavePDF(string defFileName)
{
string res = "";
SaveFileDialog d = new SaveFileDialog();
d.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
d.Filter = "(*.pdf)|*.pdf";
d.FileName = defFileName + ".pdf";
d.AddExtension = true;
d.OverwritePrompt = true;
d.ValidateNames = true;
DialogResult r = d.ShowDialog();
if (r == DialogResult.OK)
res = d.FileName;
return res;
}
private void btnReportQuestionPDF_Click(object sender, RibbonControlEventArgs e)
{
string path = ShowSavePDF(btnReportQuestion.Label);
if (path.Length < 1)
return;
ResponseDB.UpdateSlideIndexToDB();
ReportEx.ExportReportQuestion(path);
}
private void btnReportVoterPDF_Click(object sender, RibbonControlEventArgs e)
{
string path = ShowSavePDF(btnReportVoter.Label);
if (path.Length < 1)
return;
ResponseDB.UpdateSlideIndexToDB();
ReportEx.ExportReportVoter(path);
}
private void btnReportScorePDF_Click(object sender, RibbonControlEventArgs e)
{
string path = ShowSavePDF(btnReportScore.Label);
if (path.Length < 1)
return;
ResponseDB.UpdateSlideIndexToDB();
//if (GlobalInfo.OEMLogo2 == OEMLogos2.oemSunVoteOEMReportAddComment)
// ReportEx.ExportReportScore2(GlobalInfo.response.ShowNameCol, path);
//else
ReportEx.ExportReportScore(GlobalInfo.response.ShowNameCol, path);
}
/// <summary>
/// 导入题库,EasyTest定制模板
/// 杨斌 2015-08-17
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnInport2_Click(object sender, RibbonControlEventArgs e)
{
FrmProgress frmPro = null;
try
{
Presentation pres = Globals.SunVoteARSAddIn.Application.ActivePresentation;
if (pres == null) return;
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.InitialDirectory = new DirectoryInfo(GlobalInfo.GetAppWorkDir()).Parent.FullName;
//openFileDialog.Filter = "Excel(*.xls;*.xlsx)|*.xls;*.xlsx";
openFileDialog.Filter = "Excel(*.xlsx)|*.xlsx";//杨斌 2018-12-18。不兼容2003格式
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
string fileName = openFileDialog.FileName;
//杨斌 2015-08-17
List<int> lst = FrmImportSlideSelect.GetNumRange();
if (File.Exists(fileName) && (lst != null))
{
frmPro = new FrmProgress();
frmPro.Show();
ExcelOper exl = new ExcelOper();
exl.OpenExcel(fileName);
string[,] aryTable = exl.ImportToSheetBySheetNum(1);
exl.CloseExcel();
int count = aryTable.GetUpperBound(0);
int countCol = aryTable.GetUpperBound(1);
int colCountIndex = aryTable.GetUpperBound(1);
if ((count > 0) && (countCol >= 7))//杨斌 2015-08-18
{
Slide sldAdd = null;
TagSet tagSet = null;
frmPro.proBar.Maximum = count;
frmPro.proBar.Value = 0;
for (int i = 1; i <= count; i++)
{
Globals.SunVoteARSAddIn.PPTEdit.EditSelOK = false;
string sno = aryTable[i, 0];
if (lst.Count > 0)
{
int no = 0;
if (int.TryParse(sno, out no))
{
if (!lst.Contains(no))
continue;
}
else
continue;
}
string title = aryTable[i, 1];//杨斌 2015-08-17
int tmType = 1;//杨斌 2015-08-17。ConvertOper.Convert(aryTable[i, 2]).ToInt;
//杨斌 2015-08-18
//string optionStr = "";// aryTable[i, 1];
List<string> lstOpt = new List<string>();
for (int j = 2; j <= 5; j++)
{
string opt = aryTable[i, j];
if (!string.IsNullOrEmpty(opt))
{
lstOpt.Add(opt);
}
}
string[] optText = null;
if (lstOpt.Count > 0)
optText = lstOpt.ToArray();
string optionText = "";
int scoreMode = 0;
string correctAsw = "";
string scoreStr = aryTable[i, 5];
int scoreInt = 0;
string[] ary = null;
//处理选项编号
bool isABC = false;
if (optText != null)
{
string firstS = optText[0][0].ToString();
switch (firstS)
{
case "A":
case "a":
isABC = true;
for (int n = 0; n < optText.Length; n++)
{
optText[n] = optText[n].Substring(2);
}
break;
case "1":
isABC = false;
for (int n = 0; n < optText.Length; n++)
{
optText[n] = optText[n].Substring(2);
}
break;
default:
isABC = false;
break;
}
}
InsertSlideInfo.TitleText = title;
switch (tmType)
{
case 1://选择
InsertSlideInfo.ResponseType = ResponseType.Choice;
//选项个数
InsertSlideInfo.OptionCount = optText.Length;
InsertSlideInfo.OptionText = optText;
InsertSlideInfo.OptionLimit = 1;//杨斌 2015-08-17。ConvertOper.Convert(aryTable[i, 3]).ToInt;
//Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
//while (!Globals.SunVoteARSAddIn.PPTEdit.EditSelOK)
//{
// System.Windows.Forms.Application.DoEvents();
//}
//插入幻灯片
sldAdd = pres.Slides.Add(pres.Slides.Count + 1, PpSlideLayout.ppLayoutTitleOnly);
PPTOper.SetSlideTitle(sldAdd, title);//设置标题
sldAdd.Select();
tagSet = new TagSet(sldAdd.Tags);
//插入选项文本
tagSet.SetValue(TagKey.KeypadPara_OptionMode, isABC ? 1 : 0);
optionText = PPTOper.FormatShapeOptionText(optText);
PPTOper.AddShapeOptionText(sldAdd, optionText, isABC);
//图表位置与参数,选项个数,数据标签
Globals.SunVoteARSAddIn.PPTEdit.InitSlideEdit(sldAdd);
//插入图表
Globals.SunVoteARSAddIn.PPTEdit.InitChart(true, sldAdd, autoFit: true);
//得分
scoreStr = aryTable[i, 7];//杨斌 2015-08-17
//得分格式
ary = scoreStr.Split(new char[] { '/' });
if (ary.Length > 1)
{
scoreMode = 1;
tagSet.SetValue(TagKey.Choice_ScoreMode, scoreMode);
List<string> lstScore = new List<string>();
for (int n = 0; n < ary.Length; n++)
{
lstScore.Add((n + 1).ToString() + "=" + ary[n]);
}
//杨斌 2019-07-19
tagSet.SetValue(TagKey.Choice_ScoreOption, string.Join(PublicFunction.SplitItemScore.ToString(), lstScore.ToArray()));
}
else
{
scoreMode = 0;
tagSet.SetValue(TagKey.Choice_ScoreMode, scoreMode);
scoreInt = ConvertOper.Convert(scoreStr).ToInt;
tagSet.SetValue(TagKey.Choice_ScoreRight, scoreInt);
}
//正确答案
correctAsw = PanelOrder.GetOrderCorrectAnswer(aryTable[i, 6]);//杨斌 2015-08-17
//正确答案格式
correctAsw = PPTOper.FormartABCNum(correctAsw);
if (scoreMode == 0)
tagSet.SetValue(TagKey.Choice_CorrectAnswer, correctAsw);
int timerSec = 0;
if (colCountIndex >= 8)
timerSec = ConvertOper.Convert(aryTable[i, 8]).ToInt;//倒计时。杨斌 2019-03-28
string sTimerValue = Response.GetTimerValue(timerSec.ToString());
if (timerSec > 0)//杨斌 2019-03-29
{
Shape sha = PPTOper.MenuInsertDataTab(0, sldAdd);
tagSet.SetValue(TagKey.ResponseTimer, sTimerValue);
sha.TextFrame.TextRange.Text = sTimerValue;
}
break;
case 2://判断
InsertSlideInfo.ResponseType = ResponseType.Judge;
//选项个数
InsertSlideInfo.OptionCount = 2;
InsertSlideInfo.OptionText = new string[] { "", "" };
for (int n = 0; n < optText.Length; n++)
{
if (n >= 2) break;
InsertSlideInfo.OptionText[n] = optText[n];
}
InsertSlideInfo.OptionLimit = 1;
//插入幻灯片
sldAdd = pres.Slides.Add(pres.Slides.Count + 1, PpSlideLayout.ppLayoutTitleOnly);
PPTOper.SetSlideTitle(sldAdd, title);//设置标题
sldAdd.Select();
tagSet = new TagSet(sldAdd.Tags);
//插入选项文本
tagSet.SetValue(TagKey.KeypadPara_OptionMode, isABC ? 1 : 0);
optionText = PPTOper.FormatShapeOptionText(optText);
PPTOper.AddShapeOptionText(sldAdd, optionText, isABC);
//图表位置与参数,选项个数,数据标签
Globals.SunVoteARSAddIn.PPTEdit.InitSlideEdit(sldAdd);
//插入图表
Globals.SunVoteARSAddIn.PPTEdit.InitChart(true, sldAdd, autoFit: true);
//得分
scoreStr = aryTable[i, 5];
//得分格式
ary = scoreStr.Split(new char[] { '/' });
if (ary.Length > 1)
{
scoreMode = 1;
//tagSet.SetValue(TagKey.Choice_ScoreMode, scoreMode);
tagSet.SetValue(TagKey.Judge_ScoreMode, scoreMode);//杨斌 2015-06-24
List<string> lstScore = new List<string>();
for (int n = 0; n < ary.Length; n++)
{
lstScore.Add((n + 1).ToString() + "=" + ary[n]);
}
//杨斌 2019-07-19
//tagSet.SetValue(TagKey.Choice_ScoreOption, string.Join(PublicFunction.SplitItemScore.ToString(), lstScore.ToArray()));
tagSet.SetValue(TagKey.Judge_ScoreOption, string.Join(PublicFunction.SplitItemScore.ToString(), lstScore.ToArray()));//杨斌 2015-06-24
}
else
{
scoreMode = 0;
//tagSet.SetValue(TagKey.Choice_ScoreMode, scoreMode);
tagSet.SetValue(TagKey.Judge_ScoreMode, scoreMode);//杨斌 2015-06-24
scoreInt = ConvertOper.Convert(scoreStr).ToInt;
//tagSet.SetValue(TagKey.Choice_ScoreRight, scoreInt);
tagSet.SetValue(TagKey.Judge_ScoreRight, scoreInt);//杨斌 2015-06-24
}
//正确答案
correctAsw = PanelOrder.GetOrderCorrectAnswer(aryTable[i, 4]);
//正确答案格式
correctAsw = PPTOper.FormartABCNum(correctAsw);
if (scoreMode == 0)
tagSet.SetValue(TagKey.Judge_CorrectAnswer, correctAsw);
break;
case 3://排序
InsertSlideInfo.ResponseType = ResponseType.Order;
//选项个数
InsertSlideInfo.OptionCount = optText.Length;
InsertSlideInfo.OptionText = optText;
InsertSlideInfo.OptionLimit = InsertSlideInfo.OptionCount;
//插入幻灯片
sldAdd = pres.Slides.Add(pres.Slides.Count + 1, PpSlideLayout.ppLayoutTitleOnly);
PPTOper.SetSlideTitle(sldAdd, title);//设置标题
sldAdd.Select();
tagSet = new TagSet(sldAdd.Tags);
//插入选项文本
isABC = false;//排序题只能按1234
tagSet.SetValue(TagKey.KeypadPara_OptionMode, isABC ? 1 : 0);
optionText = PPTOper.FormatShapeOptionText(optText);
PPTOper.AddShapeOptionText(sldAdd, optionText, isABC);
//图表位置与参数,选项个数,数据标签
Globals.SunVoteARSAddIn.PPTEdit.InitSlideEdit(sldAdd);
//正确答案
correctAsw = PanelOrder.GetOrderCorrectAnswer(aryTable[i, 4]);
tagSet.SetValue(TagKey.Order_CorrectAnswer, correctAsw);
//得分
scoreInt = ConvertOper.Convert(aryTable[i, 5]).ToInt;
tagSet.SetValue(TagKey.Order_ScoreRight, scoreInt);
break;
case 4://数值
InsertSlideInfo.ResponseType = ResponseType.Number;
//插入幻灯片
sldAdd = pres.Slides.Add(pres.Slides.Count + 1, PpSlideLayout.ppLayoutTitleOnly);
PPTOper.SetSlideTitle(sldAdd, title);//设置标题
sldAdd.Select();
tagSet = new TagSet(sldAdd.Tags);
//图表位置与参数,选项个数,数据标签
Globals.SunVoteARSAddIn.PPTEdit.InitSlideEdit(sldAdd);
//正确答案
tagSet.SetValue(TagKey.Number_CorrectAnswer, aryTable[i, 4]);
//得分
scoreInt = ConvertOper.Convert(aryTable[i, 5]).ToInt;
tagSet.SetValue(TagKey.Number_ScoreRight, scoreInt);
break;
}
frmPro.proBar.Value = i;
frmPro.proBar.Refresh();
frmPro.Refresh();
System.Windows.Forms.Application.DoEvents();
}
}
frmPro.Close();
InsertSlideInfo.SlideMode = 0;
}
}
}
catch (Exception ex)
{
if ((frmPro != null) && (!frmPro.IsDisposed))
frmPro.Close();
SystemLog.WriterLog(ex);
}
}
private void btnSelectCountDetail_Click(object sender, RibbonControlEventArgs e)
{
ResponseDB.UpdateSlideIndexToDB();
ReportEx.ExportSelectCountDetail();
}
private void btnSelectCountVoter_Click(object sender, RibbonControlEventArgs e)
{
ResponseDB.UpdateSlideIndexToDB();
ReportEx.ExportSelectCountVoter();
}
private void btnMedian_Click(object sender, RibbonControlEventArgs e)
{
Shape sha = PPTOper.MenuInsertDataTab(19, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.VoteMedian);
}
private void btnRange_Click(object sender, RibbonControlEventArgs e)
{
Shape sha = PPTOper.MenuInsertDataTab(20, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.VoteRange);
}
private void btnVoterDetailPV_Click(object sender, RibbonControlEventArgs e)
{
ResponseDB.UpdateSlideIndexToDB();
ReportEx.ExportVoterDetailScore();
}
//PowerVote定制Synthesis报表
private void btnSynthesis_Click(object sender, RibbonControlEventArgs e)
{
ResponseDB.UpdateSlideIndexToDB();
if (GlobalInfo.OEMLogo == OEMLogos.oemVoteExplorer)//杨斌 2018-03-19
ReportEx.ExportSynthesis_VoteExplorer();
else
ReportEx.ExportSynthesis();
}
//PowerVote定制三键表决结果报表
private void btnVoteResult_Click(object sender, RibbonControlEventArgs e)
{
ResponseDB.UpdateSlideIndexToDB();
ReportEx.ExportVoteResult();
}
private void btnDBSet_Click(object sender, RibbonControlEventArgs e)
{
new FrmSetDB().ShowDialog();
}
private void btnGroupSurvey_Click(object sender, RibbonControlEventArgs e)
{
ReportEx.ExportGroupSurvey();//杨斌 2016-09-29
}
private void btnVoteDetail_Click(object sender, RibbonControlEventArgs e)//杨斌 2016-12-05
{
GlobalInfo.response.InitResponse();//杨斌 2017-08-07
FrmVoteDetail frmVoteDetail = new FrmVoteDetail();
frmVoteDetail.InitSignInMode();//可以不调用?杨斌 2016-12-19
frmVoteDetail.InitMap();
frmVoteDetail.CloseIsHide = false;
frmVoteDetail.SavePos = true;
frmVoteDetail.ShowDialog();
}
private void btnResultDetailPic_Click(object sender, RibbonControlEventArgs e)
{
ResponseDB.UpdateSlideIndexToDB();
ReportEx.ExportReportQuestionDetailPic(Globals.SunVoteARSAddIn.Application.ActivePresentation);
}
private void btnResultDetailPicPDF_Click(object sender, RibbonControlEventArgs e)
{
string path = ShowSavePDF(btnResultDetailPicPDF.Label);
if (path.Length < 1)
return;
ResponseDB.UpdateSlideIndexToDB();
ReportEx.ExportReportQuestionDetailPic(Globals.SunVoteARSAddIn.Application.ActivePresentation, path);
}
private void btnCompVote_Click(object sender, RibbonControlEventArgs e)
{
InsertSlideInfo.ResponseType = ResponseType.CompVote;
InsertSlideInfo.OptionCount = 3;//杨斌 2017-06-11
InsertSlideInfo.TitleText = PPTOper.GetTitleSlide(ResponseType.CompVote);
Globals.SunVoteARSAddIn.PPTEdit.InitInsertSlideInfo(ResponseType.CompVote, InsertSlideInfo.OptionCount, 1);
Globals.SunVoteARSAddIn.PPTEdit.AddSlide();
}
/// <summary>
/// 插入对象,显示表决通过结果。杨斌 2018-07-25
/// </summary>
private void btnVotePassResult_Click(object sender, RibbonControlEventArgs e)
{
Shape sha = null;
var lstSha = PPTOper.GetDataLabelShape(Globals.SunVoteARSAddIn.PPTEdit.SlideEdit, DataLabelType.VotePassResult);
if (lstSha.Count > 0)
sha = lstSha[0];
if (sha == null)
sha = PPTOper.MenuInsertDataTab(21, Globals.SunVoteARSAddIn.PPTEdit.SlideEdit);
if (sha != null)
{
Globals.SunVoteARSAddIn.PPTEdit.RefreshLabelEdit(DataLabelType.VotePassResult);
sha.Select(Microsoft.Office.Core.MsoTriState.msoTrue);
}
}
/// <summary>
/// 竞价排名。杨斌 2017-09-20
/// </summary>
private void btnScoreRank_Click(object sender, RibbonControlEventArgs e)
{
Shape sha = PPTOper.ShowTableScoreRank(Globals.SunVoteARSAddIn.PPTEdit.SlideEdit, true);
if (sha != null)
sha.Select();
}
private void btnStartSever_Click(object sender, RibbonControlEventArgs e)
{
VoteServer.ShowServerSet();
}
private void btnFTPSet_Click(object sender, RibbonControlEventArgs e)
{
FrmFTPServer frm = new FrmFTPServer();
frm.TopMost = true;
frm.Show();
//new FrmFTPServer().ShowDialog();
}
private void btnVoterImportSQLServer_Click(object sender, RibbonControlEventArgs e)
{
new FrmGetRosterSQLServer().ShowDialog();
FrmVoteBar.ActivateSlideShowWindow();
}
private void btnGradeColor_Click(object sender, RibbonControlEventArgs e)
{
new FrmAnalyzeGradeColor().ShowDialog();
FrmVoteBar.ActivateSlideShowWindow();
}
private void btnGradeScoreReport_Click(object sender, RibbonControlEventArgs e)
{
ResponseDB.UpdateSlideIndexToDB();
ReportEx.ExportReportGradeScore();
}
private void btnShowDownload_Click(object sender, RibbonControlEventArgs e)
{
GlobalInfo.ShowToolKit("ShowDonload");
}
}
}