Esempio n. 1
0
        private IQueryable <CameraModel> ReadFileToCollection(string path)
        {
            List <CameraModel> camList = new List <CameraModel>();

            using (var reader = new StreamReader(path))
            {
                string line;
                int    counter = 0;
                while ((line = reader.ReadLine()) != null)
                {
                    bool lineIsReadable = counter > 0 && !string.IsNullOrWhiteSpace(line);
                    if (lineIsReadable)
                    {
                        CameraModel newModel = LineToModel(line, counter);
                        camList.Add(newModel);
                    }
                    counter++;
                }
            }
            return(camList.AsQueryable());
        }
Esempio n. 2
0
 public string FormatCamToString(CameraModel cam)
 {
     return(cam.Index + " | " + cam.Name + " | " + cam.Latitude + " | " + cam.Longitude);
 }