private static string GetCustomAssemblyMetadata (string attrName, string field)
{
Assembly assembly = Assembly.GetEntryAssembly ();
if (assembly == null) {
return null;
}
foreach (Attribute attribute in assembly.GetCustomAttributes (false)) {
Type type = attribute.GetType ();
PropertyInfo property = type.GetProperty (field);
if (type.Name == attrName && property != null &&
property.PropertyType == typeof (string)) {
return (string)property.GetValue (attribute, null);
}
}
return null;
}
}