■ 리소스 URI 구하기

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

using System;

 

#region 리소스 URI 구하기 - GetResourceURI(resourcePath)

 

/// <summary>

/// 리소스 URI 구하기

/// </summary>

/// <param name="resourcePath">리소스 경로</param>

/// <returns>리소스 URI</returns>

public Uri GetResourceURI(string resourcePath)

{

    return new Uri(string.Format("pack://application:,,,/{0}", resourcePath));

}

 

#endregion

 

#region 리소스 URI 구하기 - GetResourceURI(assemblyName, resourcePath)

 

/// <summary>

/// 리소스 URI 구하기

/// </summary>

/// <param name="assemblyName">어셈블리명</param>

/// <param name="resourcePath">리소스 경로</param>

/// <returns>리소스 URI</returns>

public Uri GetResourceURI(string assemblyName, string resourcePath)

{

    return new Uri(string.Format("pack://application:,,,/{0};component/{1}", assemblyName, resourcePath));

}

 

#endregion

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

Posted by 사용자 icodebroker
TAG