Imported Upstream version 5.18.0.142

Former-commit-id: 7467d4b717762eeaf652d77f1486dd11ffb1ff1f
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-10-09 08:20:59 +00:00
parent e52655b4dc
commit 0abdbe5a7d
1547 changed files with 93792 additions and 47893 deletions

View File

@ -1,4 +1,4 @@
// System.Reflection.ParameterInfo
// System.Reflection.ParameterInfo
//
// Authors:
// Sean MacIsaac (macisaac@ximian.com)
@ -175,6 +175,41 @@ namespace System.Reflection
return attrs;
}
internal CustomAttributeData[] GetPseudoCustomAttributesData ()
{
int count = 0;
if (IsIn)
count++;
if (IsOut)
count++;
if (IsOptional)
count++;
if (marshalAs != null)
count++;
if (count == 0)
return null;
CustomAttributeData[] attrsData = new CustomAttributeData [count];
count = 0;
if (IsIn)
attrsData [count++] = new CustomAttributeData ((typeof (InAttribute)).GetConstructor (Type.EmptyTypes));
if (IsOptional)
attrsData [count++] = new CustomAttributeData ((typeof (OptionalAttribute)).GetConstructor (Type.EmptyTypes));
if (IsOut)
attrsData [count++] = new CustomAttributeData ((typeof (OutAttribute)).GetConstructor (Type.EmptyTypes));
if (marshalAs != null) {
var ctorArgs = new CustomAttributeTypedArgument[] { new CustomAttributeTypedArgument (typeof (UnmanagedType), marshalAs.Value) };
attrsData [count++] = new CustomAttributeData (
(typeof (MarshalAsAttribute)).GetConstructor (new[] { typeof( UnmanagedType) }),
ctorArgs,
EmptyArray<CustomAttributeNamedArgument>.Value);//FIXME Get named params
}
return attrsData;
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal extern Type[] GetTypeModifiers (bool optional);