mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-15 01:11:52 +08:00
b1bbe30323
* 为组件增加GetParametersHashCode()扩展方法,以支持控制组件的渲染方式; 为Table组件增加RenderMode的渲染模式参数; * fix: translate the comments Co-authored-by: ElderJames <shunjiey@hotmail.com>
33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
namespace AntDesign.Core.HashCodes
|
|
{
|
|
/// <summary>
|
|
/// Provides a hash comparison of two parameter values
|
|
/// </summary>
|
|
/// <typeparam name="TParameter"></typeparam>
|
|
static class HashCode<TParameter>
|
|
{
|
|
private static readonly HashCodeProvider _provider = HashCodeProvider.Create(typeof(TParameter));
|
|
|
|
/// <summary>
|
|
/// Calculate whether the hash of two parameter values is equal
|
|
/// </summary>
|
|
/// <param name="parameter1">Parameter 1</param>
|
|
/// <param name="parameter2">Parameter 2</param>
|
|
/// <returns></returns>
|
|
public static bool HashCodeEquals(TParameter parameter1, TParameter parameter2)
|
|
{
|
|
return GetHashCode(parameter1) == GetHashCode(parameter2);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Calculate the hash value of the parameter
|
|
/// </summary>
|
|
/// <param name="parameter">Parameter</param>
|
|
/// <returns></returns>
|
|
public static int GetHashCode(TParameter parameter)
|
|
{
|
|
return _provider.GetHashCode(parameter);
|
|
}
|
|
}
|
|
}
|