■ 어셈블리 타이틀 구하기

----------------------------------------------------------------------------------------------------

using System.Reflection;

 

#region 어셈블리 타이틀 구하기 - GetAssemblyTitle(assembly)

 

/// <summary>

/// 어셈블리 타이틀 구하기

/// </summary>

/// <param name="assembly">어셈블리</param>

/// <returns>어셈블리 타이틀</returns>

public string GetAssemblyTitle(Assembly assembly)

{

    object[] customAttributeArray = assembly.GetCustomAttributes(typeof(AssemblyTitleAttribute), false);

 

    if(customAttributeArray == null || customAttributeArray.Length == 0)

    {

        return null;

    }

 

    AssemblyTitleAttribute assemblyTitleAttribute = customAttributeArray[0] as AssemblyTitleAttribute;

 

    return assemblyTitleAttribute.Title;

}

 

#endregion

----------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker