So many thanks for all your great help end valuable time .
i still need your help to port this code :
Code:
internal static void PrintValue(object value, Type valueType)
{
if (value == null)
{
Console.WriteLine(valueType);
return;
}
var type = value.GetType();
switch (Type.GetTypeCode(type))
{
case TypeCode.Int32: Console.WriteLine((int)value); break;
case TypeCode.Int64: Console.WriteLine((long)value); break;
case TypeCode.UInt32: Console.WriteLine((uint)value); break;
case TypeCode.UInt64: Console.WriteLine((ulong)value); break;
case TypeCode.Double: Console.WriteLine((double)value); break;
case TypeCode.String: Console.WriteLine((string)value); break;
case TypeCode.Boolean: Console.WriteLine((bool)value ? true : false); break;
case TypeCode.DateTime: Console.WriteLine((DateTime)value); break;
case TypeCode.Object:
if (type.IsArray)
if (value is byte[] bytes)
Console.WriteLine(bytes);
else if (value is Int128 int128)
Console.WriteLine(int128);
else if (value is Int256 int256)
Console.WriteLine(int256);
else if (value is IObject MyObject)
Console.WriteLine(MyObject);
else if (type.IsEnum)
Console.WriteLine((uint)value);
else
break;
default:
break;
}
}