當前位置: 首頁>>代碼示例>>C#>>正文


C# RvDir.Child方法代碼示例

本文整理匯總了C#中ROMVault2.RvDB.RvDir.Child方法的典型用法代碼示例。如果您正苦於以下問題:C# RvDir.Child方法的具體用法?C# RvDir.Child怎麽用?C# RvDir.Child使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ROMVault2.RvDB.RvDir的用法示例。


在下文中一共展示了RvDir.Child方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ProcessDir

        private static void ProcessDir(RvDir dir, int depth = 1)
        {
            string d = new string(' ', 4 * depth);

            for (int i = 0; i < dir.ChildCount; i++)
            {
                RvDir game = dir.Child(i) as RvDir;
                if (game != null && game.FileType == FileType.Zip)
                {
                    WriteLine(d + "<game name=\"" + clean(game.Name) + "\">");
                    WriteLine(d + "    <description>" + clean(game.Name) + "</description>");

                    for (int j = 0; j < game.ChildCount; j++)
                    {
                        RvFile file = game.Child(j) as RvFile;
                        if (file != null)
                        {
                            WriteLine(d + "    <rom name=\"" + clean(file.Name) + "\" size=\"" + file.Size + "\" crc=\"" + Utils.ArrByte.ToString(file.CRC) + "\" md5=\"" + Utils.ArrByte.ToString(file.MD5) + "\" sha1=\"" + Utils.ArrByte.ToString(file.SHA1) + "\"/>");
                        }
                    }
                    WriteLine(d + "</game>");
                }
                if (game != null && game.FileType == FileType.Dir)
                {
                    WriteLine(d + "<dir name=\"" + clean(game.Name) + "\">");
                    ProcessDir(game, depth + 1);
                    WriteLine(d + "</dir>");
                }
            }
        }
開發者ID:damn-nation,項目名稱:RomVault,代碼行數:30,代碼來源:DatMaker.cs

示例2: SetupTree

        private void SetupTree(RvDir pTree, string pTreeBranches)
        {
            int nodeDepth = pTreeBranches.Length - 1;

            pTree.Tree.TreeBranches = pTreeBranches;

            pTree.Tree.RTree = new Rectangle(0, _yPos - 8, 1 + nodeDepth * 18, 16);
            pTree.Tree.RExpand = new Rectangle(5 + nodeDepth * 18, _yPos + 4, 9, 9);
            pTree.Tree.RChecked = new Rectangle(20 + nodeDepth * 18, _yPos + 2, 13, 13);
            pTree.Tree.RIcon = new Rectangle(35 + nodeDepth * 18, _yPos, 16, 16);
            pTree.Tree.RText = new Rectangle(51 + nodeDepth * 18, _yPos, 500, 16);

            pTreeBranches = pTreeBranches.Replace("├", "│");
            pTreeBranches = pTreeBranches.Replace("└", " ");

            _yPos = _yPos + 16;

            bool found = false;
            int last = 0;
            for (int i = 0; i < pTree.ChildCount; i++)
            {
                RvBase t = pTree.Child(i);
                if (t is RvDir)
                    if (((RvDir)t).Tree != null)
                    {
                        found = true;
                        if (pTree.Tree.TreeExpanded)
                            last = i;
                    }
            }
            if (!found)
                pTree.Tree.RExpand = new Rectangle(0, 0, 0, 0);



            for (int i = 0; i < pTree.ChildCount; i++)
            {
                RvBase t = pTree.Child(i);
                if (t is RvDir)
                    if (((RvDir)t).Tree != null)
                    {
                        if (pTree.Tree.TreeExpanded)
                        {
                            if (i != last)
                                SetupTree((RvDir)pTree.Child(i), pTreeBranches + "├");
                            else
                                SetupTree((RvDir)pTree.Child(i), pTreeBranches + "└");
                        }
                    }
            }


        }
開發者ID:babyinablender,項目名稱:RomVault,代碼行數:53,代碼來源:rvTree.cs

示例3: GetSelectedDirList

        private static void GetSelectedDirList(ref List<RvDir> lstDir, RvDir thisDir)
        {
            for (int i = 0; i < thisDir.ChildCount; i++)
            {
                if (thisDir.DatStatus != DatStatus.InDatCollect) continue;
                RvDir tDir = thisDir.Child(i) as RvDir;
                if (tDir == null) continue;
                if (tDir.Tree == null) continue;
                if (tDir.Tree.Checked == RvTreeRow.TreeSelect.Selected)
                    lstDir.Add(tDir);

                GetSelectedDirList(ref lstDir, tDir);
            }
        }
