// ************************************************* static public RenbanFiles[] GetFiles(string FolderPass) { List <RenbanFiles> ret = new List <RenbanFiles>(); var di = new DirectoryInfo(FolderPass); var files = di.EnumerateFiles("*", SearchOption.TopDirectoryOnly); if (files.Count <FileInfo>() <= 0) { return(new RenbanFiles[0]); } foreach (FileInfo fi in files) { RenbanName rn = new RenbanName(fi.FullName); if (rn.IsFrame == false) { continue; } if (ret.Count <= 0) { RenbanFiles rf = new RenbanFiles(); ret.Add(rf); } if (ret[ret.Count - 1].AddFileName(rn) == false) { RenbanFiles rf = new RenbanFiles(); rf.AddFileName(rn); ret.Add(rf); } } return(ret.ToArray()); }
static public RenbanFiles GetFiles(RenbanName rn) { RenbanFiles ret = new RenbanFiles(); if (rn.IsFrame == false) { return(ret); } if (rn.Directory == "") { rn.Directory = ".\\"; } DirectoryInfo d = new DirectoryInfo(rn.Directory); if (d.Exists == false) { return(ret); } rn.Directory = d.FullName; var di = new DirectoryInfo(rn.Directory); var files = di.EnumerateFiles(rn.Node + "*" + rn.Ext, SearchOption.TopDirectoryOnly); if (files.Count <FileInfo>() <= 0) { return(ret); } foreach (FileInfo fi in files) { RenbanName rn2 = new RenbanName(fi.FullName); ret.AddFileName(rn2); } return(ret); }
// ************************************************* public bool AddFileName(RenbanName rn) { if (rn.IsFrame == false) { return(false); } if (m_Frames.Count <= 0) { m_Directory = rn.Directory; m_Node = rn.Node; m_Ext = rn.Ext; } else { if ((this.m_Directory != "") && (rn.Directory != "")) { if (m_Directory != rn.Directory) { return(false); } } if (m_Node != rn.Node) { return(false); } if (m_Ext != rn.Ext) { return(false); } } int v = rn.FrameValue; if (m_StartFrame > v) { m_StartFrame = v; } if (m_LastFrame < v) { m_LastFrame = v; } int k = rn.Frameketa; if (m_FrameKeta > k) { m_FrameKeta = k; } m_Frames.Add(rn.Frame); return(true); }