回答編集履歴
1
見直しキャンペーン中
test
CHANGED
@@ -1,77 +1,39 @@
|
|
1
1
|
`GetResourceSet`で取得できる`ResourceSet`は、`IEnumerable`を実装しているようです。
|
2
|
-
|
3
2
|
個々の値は`DictionaryEntry`のようです。
|
4
3
|
|
4
|
+
[ResourceManager.GetResourceSet(CultureInfo, Boolean, Boolean) メソッド (System.Resources) | Microsoft Docs](https://docs.microsoft.com/ja-jp/dotnet/api/system.resources.resourcemanager.getresourceset)
|
5
5
|
|
6
|
+
[ResourceSet クラス (System.Resources) | Microsoft Docs](https://docs.microsoft.com/ja-jp/dotnet/api/system.resources.resourceset)
|
6
7
|
|
7
|
-
[
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
[ResourceSet クラス (System.Resources) | Microsoft Docs](https://docs.microsoft.com/ja-jp/dotnet/api/system.resources.resourceset?view=net-6.0)
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
[DictionaryEntry 構造体 (System.Collections) | Microsoft Docs](https://docs.microsoft.com/ja-jp/dotnet/api/system.collections.dictionaryentry?view=net-6.0)
|
16
|
-
|
17
|
-
|
8
|
+
[DictionaryEntry 構造体 (System.Collections) | Microsoft Docs](https://docs.microsoft.com/ja-jp/dotnet/api/system.collections.dictionaryentry)
|
18
9
|
|
19
10
|
こんなんでしょうか。
|
20
|
-
|
21
|
-
```
|
11
|
+
```cs
|
22
|
-
|
23
12
|
using System.Collections;
|
24
|
-
|
25
13
|
using System.Data;
|
26
|
-
|
27
14
|
using System.Globalization;
|
28
|
-
|
29
15
|
using System.Linq;
|
30
|
-
|
31
16
|
using System.Resources;
|
32
|
-
|
33
17
|
using System.Windows.Forms;
|
34
18
|
|
35
|
-
|
36
|
-
|
37
19
|
namespace Questions371214
|
38
|
-
|
39
20
|
{
|
40
|
-
|
41
21
|
public partial class Form1 : Form
|
42
|
-
|
43
22
|
{
|
44
|
-
|
45
23
|
public Form1()
|
46
|
-
|
47
24
|
{
|
48
|
-
|
49
25
|
InitializeComponent();
|
50
26
|
|
51
|
-
|
52
|
-
|
53
27
|
ResourceSet resourceSet = Properties.Resources.ResourceManager
|
54
|
-
|
55
28
|
.GetResourceSet(CultureInfo.CurrentCulture, true, true);
|
56
29
|
|
57
|
-
|
58
|
-
|
59
30
|
DictionaryEntry[] entries = resourceSet.Cast<DictionaryEntry>()
|
60
|
-
|
61
31
|
.Where(x => x.Value is string)
|
62
|
-
|
63
32
|
.ToArray();
|
64
33
|
|
65
|
-
|
66
|
-
|
67
34
|
string[] names = entries.Select(x => x.Key.ToString()).ToArray();
|
68
|
-
|
69
35
|
string[] values = entries.Select(x => x.Value.ToString()).ToArray();
|
70
|
-
|
71
36
|
}
|
72
|
-
|
73
37
|
}
|
74
|
-
|
75
38
|
}
|
76
|
-
|
77
39
|
```
|