Imported Upstream version 5.10.0.47

Former-commit-id: d0813289fa2d35e1f8ed77530acb4fb1df441bc0
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-01-24 17:04:36 +00:00
parent 88ff76fe28
commit e46a49ecf1
5927 changed files with 226314 additions and 129848 deletions

View File

@ -46,6 +46,11 @@ namespace System.Reflection.Emit {
public class CustomAttributeBuilder : _CustomAttributeBuilder {
ConstructorInfo ctor;
byte[] data;
object [] args;
PropertyInfo [] namedProperties;
object [] propertyValues;
FieldInfo [] namedFields;
object [] fieldValues;
internal ConstructorInfo Ctor {
get {return ctor;}
@ -57,7 +62,20 @@ namespace System.Reflection.Emit {
[MethodImplAttribute(MethodImplOptions.InternalCall)]
static extern byte[] GetBlob(Assembly asmb, ConstructorInfo con, object[] constructorArgs, PropertyInfo[] namedProperties, object[] propertyValues, FieldInfo[] namedFields, object[] fieldValues);
internal object Invoke ()
{
object result = ctor.Invoke (args);
for (int i=0; i < namedFields.Length; i++)
namedFields [i].SetValue (result, fieldValues [i]);
for (int i=0; i < namedProperties.Length; i++)
namedProperties [i].SetValue (result, propertyValues [i]);
return result;
}
internal CustomAttributeBuilder( ConstructorInfo con, byte[] binaryAttribute) {
if (con == null)
throw new ArgumentNullException ("con");
@ -140,6 +158,12 @@ namespace System.Reflection.Emit {
FieldInfo [] namedFields, object [] fieldValues)
{
ctor = con;
args = constructorArgs;
this.namedProperties = namedProperties;
this.propertyValues = propertyValues;
this.namedFields = namedFields;
this.fieldValues = fieldValues;
if (con == null)
throw new ArgumentNullException ("con");
if (constructorArgs == null)