private static void CheckIdentifierAndVersion(string fileName, Package p) { if (string.IsNullOrEmpty(p.Identifier)) throw new FrameworkException("Missing 'Identifier' element in package specification: " + fileName + "."); if (string.IsNullOrEmpty(p.Version)) throw new FrameworkException("Missing 'Version' element in package specification: " + fileName + "."); }
private static void ValidatePackage(string fileName, Package p) { CheckIdentifierAndVersion(fileName, p); if (p.Dependencies == null) p.Dependencies = new List<Package>(); foreach (var dependency in p.Dependencies) CheckIdentifierAndVersion(fileName, dependency); }