将Feature/XP.Common和Feature/XP.Hardware分支合并至Develop/XP.forHardwareAndCommon,完善XPapp注册和相关硬件类库通用类库功能。
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
|
||||
namespace XP.Common.Localization.Exceptions
|
||||
{
|
||||
/// <summary>
|
||||
/// 本地化异常基类 | Localization exception base class
|
||||
/// </summary>
|
||||
public class LocalizationException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数 | Constructor
|
||||
/// </summary>
|
||||
/// <param name="message">异常消息 | Exception message</param>
|
||||
public LocalizationException(string message) : base(message)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数 | Constructor
|
||||
/// </summary>
|
||||
/// <param name="message">异常消息 | Exception message</param>
|
||||
/// <param name="innerException">内部异常 | Inner exception</param>
|
||||
public LocalizationException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
|
||||
namespace XP.Common.Localization.Exceptions
|
||||
{
|
||||
/// <summary>
|
||||
/// 本地化初始化异常 | Localization initialization exception
|
||||
/// 当资源文件无法加载时抛出 | Thrown when resource files cannot be loaded
|
||||
/// </summary>
|
||||
public class LocalizationInitializationException : LocalizationException
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数 | Constructor
|
||||
/// </summary>
|
||||
/// <param name="message">异常消息 | Exception message</param>
|
||||
public LocalizationInitializationException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数 | Constructor
|
||||
/// </summary>
|
||||
/// <param name="message">异常消息 | Exception message</param>
|
||||
/// <param name="innerException">内部异常 | Inner exception</param>
|
||||
public LocalizationInitializationException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
|
||||
namespace XP.Common.Localization.Exceptions
|
||||
{
|
||||
/// <summary>
|
||||
/// 资源键未找到异常 | Resource key not found exception
|
||||
/// </summary>
|
||||
public class ResourceKeyNotFoundException : LocalizationException
|
||||
{
|
||||
/// <summary>
|
||||
/// 资源键 | Resource key
|
||||
/// </summary>
|
||||
public string ResourceKey { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数 | Constructor
|
||||
/// </summary>
|
||||
/// <param name="resourceKey">资源键 | Resource key</param>
|
||||
public ResourceKeyNotFoundException(string resourceKey)
|
||||
: base($"Resource key not found: {resourceKey}")
|
||||
{
|
||||
ResourceKey = resourceKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user