36 if (constructorArgs ==
null)
40 if (namedProperties ==
null)
44 if (propertyValues ==
null)
48 if (namedFields ==
null)
52 if (fieldValues ==
null)
56 if (namedProperties.Length != propertyValues.Length)
60 if (namedFields.Length != fieldValues.Length)
76 if (parameterTypes.Length != constructorArgs.Length)
80 for (
int i = 0; i < parameterTypes.Length; i++)
87 for (
int i = 0; i < parameterTypes.Length; i++)
89 object obj = constructorArgs[i];
92 if (parameterTypes[i].IsValueType)
104 binaryWriter.
Write((ushort)1);
105 for (
int i = 0; i < constructorArgs.Length; i++)
107 EmitValue(binaryWriter, parameterTypes[i], constructorArgs[i]);
109 binaryWriter.
Write((ushort)(namedProperties.Length + namedFields.Length));
110 for (
int i = 0; i < namedProperties.Length; i++)
113 if (propertyInfo ==
null)
118 object obj2 = propertyValues[i];
139 binaryWriter.
Write((
byte)84);
140 EmitType(binaryWriter, propertyType);
142 EmitValue(binaryWriter, propertyType, obj2);
144 for (
int i = 0; i < namedFields.Length; i++)
147 if (fieldInfo ==
null)
152 object obj3 = fieldValues[i];
169 binaryWriter.
Write((
byte)83);
172 EmitValue(binaryWriter, fieldType, obj3);
187 if (t == typeof(
string) || t == typeof(
Type))
194 if ((uint)(typeCode - 5) <= 7u)
208 return t == typeof(
object);
217 if (passedType == typeof(
IntPtr) || passedType == typeof(
UIntPtr))
225 if (
type.IsPrimitive)
267 else if (
type.IsEnum)
272 else if (
type == typeof(
string))
280 else if (
type.IsArray)
294 uint num = (uint)
bytes.Length;
299 else if (num <= 16383)
343 if (
type == typeof(
string))
374 writer.Write(uint.MaxValue);
380 for (
int i = 0; i <
array.Length; i++)
386 if (
type.IsPrimitive)
429 if (
type == typeof(
object))
432 if (type2 == typeof(
object))
443 p =
value.GetType().ToString();
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
static sbyte ReverseEndianness(sbyte value)
static ushort ToUInt16(object? value)
static Type GetUnderlyingType(Type enumType)
virtual Stream BaseStream
virtual void Write(bool value)
static void EmitType(BinaryWriter writer, Type type)
CustomAttributeBuilder(ConstructorInfo con, object?[] constructorArgs, FieldInfo[] namedFields, object?[] fieldValues)
void CreateCustomAttribute(ModuleBuilder mod, int tkOwner)
object[] m_constructorArgs
static void EmitString(BinaryWriter writer, string str)
CustomAttributeBuilder(ConstructorInfo con, object?[] constructorArgs)
static void EmitValue(BinaryWriter writer, Type type, object value)
CustomAttributeBuilder(ConstructorInfo con, object?[] constructorArgs, PropertyInfo[] namedProperties, object?[] propertyValues, FieldInfo[] namedFields, object?[] fieldValues)
CustomAttributeBuilder(ConstructorInfo con, object?[] constructorArgs, PropertyInfo[] namedProperties, object?[] propertyValues)
static void VerifyTypeAndPassedObjectType(Type type, Type passedType, string paramName)
bool ValidateType(Type t)
int GetConstructorToken(ConstructorInfo con)
static bool IsTypeEqual(Type t1, Type t2)
static void DefineCustomAttribute(QCallModule module, int tkAssociate, int tkConstructor, byte[] attr, int attrLength)
override string ToString()
virtual Type[] GetParameterTypes()
virtual CallingConventions CallingConvention
MethodAttributes Attributes
static string Argument_BadParameterTypeForCAB
static string Argument_BadParameterCountsForConstructor
static string Argument_BadPropertyForConstructorBuilder
static string Format(string resourceFormat, object p1)
static string Argument_ConstantDoesntMatch
static string Argument_BadTypeInCustomAttribute
static string Argument_NotAWritableProperty
static string Arg_ArrayLengthsDiffer
static string Argument_BadFieldForConstructorBuilder
static string Argument_InvalidTypeForCA
static string Argument_BadConstructor
static string Argument_BadConstructorCallConv
static ? Type GetType(string typeName, bool throwOnError, bool ignoreCase)
virtual int GetArrayRank()
static TypeCode GetTypeCode(Type? type)
virtual bool IsSubclassOf(Type c)