Banshee.ServiceStack.Application.GetCustomAssemblyMetadata C# (CSharp) Method

GetCustomAssemblyMetadata() private static method

private static GetCustomAssemblyMetadata ( string attrName, string field ) : string
attrName string
field string
return string
        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;
        }
    }