public static void Register(Transmuter transmuter) { transmuter.Register(FromTimestamp()); transmuter.Register(ToTimestamp()); transmuter.Register(FromString()); transmuter.Register(new ToStringConverter <DateTime>()); }
public static void Register(Transmuter transmuter) { transmuter.Register(FromInts()); transmuter.Register(ToInts()); transmuter.Register(FromFloats()); transmuter.Register(ToFloats()); }
public static void Register(Transmuter transmuter) { //bytes transmuter.Register(new RelayConverter <short, byte[]>(x => BitConverter.GetBytes(x))); transmuter.Register(new RelayConverter <int, byte[]>(x => BitConverter.GetBytes(x))); transmuter.Register(new RelayConverter <long, byte[]>(x => BitConverter.GetBytes(x))); transmuter.Register(new RelayConverter <float, byte[]>(x => BitConverter.GetBytes(x))); transmuter.Register(new RelayConverter <double, byte[]>(x => BitConverter.GetBytes(x))); transmuter.Register(new RelayConverter <bool, byte[]>(x => BitConverter.GetBytes(x))); transmuter.Register(new RelayConverter <byte[], short>(x => BitConverter.ToInt16(x, 0))); transmuter.Register(new RelayConverter <byte[], int>(x => BitConverter.ToInt32(x, 0))); transmuter.Register(new RelayConverter <byte[], long>(x => BitConverter.ToInt64(x, 0))); transmuter.Register(new RelayConverter <byte[], float>(x => BitConverter.ToSingle(x, 0))); transmuter.Register(new RelayConverter <byte[], double>(x => BitConverter.ToDouble(x, 0))); transmuter.Register(new RelayConverter <byte[], bool>(x => BitConverter.ToBoolean(x, 0))); //Casts transmuter.Register(new CastConverter <int, short>()); transmuter.Register(new CastConverter <short, int>()); transmuter.Register(new CastConverter <int, long>()); transmuter.Register(new CastConverter <long, int>()); transmuter.Register(new CastConverter <int, float>()); transmuter.Register(new CastConverter <float, int>()); transmuter.Register(new CastConverter <int, double>()); transmuter.Register(new CastConverter <double, int>()); transmuter.Register(new CastConverter <float, double>()); transmuter.Register(new CastConverter <double, float>()); //bool transmuter.Register(new RelayConverter <int, bool>(x => x > 0)); transmuter.Register(new RelayConverter <bool, int>(x => x ? 1 : 0)); transmuter.Register(new RelayConverter <bool, bool>(x => !x), "invert"); }
public static void Register(Transmuter transmuter) { transmuter.Register(FromBytes()); transmuter.Register(ToBytes()); transmuter.Register(FromInt()); transmuter.Register(ToInt()); transmuter.Register(FromBool()); transmuter.Register(ToBool()); }
public static void Register(Transmuter transmuter) { //Casts transmuter.Register(new RelayConverter <nint, int>(x => (int)x)); transmuter.Register(new RelayConverter <int, nint>(x => new nint(x))); transmuter.Register(new RelayConverter <nint, float>(x => (int)x)); transmuter.Register(new RelayConverter <float, nint>(x => new nint((int)x))); transmuter.Register(new RelayConverter <nint, double>(x => (int)x)); transmuter.Register(new RelayConverter <double, nint>(x => new nint((int)x))); transmuter.Register(new RelayConverter <nfloat, int>(x => (int)x)); transmuter.Register(new RelayConverter <int, nfloat>(x => new nfloat(x))); transmuter.Register(new RelayConverter <nfloat, float>(x => (float)x)); transmuter.Register(new RelayConverter <float, nfloat>(x => new nfloat(x))); transmuter.Register(new RelayConverter <nfloat, double>(x => x)); transmuter.Register(new RelayConverter <double, nfloat>(x => new nfloat(x))); }
public static void Register(Transmuter transmuter) { transmuter.Register(FromString()); }
public static void Register(Transmuter transmuter) { transmuter.Register(FromDateTime()); transmuter.Register(ToDateTime()); }