/// <summary> /// Returns a list of MpegSections from the paths belonging to this session key /// Each Mpeg section contains a sorted list of files and some settings related to the files /// </summary> /// <returns></returns> public List <JpegSection> MpegSections() { string mainLocation = ConfigurationManager.AppSettings["SaveLocation"].ToString() + @"\" + cameraId + @"\" + sessionKey; //string mainLocation = @"f:\captures\" + cameraId + @"\" + sessionKey; List <JpegSection> ret = new List <JpegSection>(); //the return collection //get all the section directories List <String> dirs = (from dir in Directory.EnumerateDirectories(mainLocation) orderby dir.ToString().StringToInt() ascending select dir).ToList(); foreach (var dir in dirs) { JpegSection section = null; if (limitedFrames) { section = new JpegSection(dir, startFrame, endFrame); } else { section = new JpegSection(dir); } if (section.imageFiles.Count > 0) { ret.Add(section); } //if a range of frames is asked for may return no files } return(ret); }//ImageFiles
/// <summary> /// Returns a list of MpegSections from the paths belonging to this session key /// Each Mpeg section contains a sorted list of files and some settings related to the files /// </summary> /// <returns></returns> public List<JpegSection> MpegSections() { string mainLocation = ConfigurationManager.AppSettings["SaveLocation"].ToString() + @"\" + cameraId + @"\" + sessionKey; //string mainLocation = @"f:\captures\" + cameraId + @"\" + sessionKey; List<JpegSection> ret = new List<JpegSection>(); //the return collection //get all the section directories List<String> dirs = (from dir in Directory.EnumerateDirectories(mainLocation) orderby dir.ToString().StringToInt() ascending select dir).ToList(); foreach (var dir in dirs) { JpegSection section = null; if (limitedFrames) { section = new JpegSection(dir, startFrame, endFrame); } else { section = new JpegSection(dir); } if (section.imageFiles.Count > 0) { ret.Add(section); } //if a range of frames is asked for may return no files } return ret; }//ImageFiles