開發者ID:babyinablender,項目名稱:RomVault,代碼行數:14,代碼來源:DBHelper.cs

示例4: CountFixDir

        private static int CountFixDir(RvDir dir, bool lastSelected)
        {
            int count = 0;

            bool thisSelected = lastSelected;
            if (dir.Tree != null)
                thisSelected = dir.Tree.Checked == RvTreeRow.TreeSelect.Selected;

            for (int j = 0; j < dir.ChildCount; j++)
            {
                RvBase child = dir.Child(j);

                switch (child.FileType)
                {
                    case FileType.Zip:
                        if (!thisSelected)
                            continue;
                        RvDir tZip = (RvDir)child;
                        count += tZip.DirStatus.CountCanBeFixed();

                        break;

                    case FileType.Dir:

                        count += CountFixDir((RvDir)child, thisSelected);
                        break;

                    case FileType.File:
                        if (!thisSelected)
                            continue;
                        if (child.RepStatus == RepStatus.CanBeFixed)
                            count++;
                        break;
                }
            }
            return count;
        }
開發者ID:babyinablender,項目名稱:RomVault,代碼行數:37,代碼來源:FixFiles.cs

示例5: IsDeepScanned

 private static bool IsDeepScanned(RvDir tZip)
 {
     for (int i = 0; i < tZip.ChildCount; i++)
     {
         RvFile zFile = tZip.Child(i) as RvFile;
         if (zFile != null && zFile.GotStatus == GotStatus.Got &&
             (!zFile.FileStatusIs(FileStatus.SizeVerified) || !zFile.FileStatusIs(FileStatus.CRCVerified) || !zFile.FileStatusIs(FileStatus.SHA1Verified) || !zFile.FileStatusIs(FileStatus.MD5Verified)))
             return false;
     }
     return true;
 }
開發者ID:babyinablender,項目名稱:RomVault,代碼行數:11,代碼來源:FileScanning.cs

