Пример #1
0
 public static List<MeminfoModel> ConvertMeminfo(string meminfoText)
 {
     List<MeminfoModel> meminfoList = new List<MeminfoModel>();
     string[] rowDivider = new String[] { "\n" };
     string[] cellDivider = new String[] { ": " };
     string[] rowList = meminfoText.Split(rowDivider, StringSplitOptions.None).ToArray();
     foreach (string row in rowList) {
         if (!string.IsNullOrEmpty(row)) {
             string[] cellList = row.Split(cellDivider, StringSplitOptions.None).ToArray();
             MeminfoModel meminfo = new MeminfoModel {
                 key = cellList[0],
                 value = cellList[1]
             };
             meminfoList.Add(meminfo);
         }
     }
     return meminfoList;
 }
Пример #2
0
        public static List <MeminfoModel> ConvertMeminfo(string meminfoText)
        {
            List <MeminfoModel> meminfoList = new List <MeminfoModel>();

            string[] rowDivider  = new String[] { "\n" };
            string[] cellDivider = new String[] { ": " };
            string[] rowList     = meminfoText.Split(rowDivider, StringSplitOptions.None).ToArray();
            foreach (string row in rowList)
            {
                if (!string.IsNullOrEmpty(row))
                {
                    string[]     cellList = row.Split(cellDivider, StringSplitOptions.None).ToArray();
                    MeminfoModel meminfo  = new MeminfoModel {
                        key   = cellList[0],
                        value = cellList[1]
                    };
                    meminfoList.Add(meminfo);
                }
            }
            return(meminfoList);
        }
Пример #3
0
        public static List <MeminfoModel> Meminfo(string meminfoText)
        {
            List <MeminfoModel> meminfoList = new List <MeminfoModel>();

            string[] rowDivider  = new String[] { "\n" };
            string[] cellDivider = new String[] { ": " };

            string[] rowList = meminfoText.Split(rowDivider, StringSplitOptions.None).ToArray();
            foreach (string row in rowList)
            {
                if (row != null && row != "")
                {
                    string[]     cellList = row.Split(cellDivider, StringSplitOptions.None).ToArray();
                    MeminfoModel meminfo  = new MeminfoModel();
                    meminfo.key   = cellList[0];
                    meminfo.value = cellList[1];
                    meminfoList.Add(meminfo);
                }
            }

            return(meminfoList);
        }