public List <MsgBase> GetMessages() { List <MsgBase> results = new List <MsgBase>(); string fileLocation = m_Parent.Configurations.FromDir; string fileDropLocation = m_Parent.Configurations.ToDir; string json = ""; foreach (string fileName in Directory.GetFiles(fileLocation)) { using (StreamReader r = new StreamReader(fileName)) { json = r.ReadToEnd(); } string[] messages = json.Split(new string[] { ">>>>" }, StringSplitOptions.None); foreach (string msg in messages) { results.Add(MsgBase.DecodeJSONMessage(msg)); } File.Delete(fileName); } return(results); }