void AddPermissionGroups(XElement application) { var assemblyAttrs = Assemblies.SelectMany(path => PermissionGroupAttribute.FromCustomAttributeProvider(Resolver.GetAssembly(path))); // Add unique permissionGroups to the manifest foreach (var pga in assemblyAttrs.Distinct(new PermissionGroupAttribute.PermissionGroupAttributeComparer())) { if (!application.Parent.Descendants("permissionGroup").Any(x => (string)x.Attribute(attName) == pga.Name)) { application.AddBeforeSelf(pga.ToElement(PackageName)); } } }
void AddPermissionGroups(XElement application, List <string> selectedWhitelistAssemblies) { // Look in user assemblies + whitelist (like Maps) var check_assemblies = Assemblies.Union(selectedWhitelistAssemblies); var assemblyAttrs = check_assemblies.SelectMany(path => PermissionGroupAttribute.FromCustomAttributeProvider(Resolver.GetAssembly(path))); // Add unique permissionGroups to the manifest foreach (var pga in assemblyAttrs.Distinct(new PermissionGroupAttribute.PermissionGroupAttributeComparer())) { if (!application.Parent.Descendants("permissionGroup").Any(x => (string)x.Attribute(attName) == pga.Name)) { application.AddBeforeSelf(pga.ToElement(PackageName)); } } }