Пример #1
0
        void AddPermissions(XElement application)
        {
            var assemblyAttrs =
                Assemblies.SelectMany(path => PermissionAttribute.FromCustomAttributeProvider(Resolver.GetAssembly(path)));

            // Add unique permissions to the manifest
            foreach (var pa in assemblyAttrs.Distinct(new PermissionAttribute.PermissionAttributeComparer()))
            {
                if (!application.Parent.Descendants("permission").Any(x => (string)x.Attribute(attName) == pa.Name))
                {
                    application.AddBeforeSelf(pa.ToElement(PackageName));
                }
            }
        }
Пример #2
0
        void AddPermissions(XElement application, List <string> selectedWhitelistAssemblies)
        {
            // Look in user assemblies + whitelist (like Maps)
            var check_assemblies = Assemblies.Union(selectedWhitelistAssemblies);

            var assemblyAttrs =
                check_assemblies.SelectMany(path => PermissionAttribute.FromCustomAttributeProvider(Resolver.GetAssembly(path)));

            // Add unique permissions to the manifest
            foreach (var pa in assemblyAttrs.Distinct(new PermissionAttribute.PermissionAttributeComparer()))
            {
                if (!application.Parent.Descendants("permission").Any(x => (string)x.Attribute(attName) == pa.Name))
                {
                    application.AddBeforeSelf(pa.ToElement(PackageName));
                }
            }
        }