public void AddData(object obj, string StrSeach)
        {
            CheckValueResultItem data = new CheckValueResultItem();

            if (null == obj)
            {
                data.TypeName = "null";
                data.StrValue = "null";
            }
            else
            {
                data.TypeName = obj.GetType().Name;
                data.StrValue = obj;
            }
            CheckValueResult.Data2String(ref data);
            if (this.ResultDict.ContainsKey(StrSeach))
            {
                this.ResultDict[StrSeach].Add(data);
            }
            else
            {
                this.ResultDict.Add(StrSeach, new List <CheckValueResultItem>
                {
                    data
                });
            }
        }
        public static object GetObject(Assembly assembly, string TypeName, string AttrName, ref CheckValueResult resultData)
        {
            TypeName = TypeName.Trim();
            AttrName = AttrName.Trim();
            List <string> attrList = new List <string>();
            Type          type     = assembly.GetType(TypeName);
            object        result;

            if (null == type)
            {
                result = null;
            }
            else
            {
                FieldInfo[] Infos = type.GetFields(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
                foreach (FieldInfo info in Infos)
                {
                    attrList.Add(info.Name);
                }
                if (!RelationMapModel.Map.TryGetValue(TypeName, out attrList))
                {
                    RelationMapModel.Map.Add(TypeName, attrList);
                }
                if (string.IsNullOrEmpty(AttrName))
                {
                    resultData.Info = "只查询了类型 数据包含数据有";
                    CheckValueResultItem        data  = new CheckValueResultItem();
                    List <CheckValueResultItem> dList = new List <CheckValueResultItem>
                    {
                        data
                    };
                    data.TypeName = "只查询了类型";
                    foreach (string item in attrList)
                    {
                        data.Childs.Add(string.Format("{0},{1}", item, ""));
                    }
                    resultData.ResultDict.Add("包含属性", dList);
                    result = attrList;
                }
                else
                {
                    FieldInfo infoData = type.GetField(AttrName, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
                    if (null == infoData)
                    {
                        result = attrList;
                    }
                    else
                    {
                        result = infoData.GetValue(null);
                    }
                }
            }
            return(result);
        }
 private static void Data2String(ref CheckValueResultItem model)
 {
     model.Childs = new List <string>();
     FieldInfo[] infos = model.StrValue.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
     if (infos.Length < 1)
     {
         model.StrValue = CheckModel.Data2Json(model.StrValue);
     }
     else
     {
         foreach (FieldInfo info in infos)
         {
             object data = info.GetValue(model.StrValue);
             model.Childs.Add(string.Format("{0},{1}", info.Name, data));
         }
         model.StrValue = model.StrValue.ToString();
     }
 }