public class tipArrtibute
{
//值
public float value
{
get;
set;
}
//告警提示方式
public List<int> type
{
get;
set;
}
//告警提示次数
public int count
{
get;
set;
}
//告警提示间隔(分钟)
public int intervalMinutes
{
get;
set;
}
//信息模板
public string TemplateMsg
{
get;
set;
}
//本地屏蔽
public int localShield
{
get;
set;
}
//同步
public int synShield
{
get;
set;
}
//告警等级联系人映射表
public Dictionary<int, usrinfo> AlarmLevelMap
{
get;
set;
}
}
public class usrinfo
{
//电话号码
public List<string> phones
{
get;
set;
}
//邮箱地址
public List<string> mails
{
get;
set;
}
}
//为回调函数传过来的参数
int nums = Convert.ToInt32(arg.GetType().GetProperty("count").GetValue(arg, null));
小弟之前用这个方法可以遍历出其他的数据类型惟独dic获取失败
------解决思路----------------------
你用GetValue获得对象后要转换成Dictionary<int, usrinfo>类型,然后用索引就能得到userinfo这个对象
------解决思路----------------------
我觉得楼主这是在滥用反射
以为反射是万能的吗