Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CreateSetter()

static Setter System.Runtime.Serialization.FastInvokerBuilder.CreateSetter ( MemberInfo memberInfo)
inlinestatic

Definition at line 45 of file FastInvokerBuilder.cs.

46 {
48 {
49 PropertyInfo propertyInfo = (PropertyInfo)memberInfo;
50 if (propertyInfo.CanWrite)
51 {
52 Func<PropertyInfo, Setter> func = s_createSetterInternal.MakeGenericMethod(propertyInfo.DeclaringType, propertyInfo.PropertyType).CreateDelegate<Func<PropertyInfo, Setter>>();
53 return func(propertyInfo);
54 }
55 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.SR.Format(System.SR.NoSetMethodForProperty, propertyInfo.DeclaringType, propertyInfo.Name)));
56 }
58 {
60 return delegate(ref object obj, object val)
61 {
63 };
64 }
65 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.SR.Format(System.SR.InvalidMember, DataContract.GetClrTypeFullName(memberInfo.DeclaringType), memberInfo.Name)));
66 }
void SetValue(object? obj, object? value)
Definition FieldInfo.cs:108
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string NoSetMethodForProperty
Definition SR.cs:218
static string InvalidMember
Definition SR.cs:154
Definition SR.cs:7

References System.Reflection.PropertyInfo.CanWrite, System.Reflection.MemberInfo.DeclaringType, System.Runtime.Serialization.Dictionary, System.SR.Format(), System.Runtime.Serialization.DataContract.GetClrTypeFullName(), System.SR.InvalidMember, System.Reflection.MemberInfo.Name, System.SR.NoSetMethodForProperty, System.obj, System.Reflection.PropertyInfo.PropertyType, System.Runtime.Serialization.FastInvokerBuilder.s_createSetterInternal, System.Reflection.FieldInfo.SetValue(), and System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError().