示例#1
0
        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));
                    }
                }
            }
        }
示例#2
0
        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);
                }
            }
        }