Remotely/Shared/Utilities/EnumMapper.cs
2021-07-29 07:57:31 -07:00

19 lines
444 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Remotely.Shared.Utilities
{
public static class EnumMapper
{
public static ToType ToEnum<ToType, FromType>(FromType fromValue)
where ToType : Enum
where FromType : Enum
{
return (ToType)Enum.Parse(typeof(ToType), fromValue.ToString());
}
}
}