private void SortRecord(string log) { try { if (log.Contains("\"logtype\": 2001")) { var info = JsonConvert.DeserializeObject <InformationLog>(log); Informations.Add(info); } else if (log.Contains("\"logtype\": 6001")) { var cred = JsonConvert.DeserializeObject <CredentialLog>(log); Credentials.Add(cred); } else if (log.Contains("\"logtype\": 5001")) { var port = JsonConvert.DeserializeObject <PortLog>(log); Ports.Add(port); } } catch (Exception ex) { Console.WriteLine(ex); } }
public void AddInfo(InfoCode code, string message) { Informations.Add(new KeyValuePair <InfoCode, string>(code, message)); }