Ejemplo n.º 1
0
        /// <summary>
        /// Set file import settings
        /// </summary>
        /// <param name="file"></param>
        /// <param name="doesImport"></param>
        public void SetFileImportSettings(EfkPkg.FileInfo file, bool doesImport)
        {
            var import = importedFiles.FirstOrDefault(_ => _.FileInfo == file);

            import.DoesImport = doesImport;

            if (doesImport)
            {
                // Enable dependency files
                if (file.Dependencies != null)
                {
                    foreach (var fileDep in file.Dependencies)
                    {
                        SetFileImportSettings(fileDep, true);
                    }
                }
            }
            else
            {
                // Disable when nowhere dependent
                foreach (var fileEfc in efkpkg.AllFiles)
                {
                    if (importedFiles.FirstOrDefault(_ => _.FileInfo == fileEfc).DoesImport&&
                        fileEfc.Dependencies != null &&
                        fileEfc.Dependencies.Contains(file))
                    {
                        import.DoesImport = true;
                    }
                }

                // Disable dependency files
                if (file.Dependencies != null)
                {
                    foreach (var fileDep in file.Dependencies)
                    {
                        SetFileImportSettings(fileDep, false);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 internal ImportFile(EfkPkgImporter importer, EfkPkg.FileInfo fileInfo)
 {
     Importer = importer;
     FileInfo = fileInfo;
 }