internal CustomAttributeData[]? GetPseudoCustomAttributesData()
{
int count = 0;
/* MS.NET doesn't report MethodImplAttribute */
MonoMethodInfo info = MonoMethodInfo.GetMethodInfo(mhandle);
if ((info.iattrs & MethodImplAttributes.PreserveSig) != 0)
{
count++;
}
if ((info.attrs & MethodAttributes.PinvokeImpl) != 0)
{
count++;
}
if (count == 0)
{
return(null);
}
CustomAttributeData[] attrsData = new CustomAttributeData[count];
count = 0;
if ((info.iattrs & MethodImplAttributes.PreserveSig) != 0)
{
attrsData[count++] = new CustomAttributeData((typeof(PreserveSigAttribute)).GetConstructor(Type.EmptyTypes) !);
}
if ((info.attrs & MethodAttributes.PinvokeImpl) != 0)
{
attrsData[count++] = GetDllImportAttributeData() !;
}
return(attrsData);
}