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();
     }
 }
        public static void WriteMap(Assembly assembly)
        {
            string Path = RelationMapModel.CreatDirectory();

            if (!RelationMapModel.isWrite || RelationMapModel.Map.Count < 1)
            {
                RelationMapModel.GetRelationMap(assembly);
            }
            string path = Path + "RelationMapKey.txt";

            using (StreamWriter sw = new StreamWriter(path))
            {
                foreach (KeyValuePair <string, List <string> > d in RelationMapModel.Map)
                {
                    sw.WriteLine(d.Key);
                }
            }
            path = Path + "RelationMapAll.txt";
            using (StreamWriter sw = new StreamWriter(path))
            {
                foreach (KeyValuePair <string, List <string> > d in RelationMapModel.Map)
                {
                    sw.WriteLine(d.Key);
                    foreach (string item in d.Value)
                    {
                        sw.WriteLine("     " + item);
                    }
                    sw.WriteLine("**************************************************************************************************");
                }
            }
            path = Path + "EnumType.json";
            using (StreamWriter sw = new StreamWriter(path))
            {
                sw.WriteLine(CheckModel.Data2Json(RelationMapModel.EnumList));
            }
            Console.WriteLine("画图完成 RelationMap end");
            RelationMapModel.isWrite = true;
        }
示例#3
0
 private static void _checkArray(object objData, ref CheckValueResult resultData, string[] files, string _strResultKey, List <SeachData> SeachList)
 {
     resultData.AddData(CheckModel.Data2Json(objData), _strResultKey);
 }