Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ParameterBuilder.cs
Go to the documentation of this file.
2
4
5public class ParameterBuilder
6{
7 private readonly string _name;
8
9 private readonly int _position;
10
12
14
15 private int _token;
16
17 public virtual string? Name => _name;
18
19 public virtual int Position => _position;
20
21 public virtual int Attributes => (int)_attributes;
22
23 public bool IsIn => (_attributes & ParameterAttributes.In) != 0;
24
25 public bool IsOut => (_attributes & ParameterAttributes.Out) != 0;
26
27 public bool IsOptional => (_attributes & ParameterAttributes.Optional) != 0;
28
29 public virtual void SetConstant(object? defaultValue)
30 {
32 }
33
34 public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
35 {
36 if (con == null)
37 {
38 throw new ArgumentNullException("con");
39 }
40 if (binaryAttribute == null)
41 {
42 throw new ArgumentNullException("binaryAttribute");
43 }
45 }
46
47 public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
48 {
49 if (customBuilder == null)
50 {
51 throw new ArgumentNullException("customBuilder");
52 }
54 }
55
56 internal ParameterBuilder(MethodBuilder methodBuilder, int sequence, ParameterAttributes attributes, string paramName)
57 {
58 _position = sequence;
59 _name = paramName;
60 _methodBuilder = methodBuilder;
61 _attributes = attributes;
63 _token = TypeBuilder.SetParamInfo(new QCallModule(ref module), _methodBuilder.MetadataToken, sequence, attributes, paramName);
64 }
65}
void CreateCustomAttribute(ModuleBuilder mod, int tkOwner)
void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
void SetCustomAttribute(CustomAttributeBuilder customBuilder)
virtual void SetConstant(object? defaultValue)
ParameterBuilder(MethodBuilder methodBuilder, int sequence, ParameterAttributes attributes, string paramName)
readonly ParameterAttributes _attributes
static int SetParamInfo(QCallModule module, int tkMethod, int iSequence, ParameterAttributes iParamAttributes, string strParamName)
static void DefineCustomAttribute(QCallModule module, int tkAssociate, int tkConstructor, byte[] attr, int attrLength)
static unsafe void SetConstantValue(QCallModule module, int tk, int corType, void *pValue)