public bool Visit(string url, DirRec dir) { string name = dir.GetFileName(); TreeNode leaf = node.Nodes.Add(url, name); if (dir.FileFlags_Directory) { leaf.ImageIndex = SysIcons.GetDirIconIndex(false); leaf.SelectedImageIndex = SysIcons.GetDirIconIndex(true); Iso9660.EnumDir(url, dir, new EnumDiskView(leaf)); } else { int icon = SysIcons.GetFileIconIndex(name); leaf.ImageIndex = leaf.SelectedImageIndex = icon; } return(true); }
public bool Visit(string url, DirRec dir) { string name = dir.GetFileName(); string ext = dir.GetFileExt(); if (extensions.Contains(ext)) { //Iso9660.ReadFile(dir); int lba = dir.LbaData; int len = dir.LenData; int pos = lba * 2048; switch (ext) { case ".BIN": Model.bins.Add(url, new BIN(url, pos)); break; case ".DAT": Model.dats.Add(url, new DAT(url, pos)); break; case ".PRG": Model.prgs.Add(url, new PRG(url, pos)); break; case ".SYD": Model.syds.Add(url, new SYD(url, pos)); break; case ".ARM": Model.arms.Add(url, new ARM(url, pos)); break; case ".ZND": Model.znds.Add(url, new ZND(url, pos)); break; case ".MPD": Model.mpds.Add(url, new MPD(url, pos)); break; case ".ZUD": Model.zuds.Add(url, new ZUD(url, pos)); break; case ".SHP": Model.shps.Add(url, new SHP(url, pos)); break; case ".WEP": Model.weps.Add(url, new WEP(url, pos)); break; case ".SEQ": Model.seqs.Add(url, new SEQ(url, pos)); break; } switch (ext) { case ".BIN": case ".DAT": case ".PRG": case ".SYD": case ".ARM": case ".ZND": case ".MPD": case ".ZUD": case ".SEQ": case ".SHP": case ".WEP": Model.SetPos(name, pos); Model.SetLen(name, len); Model.SetRec(name, dir); if (name == "ITEMNAME.BIN") { Model.SetPos("ITEMNAME.BIN", dir.LbaData * 2048); Model.SetLen("ITEMNAME.BIN", dir.LenData); Model.SetRec("ITEMNAME.BIN", dir); } if (name == "ITEMHELP.BIN") { Model.SetPos("ITEMHELP.BIN", dir.LbaData * 2048); Model.SetLen("ITEMHELP.BIN", dir.LenData); Model.SetRec("ITEMHELP.BIN", dir); } if (name == "00.SHP") { Model.lba_00_shp = lba; } if (name == "01.WEP") { Model.lba_01_wep = lba; } break; } if (ext == ".ZND") { string[] parts = url.Split(new char[] { ':' }); if (parts.Length > 1) { string key = "APP:" + parts[1]; Zone zone = new Zone(key, 0, dir); Model.zones.Add(key, zone); Model.Add(key, zone); Publisher.Register(zone); } } } else if (name.Contains("SLUS")) { int pos = dir.LbaData * 2048; int len = dir.LenData; Model.SetPos("SLUS", pos); Model.SetLen("SLUS", len); Model.SetRec("SLUS", dir); PRG prg = new PRG(url, pos); Model.prgs.Add(url, prg); Publisher.Register(prg); } else if (dir.FileFlags_Directory) { return(Iso9660.EnumDir(url, dir, this)); } return(true); }