Exemplo n.º 1
0
        internal static int SizeOf(Type type)
        {
            int num = 0;

            if (MarshalingUtils.ValueTypeSizeMap.ContainsKey(type))
            {
                num = MarshalingUtils.ValueTypeSizeMap[type];
            }
            else if (XDRPCMarshaler.IsValidStructType(type))
            {
                MarshalingUtils.GetStructSizes(type);
                num = MarshalingUtils.ValueTypeSizeMap[type];
            }
            return(num);
        }
Exemplo n.º 2
0
        internal static int AlignmentOf(Type type)
        {
            int num = 0;

            if (MarshalingUtils.StructPrimitiveSizeMap.ContainsKey(type))
            {
                num = MarshalingUtils.StructPrimitiveSizeMap[type];
            }
            else if (XDRPCMarshaler.IsValidStructType(type))
            {
                MarshalingUtils.GetStructSizes(type);
                num = MarshalingUtils.StructPrimitiveSizeMap[type];
            }
            else if (type.IsPrimitive)
            {
                num = MarshalingUtils.SizeOf(type);
            }
            return(num);
        }