コード例 #1
0
        private LocalizedName[] GetLocalizedNames(MetadataCache cache, CultureInfo culture)
        {
            List <LocalizedName> localizedNames = new List <LocalizedName> ();

            AddNames(localizedNames, cache.GetSecurableClassInfos(), CreateLocalizedNameFromClassInfo);
            AddNames(localizedNames, cache.GetAbstractRoles(), CreateLocalizedNameFromEnumValueInfo);
            AddNames(localizedNames, cache.GetAccessTypes(), CreateLocalizedNameFromEnumValueInfo);
            AddStateNames(localizedNames, cache.GetStatePropertyInfos());

            return(localizedNames.ToArray());
        }
コード例 #2
0
        public XmlDocument Convert(MetadataCache cache)
        {
            ArgumentUtility.CheckNotNull("cache", cache);

            XmlDocument    document    = new XmlDocument();
            XmlDeclaration declaration = document.CreateXmlDeclaration("1.0", string.Empty, string.Empty);

            document.AppendChild(declaration);

            XmlElement rootElement = document.CreateElement("securityMetadata", _metadataSchema.SchemaUri);

            AppendCollection(document, rootElement, "classes", cache.GetSecurableClassInfos(), CreateClassNode);
            AppendCollection(document, rootElement, "stateProperties", cache.GetStatePropertyInfos(), CreateStatePropertyNode);
            AppendCollection(document, rootElement, "accessTypes", cache.GetAccessTypes(), CreateAccessTypeNode);
            AppendCollection(document, rootElement, "abstractRoles", cache.GetAbstractRoles(), CreateAbstractRoleNode);

            document.AppendChild(rootElement);
            return(document);
        }