public IsoFileWrapper(MountInfo minfo, DirectoryRecord ff) { MountInfo = minfo; Reader = minfo.Reader; record = ff; DirectoryRecord rec = ff; StringBuilder sb = new StringBuilder(); while (rec != null) { if (rec == Reader.Pvds.Last().RootDir) { break; } if (rec.IsFile) { sb.Insert(0, rec.Name); } else { sb.Insert(0, rec.Name + "\\"); } rec = rec.Parent; } fullName = sb.ToString().Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries).First(); name = Path.GetFileName(fullName); ext = Path.GetExtension(fullName); }
public IsoDirectoryInfoWrapper(MountInfo minfo, DirectoryRecord ff) { MountInfo = minfo; Reader = minfo.Reader; if (ff == minfo.Reader.WorkPvd.RootDir) { _name = minfo.IsoPath.Name; } else { _name = ff.Name; } record = ff; }
public static void Unmount(MountInfo m) { MountInfos.Remove(m); //unmount all tags var fls = m.MountTarget.GetFiles(); var temp = Stuff.IsDirty; foreach (var item in fls) { var tags = Stuff.GetTagsOfFile(item.FullName); foreach (var titem in tags) { titem.DeleteFile(item.FullName); } } Stuff.IsDirty = temp; }
internal static void MountIso(MountInfo mountInfo) { Stuff.MountInfos.Add(mountInfo); //extract .indx/meta.xml var f = mountInfo; if (f.Reader == null) { IsoReader reader = new IsoReader(); reader.Parse(f.IsoPath.FullName); f.Reader = reader; } var r = new IsoDirectoryInfoWrapper(f, f.Reader.WorkPvd.RootDir); //r.Parent = null; r.Filesystem = new IsoFilesystem(f) { IsoFileInfo = f.IsoPath }; if (r.Filesystem.FileExist(".indx\\meta.xml")) { var txt = r.Filesystem.ReadAllText(".indx\\meta.xml"); var doc = XDocument.Parse(txt); foreach (var item in doc.Descendants("tag")) { var nm = item.Attribute("name").Value; var tagg = Stuff.AddTag(new TagInfo() { Name = nm }); foreach (var fitem in item.Descendants("file")) { var pt = fitem.Value; var path = Path.Combine(mountInfo.MountTarget.FullName, pt); var fls = Stuff.GetAllFiles(mountInfo.MountTarget); var fr = fls.First(z => z.FullName.ToLower() == path.ToLower()); tagg.AddFile(fr); //tagg.AddFile((r.Filesystem as IsoFilesystem).GetFile(path)); } } } }
private void mouseIsoAction(FileListControl sender, IFileInfo obj, IDirectoryInfo target) { var t = fileListControl1; if (target == null) { if (t == sender) { t = fileListControl2; } target = t.CurrentDirectory; } if (Stuff.Question("Mount: " + obj.FullName + " to " + target.FullName + "?") == DialogResult.Yes) { var minf = new MountInfo(); minf.IsoPath = obj; minf.Path = target.FullName; minf.IsMounted = true; if (minf.Reader == null) { IsoReader reader = new IsoReader(); reader.Parse(minf.IsoPath.FullName); minf.Reader = reader; } var r = new IsoDirectoryInfoWrapper(minf, minf.Reader.WorkPvd.RootDir); r.Parent = new DirectoryInfoWrapper(minf.Path); minf.MountTarget = r; r.Filesystem = new IsoFilesystem(minf) { IsoFileInfo = minf.IsoPath }; Stuff.MountIso(minf); if (target == null) { t.UpdateList(target.FullName); } } }
public IsoFilesystem(MountInfo m) { mountInfo = m; }