Example #1
0
        private void Verify()
        {
            Depends.Remove("");

            // TODO: verify Depends
            foreach (var depend in Depends)
            {
                if (!GetRoot().MapIdToFile.ContainsKey(depend))
                {
                    throw new InvalidOperationException("Unable to resolve dependency [" + depend + "] for config file [" + Id + "]");
                }
            }

            foreach (var includeDir in IncludeDirs)
            {
                includeDir.Path = ExpandString(includeDir.Path, false);

                if (!includeDir.Path.StartsWith("=") && !Directory.Exists(includeDir.Path))
                {
                    throw new DirectoryNotFoundException("Directory [" + includeDir.Path + "] not found in config file [" + Id + "]");
                }
            }

            // Verify all dependencies
            foreach (var mappingFile in References)
            {
                mappingFile.Verify();
            }
        }
Example #2
0
        private void Verify(Logger logger)
        {
            Depends.Remove("");

            // TODO: verify Depends
            foreach (var depend in Depends)
            {
                if (!GetRoot().MapIdToFile.ContainsKey(depend))
                {
                    logger.Error(LoggingCodes.MissingConfigDependency, $"Unable to resolve dependency [{depend}] for config file [{Id}]");
                }
            }

            foreach (var includeDir in IncludeDirs)
            {
                includeDir.Path = ExpandString(includeDir.Path, false, logger);

                if (!includeDir.Path.StartsWith("=") && !Directory.Exists(includeDir.Path))
                {
                    logger.Error(LoggingCodes.IncludeDirectoryNotFound, $"Include directory {includeDir.Path} from config file [{Id}] not found");
                }
            }

            // Verify all dependencies
            foreach (var mappingFile in References)
            {
                mappingFile.Verify(logger);
            }
        }