Пример #1
0
        private CuttingRoomAssetCollection CreateAssetsSummary(SevenZipArchiver pArchiver, out string pErrorText)
        {
            pErrorText = null;

            CuttingRoomAssetCollection assets = new CuttingRoomAssetCollection();

            List <ArchiveFileInfo> files;

            pArchiver.ArchivedFileList(out files);

            foreach (ArchiveFileInfo file in files)
            {
                string fileNameLower = file.FileName.ToLower();
                if (fileNameLower.StartsWith(CuttingRoomAssetsPath) && fileNameLower.EndsWith(ObjectDatFilename))
                {
                    if (!assets.AppendItem(pArchiver, file.FileName, out pErrorText))
                    {
                        return(null);
                    }
                }
            }

            return(assets.HasData ? assets : null);
        }
Пример #2
0
        private CuttingRoomAssetCollection CreateAssetsSummary(string pRootPath, out string pErrorText)
        {
            pErrorText = null;

            string assetFolder = Path.Combine(pRootPath, CuttingRoomAssetsPath);

            if (!Directory.Exists(assetFolder))
            {
                return(null);
            }

            string pathPrefix = $"{pRootPath.ToLower()}\\{CuttingRoomAssetCollection.CuttingRoomAssetsPathPrefix}";
            CuttingRoomAssetCollection assets = new CuttingRoomAssetCollection();

            foreach (string file in Directory.EnumerateFiles(assetFolder, ObjectDatFilename, SearchOption.AllDirectories))
            {
                if (!assets.AppendItem(pathPrefix, file, out pErrorText))
                {
                    return(null);
                }
            }

            return(assets.HasData ? assets : null);
        }