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

◆ InstanceDescriptor() [2/2]

System.ComponentModel.Design.Serialization.InstanceDescriptor.InstanceDescriptor ( MemberInfo? member,
ICollection? arguments,
bool isComplete )
inline

Definition at line 19 of file InstanceDescriptor.cs.

20 {
21 MemberInfo = member;
22 IsComplete = isComplete;
23 if (arguments == null)
24 {
25 Arguments = Array.Empty<object>();
26 }
27 else
28 {
29 object[] array = new object[arguments.Count];
30 arguments.CopyTo(array, 0);
32 }
33 if (member is FieldInfo fieldInfo)
34 {
35 if (!fieldInfo.IsStatic)
36 {
38 }
39 if (Arguments.Count != 0)
40 {
42 }
43 }
44 else if (member is ConstructorInfo constructorInfo)
45 {
46 if (constructorInfo.IsStatic)
47 {
49 }
50 if (Arguments.Count != constructorInfo.GetParameters().Length)
51 {
53 }
54 }
55 else if (member is MethodInfo methodInfo)
56 {
57 if (!methodInfo.IsStatic)
58 {
60 }
61 if (Arguments.Count != methodInfo.GetParameters().Length)
62 {
64 }
65 }
66 else if (member is PropertyInfo propertyInfo)
67 {
68 if (!propertyInfo.CanRead)
69 {
71 }
72 MethodInfo getMethod = propertyInfo.GetGetMethod();
73 if (getMethod != null && !getMethod.IsStatic)
74 {
76 }
77 }
78 }
static string InstanceDescriptorMustBeReadable
Definition SR.cs:102
static string InstanceDescriptorLengthMismatch
Definition SR.cs:104
static string InstanceDescriptorMustBeStatic
Definition SR.cs:100
static string InstanceDescriptorCannotBeStatic
Definition SR.cs:98
Definition SR.cs:7
void CopyTo(Array array, int index)

References System.ComponentModel.Design.Serialization.InstanceDescriptor.Arguments, System.array, System.Collections.ICollection.CopyTo(), System.Collections.ICollection.Count, System.SR.InstanceDescriptorCannotBeStatic, System.SR.InstanceDescriptorLengthMismatch, System.SR.InstanceDescriptorMustBeReadable, System.SR.InstanceDescriptorMustBeStatic, System.ComponentModel.Design.Serialization.InstanceDescriptor.IsComplete, and System.Reflection.MethodBase.IsStatic.