AK.F1.Timing.Serialization.SerializationHelper.GetObjectTypeCode C# (CSharp) Method

GetObjectTypeCode() public static method

Returns the ObjectTypeCode for the specified type.
/// Thrown when is . ///
public static GetObjectTypeCode ( this type ) : ObjectTypeCode
type this The type.
return ObjectTypeCode
        public static ObjectTypeCode GetObjectTypeCode(this Type type)
        {
            Guard.NotNull(type, "type");

            TypeCode clrTypeCode = Type.GetTypeCode(type);

            if(clrTypeCode == TypeCode.Object)
            {
                if(type == TimespanType)
                {
                    return ObjectTypeCode.TimeSpan;
                }
            }

            return (ObjectTypeCode)clrTypeCode;
        }