private void OnTLS(AMCPParserEventArgs e) { List <TemplateInfo> templates = new List <TemplateInfo>(); foreach (string templateInfo in e.Data) { string pathName = templateInfo.Substring(templateInfo.IndexOf('\"') + 1, templateInfo.IndexOf('\"', 1) - 1); string folderName = ""; string fileName = ""; int delimIndex = pathName.LastIndexOf('/'); // 2.0.7 if (delimIndex == -1) { delimIndex = pathName.LastIndexOf('\\'); // 2.0.6 } if (delimIndex != -1) { folderName = pathName.Substring(0, delimIndex); fileName = pathName.Substring(delimIndex + 1); } else { fileName = pathName; } string temp = templateInfo.Substring(templateInfo.LastIndexOf('\"') + 1); string[] sizeAndDate = temp.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); Int64 size = Int64.Parse(sizeAndDate[0]); DateTime updated = DateTime.ParseExact(sizeAndDate[1], "yyyyMMddHHmmss", null); templates.Add(new TemplateInfo(folderName, fileName, size, updated)); } device_.OnUpdatedTemplatesList(templates); }