3
我该如何更清晰/简洁地编写此代码?获取一组词典中给定键的每个值的列表?
/// <summary>
/// Creates a set of valid URIs.
/// </summary>
/// <param name="levelVariantURIDicts">A collection of dictionaries of the form:
/// dict["filePath"] == theFilePath </param>
/// <returns></returns>
private ICollection<string> URIsOfDicts(ICollection<IDictionary<string, string>> levelVariantURIDicts)
{
ICollection<string> result = new HashSet<string>();
foreach (IDictionary<string, string> dict in levelVariantURIDicts)
{
result.Add(dict["filePath"]);
}
return result;
}
这是光荣的。非常感谢。 – 2010-03-18 20:01:28