/
PropertyBuilder.cs
49 lines (35 loc) · 1.61 KB
/
PropertyBuilder.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Reflection.Emit
{
public abstract class PropertyBuilder : PropertyInfo
{
protected PropertyBuilder()
{
}
public void AddOtherMethod(MethodBuilder mdBuilder)
=> AddOtherMethodCore(mdBuilder);
protected abstract void AddOtherMethodCore(MethodBuilder mdBuilder);
public void SetConstant(object? defaultValue)
=> SetConstantCore(defaultValue);
protected abstract void SetConstantCore(object? defaultValue);
public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
{
ArgumentNullException.ThrowIfNull(con);
ArgumentNullException.ThrowIfNull(binaryAttribute);
SetCustomAttributeCore(con, binaryAttribute);
}
protected abstract void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan<byte> binaryAttribute);
public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
{
ArgumentNullException.ThrowIfNull(customBuilder);
SetCustomAttributeCore(customBuilder.Ctor, customBuilder.Data);
}
public void SetGetMethod(MethodBuilder mdBuilder)
=> SetGetMethodCore(mdBuilder);
protected abstract void SetGetMethodCore(MethodBuilder mdBuilder);
public void SetSetMethod(MethodBuilder mdBuilder)
=> SetSetMethodCore(mdBuilder);
protected abstract void SetSetMethodCore(MethodBuilder mdBuilder);
}
}