8
var rm = new ResourceManager(sometype);
var resourceSet = rm.GetResourceSet(CultureInfo.CurrentUICulture, true, true);
我想將上述資源集轉換爲字典。目前我正在通過循環手動完成,如下所示。使用linq將資源集轉換爲字典
var resourceDictionary = new Dictionary<string, string>();
foreach (var r in resourceSet)
{
var dicEntry = (DictionaryEntry)r;
resourceDictionary.Add(dicEntry.Key.ToString(), dicEntry.Value.ToString());
}
我該如何做到這一點很容易使用LINQ?
完全忘記這個'鑄<>()'方法的! – superjos