回答編集履歴
1
見直しキャンペーン中
answer
CHANGED
@@ -1,39 +1,39 @@
|
|
1
|
-
`GetResourceSet`で取得できる`ResourceSet`は、`IEnumerable`を実装しているようです。
|
2
|
-
個々の値は`DictionaryEntry`のようです。
|
3
|
-
|
4
|
-
[ResourceManager.GetResourceSet(CultureInfo, Boolean, Boolean) メソッド (System.Resources) | Microsoft Docs](https://docs.microsoft.com/ja-jp/dotnet/api/system.resources.resourcemanager.getresourceset
|
5
|
-
|
6
|
-
[ResourceSet クラス (System.Resources) | Microsoft Docs](https://docs.microsoft.com/ja-jp/dotnet/api/system.resources.resourceset
|
7
|
-
|
8
|
-
[DictionaryEntry 構造体 (System.Collections) | Microsoft Docs](https://docs.microsoft.com/ja-jp/dotnet/api/system.collections.dictionaryentry
|
9
|
-
|
10
|
-
こんなんでしょうか。
|
11
|
-
```
|
12
|
-
using System.Collections;
|
13
|
-
using System.Data;
|
14
|
-
using System.Globalization;
|
15
|
-
using System.Linq;
|
16
|
-
using System.Resources;
|
17
|
-
using System.Windows.Forms;
|
18
|
-
|
19
|
-
namespace Questions371214
|
20
|
-
{
|
21
|
-
public partial class Form1 : Form
|
22
|
-
{
|
23
|
-
public Form1()
|
24
|
-
{
|
25
|
-
InitializeComponent();
|
26
|
-
|
27
|
-
ResourceSet resourceSet = Properties.Resources.ResourceManager
|
28
|
-
.GetResourceSet(CultureInfo.CurrentCulture, true, true);
|
29
|
-
|
30
|
-
DictionaryEntry[] entries = resourceSet.Cast<DictionaryEntry>()
|
31
|
-
.Where(x => x.Value is string)
|
32
|
-
.ToArray();
|
33
|
-
|
34
|
-
string[] names = entries.Select(x => x.Key.ToString()).ToArray();
|
35
|
-
string[] values = entries.Select(x => x.Value.ToString()).ToArray();
|
36
|
-
}
|
37
|
-
}
|
38
|
-
}
|
1
|
+
`GetResourceSet`で取得できる`ResourceSet`は、`IEnumerable`を実装しているようです。
|
2
|
+
個々の値は`DictionaryEntry`のようです。
|
3
|
+
|
4
|
+
[ResourceManager.GetResourceSet(CultureInfo, Boolean, Boolean) メソッド (System.Resources) | Microsoft Docs](https://docs.microsoft.com/ja-jp/dotnet/api/system.resources.resourcemanager.getresourceset)
|
5
|
+
|
6
|
+
[ResourceSet クラス (System.Resources) | Microsoft Docs](https://docs.microsoft.com/ja-jp/dotnet/api/system.resources.resourceset)
|
7
|
+
|
8
|
+
[DictionaryEntry 構造体 (System.Collections) | Microsoft Docs](https://docs.microsoft.com/ja-jp/dotnet/api/system.collections.dictionaryentry)
|
9
|
+
|
10
|
+
こんなんでしょうか。
|
11
|
+
```cs
|
12
|
+
using System.Collections;
|
13
|
+
using System.Data;
|
14
|
+
using System.Globalization;
|
15
|
+
using System.Linq;
|
16
|
+
using System.Resources;
|
17
|
+
using System.Windows.Forms;
|
18
|
+
|
19
|
+
namespace Questions371214
|
20
|
+
{
|
21
|
+
public partial class Form1 : Form
|
22
|
+
{
|
23
|
+
public Form1()
|
24
|
+
{
|
25
|
+
InitializeComponent();
|
26
|
+
|
27
|
+
ResourceSet resourceSet = Properties.Resources.ResourceManager
|
28
|
+
.GetResourceSet(CultureInfo.CurrentCulture, true, true);
|
29
|
+
|
30
|
+
DictionaryEntry[] entries = resourceSet.Cast<DictionaryEntry>()
|
31
|
+
.Where(x => x.Value is string)
|
32
|
+
.ToArray();
|
33
|
+
|
34
|
+
string[] names = entries.Select(x => x.Key.ToString()).ToArray();
|
35
|
+
string[] values = entries.Select(x => x.Value.ToString()).ToArray();
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
39
|
```
|