<refactor>

This commit is contained in:
2022-12-15 14:12:34 +08:00
parent 9ae1046dca
commit 3095dc783e
33 changed files with 644 additions and 259 deletions

View File

@ -1,15 +1,15 @@
namespace NSExt.Extensions;
/// <summary>
/// LongExtensions
/// </summary>
public static class LongExtensions
{
/// <summary>
/// 判断枚举是否包含某个位
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="me"></param>
/// <param name="flag"></param>
/// <returns></returns>
public static bool HasFlag<T>(this long me, T flag) where T : Enum
public static bool HasFlag<T>(this long me, T flag)
where T : Enum
{
var val = (long)(object)flag;
return (me & val) == val;
@ -18,8 +18,6 @@ public static class LongExtensions
/// <summary>
/// 1970毫秒数转换成日期对象
/// </summary>
/// <param name="msFrom1970"></param>
/// <returns></returns>
public static DateTime Time(this long msFrom1970)
{
return new DateTime(1970, 1, 1).AddMilliseconds(msFrom1970).ToLocalTime();