Пример #1
0
        public static LicenseInfo FromMetadata(Dictionary<string, string> properties)
        {
            if(!properties.ContainsKey("rights (en)"))
                throw new ApplicationException("A license property is required in order to make a  Custom License from metadata.");

            var license = new CustomLicense();
            license.RightsStatement = properties["rights (en)"];
            return license;
        }
Пример #2
0
        public static LicenseInfo FromMetadata(Dictionary <string, string> properties)
        {
            if (!properties.ContainsKey("rights (en)"))
            {
                throw new ApplicationException("A license property is required in order to make a  Custom License from metadata.");
            }

            var license = new CustomLicense();

            license.RightsStatement = properties["rights (en)"];
            return(license);
        }
Пример #3
0
 public static LicenseInfo FromXmp(Dictionary <string, string> properties)
 {
     if (properties.ContainsKey("license") && properties["license"].Contains("creativecommons"))
     {
         return(CreativeCommonsLicense.FromMetadata(properties));
     }
     else if (properties.ContainsKey("rights (en)"))
     {
         return(CustomLicense.FromMetadata(properties));
     }
     return(new NullLicense());
 }