MGPackager.MainWindow.GetAttribute C# (CSharp) Method

GetAttribute() private method

private GetAttribute ( Assembly assembly, Type type ) : string
assembly System.Reflection.Assembly
type System.Type
return string
        private string GetAttribute(Assembly assembly, Type type)
        {
            object[] attributes = assembly.GetCustomAttributes(type, false);

            if (attributes.Length == 0)
                return "";

            return type.GetProperties()[0].GetValue(attributes[0], null).ToString();
        }