private SecurityImpl getsec(string file) { try { //Check if file contains a zip definition if (file.ToLower().Contains("zip")) { //Get zip file and tik file from filename string[] parts = file.ToLower().Split('\\'); string tickfile = parts.Skip(parts.Length - 1).First(); string zipfile = string.Join(@"\", parts.Take(parts.Length - 1)); return(SecurityImpl.FromZIP(zipfile, tickfile)); } else { return(SecurityImpl.FromTIK(file)); } } catch (Exception ex) { debug("error reading TIK file: " + file + " err: " + ex.Message + ex.StackTrace); return(null); } }