internal static BinaryTypeEnum GetParserBinaryTypeInfo(Type type, out Object typeInformation)
{
SerTrace.Log("BinaryConverter", "GetParserBinaryTypeInfo Entry type ",type);
BinaryTypeEnum binaryTypeEnum;
typeInformation = null;
if (type == Converter.typeofString)
binaryTypeEnum = BinaryTypeEnum.String;
else if (type == Converter.typeofObject)
binaryTypeEnum = BinaryTypeEnum.Object;
else if (type == Converter.typeofObjectArray)
binaryTypeEnum = BinaryTypeEnum.ObjectArray;
else if (type == Converter.typeofStringArray)
binaryTypeEnum = BinaryTypeEnum.StringArray;
else if (Converter.IsPrimitiveArray(type, out typeInformation))
binaryTypeEnum = BinaryTypeEnum.PrimitiveArray;
else
{
InternalPrimitiveTypeE primitiveTypeEnum = Converter.ToCode(type);
switch (primitiveTypeEnum)
{
case InternalPrimitiveTypeE.Invalid:
if (Assembly.GetAssembly(type) == Converter.urtAssembly)
binaryTypeEnum = BinaryTypeEnum.ObjectUrt;
else
binaryTypeEnum = BinaryTypeEnum.ObjectUser;
typeInformation = type.FullName;
break;
default:
binaryTypeEnum = BinaryTypeEnum.Primitive;
typeInformation = primitiveTypeEnum;
break;
}
}
SerTrace.Log( "BinaryConverter", "GetParserBinaryTypeInfo Exit ",((Enum)binaryTypeEnum).ToString(),", typeInformation ",typeInformation);
return binaryTypeEnum;
}