using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bsmd.AIS2Service
{
public static class Util
{
///
/// To test if flag is set please use framework method Enum.HasFlag()
///
///
///
///
///
public static void Set(ref T flags, T flag, bool value) where T : struct
{
int flagsValue = (int)(object)flags;
int flagValue = (int)(object)flag;
if(value)
flags = (T)(object)(flagsValue | flagValue);
else
flags = (T)(object)(flagsValue & (~flagValue));
}
public static string ToDotString(this double value)
{
return value.ToString(CultureInfo.GetCultureInfo("en-GB"));
}
}
}