示例#1
0
        private static bool SpecAlreadyHasFiles(XDocument nuSpec)
        {
            var package = nuSpec.ElementAnyNamespace("package");
            if (package == null) throw new Exception("The NuSpec file does not contain a <package> XML element. The NuSpec file appears to be invalid.");

            var files = package.ElementAnyNamespace("files");
            return files != null && files.Elements().Any();
        }
        private static bool TryGetFilesSection(XDocument nuSpec, out XElement files)
        {
            var package = nuSpec.ElementAnyNamespace("package");
            if (package == null) throw new Exception("The NuSpec file does not contain a <package> XML element. The NuSpec file appears to be invalid.");

            files = package.ElementAnyNamespace("files");
            return files != null && files.Elements().Any();
        }