private List <GPO> List_GPO() { List <GPO> gp = new List <GPO>(); int compteur = 0; string[] s = new string[4]; List <string> hkey = si.CheckHKEY(); hkey.Add("\n"); //rajout artificiel d'une ligne foreach (string line in hkey) { if ((compteur % 4 == 0) && s[3] != null) { gp.Add(new GPO() { Nom = s[0], Statut = s[1], Valeur = s[2].Length < 15 ? s[2] : s[2].Substring(0, 15) + "...", Attendue = s[3].Length < 15 ? s[3] : s[3].Substring(0, 15) + "..." }); } s[compteur % 4] = line; compteur++; } return(gp); }