C# 反射 List和字典Dictionary
Type type = typeof(Class.PlacemarkRender);
FieldInfo fieldInfo = type.GetField("_placemarkDic", BindingFlags.Instance | BindingFlags.NonPublic);
Dictionary<string, List<string>> dict = fieldInfo.GetValue(_placemarkRenderN) as Dictionary<string, List<string>>;
object variableValue = fieldInfo.GetValue(_placemarkRenderN);
IEnumerable<object> list = variableValue as IEnumerable<object>;
if (list != null)
{
foreach (var item in list)
{
if (value.Equals(item.GetType().GetProperty(PropertyName).GetValue(item, null).ToString()))
{
result = item.GetType().GetProperty(CheckPropertyName).GetValue(item, null).ToString();
}
}
}