示例6: UpdateGameGrid

        private void UpdateGameGrid(RvDir tDir)
        {


            lblDITName.Text = tDir.Name;
            if (tDir.Dat != null)
            {
                RvDat tDat = tDir.Dat;
                lblDITDescription.Text = tDat.GetData(RvDat.DatData.Description);
                lblDITCategory.Text = tDat.GetData(RvDat.DatData.Category);
                lblDITVersion.Text = tDat.GetData(RvDat.DatData.Version);
                lblDITAuthor.Text = tDat.GetData(RvDat.DatData.Author);
                lblDITDate.Text = tDat.GetData(RvDat.DatData.Date);
            }
            else if (tDir.DirDatCount == 1)
            {
                RvDat tDat = tDir.DirDat(0);
                lblDITDescription.Text = tDat.GetData(RvDat.DatData.Description);
                lblDITCategory.Text = tDat.GetData(RvDat.DatData.Category);
                lblDITVersion.Text = tDat.GetData(RvDat.DatData.Version);
                lblDITAuthor.Text = tDat.GetData(RvDat.DatData.Author);
                lblDITDate.Text = tDat.GetData(RvDat.DatData.Date);
            }
            else
            {
                lblDITDescription.Text = "";
                lblDITCategory.Text = "";
                lblDITVersion.Text = "";
                lblDITAuthor.Text = "";
                lblDITDate.Text = "";
            }



            lblDITPath.Text = tDir.FullName;


            lblDITRomsGot.Text = tDir.DirStatus.CountCorrect().ToString(CultureInfo.InvariantCulture);
            lblDITRomsMissing.Text = tDir.DirStatus.CountMissing().ToString(CultureInfo.InvariantCulture);
            lblDITRomsFixable.Text = tDir.DirStatus.CountFixesNeeded().ToString(CultureInfo.InvariantCulture);
            lblDITRomsUnknown.Text = (tDir.DirStatus.CountUnknown() + tDir.DirStatus.CountInToSort()).ToString(CultureInfo.InvariantCulture);

            _updatingGameGrid = true;

            if (Settings.IsMono)
            {
                if (GameGrid.RowCount > 0)
                    GameGrid.CurrentCell = GameGrid[0,0];
                if (RomGrid.RowCount > 0)
                    RomGrid.CurrentCell = RomGrid[0,0];
            }

            GameGrid.Rows.Clear();
            RomGrid.Rows.Clear();

            // clear sorting
            GameGrid.Columns[_gameGridSortColumnIndex].HeaderCell.SortGlyphDirection = SortOrder.None;
            _gameGridSortColumnIndex = 0;
            _gameGridSortOrder = SortOrder.Descending;


            ReportStatus tDirStat;

            _gameGridColumnXPositions = new int[(int)RepStatus.EndValue];

            int rowCount = 0;
            for (int j = 0; j < tDir.ChildCount; j++)
            {

                RvDir tChildDir = tDir.Child(j) as RvDir;
                if (tChildDir == null) continue;

                tDirStat = tChildDir.DirStatus;

                bool gCorrect = tDirStat.HasCorrect();
                bool gMissing = tDirStat.HasMissing();
                bool gUnknown = tDirStat.HasUnknown();
                bool gInToSort = tDirStat.HasInToSort();
                bool gFixes = tDirStat.HasFixesNeeded();

                bool show = (chkBoxShowCorrect.Checked && gCorrect && !gMissing && !gFixes);
                show = show || (chkBoxShowMissing.Checked && gMissing);
                show = show || (chkBoxShowFixed.Checked && gFixes);
                show = show || (gUnknown);
                show = show || (gInToSort);
                show = show || (tChildDir.GotStatus == GotStatus.Corrupt);
                show = show || !(gCorrect || gMissing || gUnknown || gInToSort || gFixes);

                if (!show) continue;

                rowCount++;

                int columnIndex = 0;
                for (int l = 0; l < RepairStatus.DisplayOrder.Length; l++)
                {
                    if (l >= 13) columnIndex = l;

                    if (tDirStat.Get(RepairStatus.DisplayOrder[l]) <= 0) continue;

                    int len = DigitLength(tDirStat.Get(RepairStatus.DisplayOrder[l])) * 7 + 26;
//.........這裏部分代碼省略.........
開發者ID:babyinablender,項目名稱:RomVault,代碼行數:101,代碼來源:FrmMain.cs

示例7: UpdateDirs

        private static void UpdateDirs(RvDir dbDir, RvDir fileDir)
        {
            int dbIndex = 0;
            int scanIndex = 0;

            dbDir.DatStatus=DatStatus.InDatCollect;
            if (dbDir.Tree == null)
            {
                Debug.WriteLine("Adding Tree View to " + dbDir.Name);
                dbDir.Tree = new RvTreeRow();
            }

            Debug.WriteLine("");
            Debug.WriteLine("Now scanning dirs");

            while (dbIndex < dbDir.ChildCount || scanIndex < fileDir.ChildCount)
            {
                RvBase dbChild = null;
                RvBase fileChild = null;
                int res = 0;

                if (dbIndex < dbDir.ChildCount && scanIndex < fileDir.ChildCount)
                {
                    dbChild = dbDir.Child(dbIndex);
                    fileChild = fileDir.Child(scanIndex);
                    res = DBHelper.CompareName(dbChild, fileChild);
                    Debug.WriteLine("Checking " + dbChild.Name + " : and " + fileChild.Name + " : " + res);
                }
                else if (scanIndex < fileDir.ChildCount)
                {
                    fileChild = fileDir.Child(scanIndex);
                    res = 1;
                    Debug.WriteLine("Checking : and " + fileChild.Name + " : " + res);
                }
                else if (dbIndex < dbDir.ChildCount)
                {
                    dbChild = dbDir.Child(dbIndex);
                    res = -1;
                }
                switch (res)
                {
                    case 0:
                        // found a matching directory in DATRoot So recurse back into it

                        if (dbChild.GotStatus == GotStatus.Got)
                        {
                            if (dbChild.Name != fileChild.Name) // check if the case of the Item in the DB is different from the Dat Root Actual filename
                            {
                                if (!string.IsNullOrEmpty(dbChild.FileName)) // if we do not already have a different case name stored
                                {
                                    dbChild.FileName = dbChild.Name; // copy the DB filename to the FileName
                                }
                                else // We already have a different case filename found in ROMRoot
                                {
                                    if (dbChild.FileName == fileChild.Name) // check if the DATRoot name does now match the name in the DB Filename
                                    {
                                        dbChild.FileName = null; // if it does undo the BadCase Flag
                                    }
                                }
                                dbChild.Name = fileChild.Name; // Set the db Name to match the DATRoot Name.
                            }
                        }
                        else
                            dbChild.Name = fileChild.Name;

                        UpdateDatList((RvDir)dbChild,(RvDir)fileChild);
                        dbIndex++;
                        scanIndex++;
                        break;

                    case 1:
                        // found a new directory in Dat
                        RvDir tDir = new RvDir(FileType.Dir)
                        {
                            Name = fileChild.Name,
                            Tree = new RvTreeRow(),
                            DatStatus = DatStatus.InDatCollect,
                        };
                        dbDir.ChildAdd(tDir, dbIndex);
                        Debug.WriteLine("Adding new Dir and Calling back in to check this DIR " + tDir.Name);
                        UpdateDatList(tDir,(RvDir)fileChild);

                        dbIndex++;
                        scanIndex++;
                        break;
                    case -1:
                        // all files
                        dbIndex++;
                        break;
                }
            }
        }
開發者ID:mandl,項目名稱:ROMVault-PapilioEdition,代碼行數:92,代碼來源:DatUpdate.cs

示例8: SetInDat

        /*
        private static void SetInDat(RvDir tDir)
        {
            tDir.DatStatus = DatStatus.InDatCollect;
            if (tDir.Parent != null)
                SetInDat(tDir.Parent);
        }
        */
        private static Boolean MergeInDat(RvDir dbDat, RvDir newDat, out RvDat conflict, bool checkOnly)
        {
            conflict = null;
            int dbIndex = 0;
            int newIndex = 0;
            while (dbIndex < dbDat.ChildCount || newIndex < newDat.ChildCount)
            {
                RvBase dbChild = null;
                RvBase newDatChild = null;
                int res = 0;

                if (dbIndex < dbDat.ChildCount && newIndex < newDat.ChildCount)
                {
                    dbChild = dbDat.Child(dbIndex); // are files
                    newDatChild = newDat.Child(newIndex); // is from a dat item
                    res = DBHelper.CompareName(dbChild, newDatChild);
                }
                else if (newIndex < newDat.ChildCount)
                {
                    newDatChild = newDat.Child(newIndex);
                    res = 1;
                }
                else if (dbIndex < dbDat.ChildCount)
                {
                    dbChild = dbDat.Child(dbIndex);
                    res = -1;
                }

                if (res == 0)
                {
                    if (dbChild == null || newDatChild == null)
                    {
                        SendAndShowDat(Resources.DatUpdate_MergeInDat_Error_in_Logic, dbDat.FullName);
                        break;
                    }

                    List<RvBase> dbDats = new List<RvBase>();
                    List<RvBase> newDats = new List<RvBase>();
                    int dbDatsCount = 1;
                    int newDatsCount = 1;

                    dbDats.Add(dbChild);
                    newDats.Add(newDatChild);

                    while (dbIndex + dbDatsCount < dbDat.ChildCount && DBHelper.CompareName(dbChild, dbDat.Child(dbIndex + dbDatsCount)) == 0)
                    {
                        dbDats.Add(dbDat.Child(dbIndex + dbDatsCount));
                        dbDatsCount += 1;
                    }
                    while (newIndex + newDatsCount < newDat.ChildCount && DBHelper.CompareName(newDatChild, newDat.Child(newIndex + newDatsCount)) == 0)
                    {
                        newDats.Add(newDat.Child(newIndex + newDatsCount));
                        newDatsCount += 1;
                    }

                    if (dbDatsCount > 1 || newDatsCount > 1)
                    {
                        ReportError.SendAndShow("Double Name Found");
                    }

                    for (int indexdb = 0; indexdb < dbDatsCount; indexdb++)
                    {
                        if (dbDats[indexdb].DatStatus == DatStatus.NotInDat) continue;

                        if (checkOnly)
                        {
                            conflict = dbChild.Dat;
                            return true;
                        }

                        SendAndShowDat(Resources.DatUpdate_MergeInDat_Unkown_Update_Dat_Status + dbChild.DatStatus, dbDat.FullName);
                        break;
                    }

                    if (!checkOnly)
                    {
                        for (int indexNewDats = 0; indexNewDats < newDatsCount; indexNewDats++)
                        {
                            if (newDats[indexNewDats].SearchFound) continue;

                            for (int indexDbDats = 0; indexDbDats < dbDatsCount; indexDbDats++)
                            {
                                if (dbDats[indexDbDats].SearchFound) continue;

                                bool matched = FullCompare(dbDats[indexDbDats], newDats[indexNewDats]);
                                if (!matched) continue;

                                dbDats[indexDbDats].DatAdd(newDats[indexNewDats]);

                                FileType ft = dbChild.FileType;

                                if (ft == FileType.Zip || ft == FileType.Dir)
//.........這裏部分代碼省略.........
開發者ID:mandl,項目名稱:ROMVault-PapilioEdition,代碼行數:101,代碼來源:DatUpdate.cs

示例9: CheckMouseDown

        private bool CheckMouseDown(RvDir pTree, int x, int y, MouseEventArgs mevent)
        {
            if (pTree.Tree.RChecked.Contains(x, y))
            {
                if (pTree.Tree.Checked == RvTreeRow.TreeSelect.Disabled)
                    return true;

                _mousehit = true;
                SetChecked(pTree, pTree.Tree.Checked == RvTreeRow.TreeSelect.Selected ? RvTreeRow.TreeSelect.UnSelected : RvTreeRow.TreeSelect.Selected);
                return true;
            }

            if (pTree.Tree.RExpand.Contains(x, y))
            {
                _mousehit = true;
                SetExpanded(pTree, mevent.Button == MouseButtons.Right);
                return true;
            }

            if (pTree.Tree.RText.Contains(x, y))
            {
                _mousehit = true;

                if (RvSelected != null)
                    RvSelected(pTree, mevent);

                _lSelected = pTree;
                return true;
            }

            if (pTree.Tree.TreeExpanded)
                for (int i = 0; i < pTree.ChildCount; i++)
                {
                    RvBase rBase = pTree.Child(i);
                    if (rBase is RvDir)
                    {
                        RvDir rDir = (RvDir)rBase;
                        if (rDir.Tree != null)
                            if (CheckMouseDown(rDir, x, y, mevent))
                                return true;
                    }
                }

            return false;
        }
開發者ID:mandl,項目名稱:ROMVault-PapilioEdition,代碼行數:45,代碼來源:rvTree.cs

示例10: SetExpanded

        private static void SetExpanded(RvDir pTree, bool rightClick)
        {
            if (!rightClick)
            {
                pTree.Tree.TreeExpanded = !pTree.Tree.TreeExpanded;
                return;
            }

            // Find the value of the first child node.
            for (int i = 0; i < pTree.ChildCount; i++)
            {
                RvBase b = pTree.Child(i);
                if (b is RvDir)
                {
                    RvDir d = (RvDir)b;
                    if (d.Tree != null)
                    {
                        //Recusivly Set All Child Nodes to this value
                        SetExpandedRecurse(pTree, !d.Tree.TreeExpanded);
                        break;
                    }
                }
            }
        }
開發者ID:mandl,項目名稱:ROMVault-PapilioEdition,代碼行數:24,代碼來源:rvTree.cs

示例11: DatSetRenameAndRemoveDups

        private static void DatSetRenameAndRemoveDups(RvDir tDat)
        {
            for (int g = 0; g < tDat.ChildCount; g++)
            {
                RvDir tDir = (RvDir)tDat.Child(g);
                if (tDir.Game == null)
                {
                    DatSetRenameAndRemoveDups(tDir);
                }
                else
                {
                    for (int r = 0; r < tDir.ChildCount - 1; r++)
                    {
                        RvFile f0 = (RvFile)tDir.Child(r);
                        RvFile f1 = (RvFile)tDir.Child(r + 1);

                        if (f0.Name != f1.Name)
                            continue;

                        if (f0.Size != f1.Size || !ArrByte.bCompare(f0.CRC, f1.CRC))
                        {
                            tDir.ChildRemove(r + 1); // remove F1
                            f1.Name = f1.Name + "_" + ArrByte.ToString(f1.CRC); // rename F1;
                            int pos = tDir.ChildAdd(f1);
                            if (pos < r)
                                r = pos;
                            // if this rename moved the File back up the list, start checking again from that file.
                        }
                        else
                        {
                            tDir.ChildRemove(r + 1);
                        }
                        r--;
                    }
                }
            }
        }
開發者ID:babyinablender,項目名稱:RomVault,代碼行數:37,代碼來源:DatReader.cs

示例12: LoadRomFromDat

        private static void LoadRomFromDat(ref RvDir tGame, XmlNode romNode)
        {
            if (romNode.Attributes == null)
                return;

            XmlNode name = romNode.Attributes.GetNamedItem("name");
            string loadflag = VarFix.String(romNode.Attributes.GetNamedItem("loadflag"));
            if (name != null)
            {
                RvFile tRom = new RvFile(FileType.ZipFile)
                                     {
                                         Name = VarFix.CleanFullFileName(name),
                                         Size = VarFix.ULong(romNode.Attributes.GetNamedItem("size")),
                                         CRC = VarFix.CleanMD5SHA1(romNode.Attributes.GetNamedItem("crc"), 8),
                                         SHA1 = VarFix.CleanMD5SHA1(romNode.Attributes.GetNamedItem("sha1"), 40),
                                         Status = VarFix.ToLower(romNode.Attributes.GetNamedItem("status")),

                                         Dat = tGame.Dat
                                     };

                if (tRom.Size != null) tRom.FileStatusSet(FileStatus.SizeFromDAT);
                if (tRom.CRC != null) tRom.FileStatusSet(FileStatus.CRCFromDAT);
                if (tRom.SHA1 != null) tRom.FileStatusSet(FileStatus.SHA1FromDAT);

                _indexContinue = tGame.ChildAdd(tRom);
            }
            else if (loadflag.ToLower() == "continue")
            {
                RvFile tZippedFile = (RvFile)tGame.Child(_indexContinue);
                tZippedFile.Size += VarFix.ULong(romNode.Attributes.GetNamedItem("size"));
            }
        }
開發者ID:mandl,項目名稱:ROMVault-PapilioEdition,代碼行數:32,代碼來源:DatMessXMLReader.cs

示例13: ReportMissingFindSizes

        private static void ReportMissingFindSizes(RvDir dir, RvDat dat, ReportType rt)
        {
            for (int i = 0; i < dir.ChildCount; i++)
            {
                RvBase b = dir.Child(i);
                if (b.Dat != null && b.Dat != dat)
                    continue;

                RvFile f = b as RvFile;

                if (f != null)
                {
                    if (
                        (rt == ReportType.PartialMissing && Partial.Contains(f.RepStatus)) ||
                        (rt == ReportType.Fixing && Fixing.Contains(f.RepStatus))
                        )
                    {
                        int fileNameLength = f.FileNameInsideGame().Length;
                        int fileSizeLength = f.Size.ToString().Length;
                        int repStatusLength = f.RepStatus.ToString().Length;

                        if (fileNameLength > _fileNameLength) _fileNameLength = fileNameLength;
                        if (fileSizeLength > _fileSizeLength) _fileSizeLength = fileSizeLength;
                        if (repStatusLength > _repStatusLength) _repStatusLength = repStatusLength;
                    }
                }
                RvDir d = b as RvDir;
                if (d != null)
                    ReportMissingFindSizes(d, dat, rt);
            }
        }
開發者ID:damn-nation,項目名稱:RomVault,代碼行數:31,代碼來源:Report.cs

示例14: ReportMissing

        private static void ReportMissing(RvDir dir, RvDat dat, ReportType rt)
        {
            for (int i = 0; i < dir.ChildCount; i++)
            {
                RvBase b = dir.Child(i);
                if (b.Dat != null && b.Dat != dat)
                    continue;

                RvFile f = b as RvFile;

                if (f != null)
                {
                    if (
                       (rt == ReportType.PartialMissing && Partial.Contains(f.RepStatus)) ||
                       (rt == ReportType.Fixing && Fixing.Contains(f.RepStatus))
                       )
                    {
                        string filename = f.FileNameInsideGame();
                        string crc = ArrByte.ToString(f.CRC);
                        _ts.WriteLine("| " + filename + new string(' ', _fileNameLength + 1 - filename.Length) + "| "
                                          + f.Size + new string(' ', _fileSizeLength + 1 - f.Size.ToString().Length) + "| "
                                          + crc + new string(' ', 9 - crc.Length) + "| "
                                          + f.RepStatus + new string(' ', _repStatusLength + 1 - f.RepStatus.ToString().Length) + "|");
                    }
                }
                RvDir d = b as RvDir;
                if (d != null)
                    ReportMissing(d, dat, rt);
            }
        }
開發者ID:damn-nation,項目名稱:RomVault,代碼行數:30,代碼來源:Report.cs

示例15: FixZip

        private static ReturnCode FixZip(RvDir fixZip)
        {
            //Check for error status
            if (fixZip.DirStatus.HasUnknown())
                return ReturnCode.FindFixes; // Error

            bool needsTrrntzipped = fixZip.ZipStatus != ZipStatus.TrrntZip && fixZip.GotStatus == GotStatus.Got && fixZip.DatStatus == DatStatus.InDatCollect && (Settings.FixLevel == eFixLevel.TrrntZipLevel1 || Settings.FixLevel == eFixLevel.TrrntZipLevel2 || Settings.FixLevel == eFixLevel.TrrntZipLevel3);

            // file corrupt and not in tosort
            //      if file cannot be fully fixed copy to corrupt
            //      process zipfile

            if (fixZip.GotStatus == GotStatus.Corrupt && fixZip.DatStatus != DatStatus.InToSort)
            {
                ReturnCode movReturnCode = MoveZiptoCorrupt(fixZip);
                if (movReturnCode != ReturnCode.Good)
                    return movReturnCode;
            }

            // has fixable
            //      process zipfile

            else if (fixZip.DirStatus.HasFixable())
            {
                // do nothing here but continue on to process zip.
            }

            // need trrntzipped
            //      process zipfile

            else if (needsTrrntzipped)
            {
                // do nothing here but continue on to process zip.
            }


            // got empty zip that should be deleted
            //      process zipfile
            else if (fixZip.GotStatus == GotStatus.Got && fixZip.GotStatus != GotStatus.Corrupt && !fixZip.DirStatus.HasAnyFiles())
            {
                // do nothing here but continue on to process zip.
            }

            // else
            //      skip this zipfile
            else
            {
                // nothing can be done to return
                return ReturnCode.Good;
            }



            string fixZipFullName = fixZip.TreeFullName;

            if (!fixZip.DirStatus.HasFixable() && needsTrrntzipped)
                ReportProgress(new bgwShowFix(Path.GetDirectoryName(fixZipFullName), Path.GetFileName(fixZipFullName), "", 0, "TrrntZipping", "", "", ""));


            CheckCreateParent(fixZip.Parent);
            ReportError.LogOut("");
            ReportError.LogOut(fixZipFullName + " : " + fixZip.RepStatus);
            ReportError.LogOut("------------------------------------------------------------");
            Debug.WriteLine(fixZipFullName + " : " + fixZip.RepStatus);
            ReportError.LogOut("Zip File Status Before Fix:");
            for (int intLoop = 0; intLoop < fixZip.ChildCount; intLoop++)
                ReportError.LogOut((RvFile)fixZip.Child(intLoop));
            ReportError.LogOut("");

            ZipFile tempZipOut = null;

            ZipFile toSortCorruptOut = null;
            ZipFile toSortZipOut = null;

            RvDir toSortGame = null;
            RvDir toSortCorruptGame = null;

            ReturnCode returnCode;
            List<RvFile> fixZipTemp = new List<RvFile>();

            for (int iRom = 0; iRom < fixZip.ChildCount; iRom++)
            {
                RvFile zipFileFixing = new RvFile(FileType.ZipFile);
                fixZip.Child(iRom).CopyTo(zipFileFixing);

                if (iRom == fixZipTemp.Count)
                    fixZipTemp.Add(zipFileFixing);
                else
                    fixZipTemp[iRom] = zipFileFixing;

                ReportError.LogOut(zipFileFixing.RepStatus + " : " + fixZip.Child(iRom).FullName);

                switch (zipFileFixing.RepStatus)
                {
                    #region Nothing to copy
                    // any file we do not have or do not want in the destination zip
                    case RepStatus.Missing:
                    case RepStatus.NotCollected:
                    case RepStatus.Rename:
                    case RepStatus.Delete:
//.........這裏部分代碼省略.........
開發者ID:babyinablender,項目名稱:RomVault,代碼行數:101,代碼來源:FixFiles.cs


注:本文中的ROMVault2.RvDB.RvDir.Child方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。