Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
PropertyDefinition.cs
Go to the documentation of this file.
1
using
System.Collections.Immutable
;
2
using
System.Reflection.Metadata.Ecma335
;
3
4
namespace
System.Reflection.Metadata
;
5
6
public
readonly
struct
PropertyDefinition
7
{
8
private
readonly
MetadataReader
_reader
;
9
10
private
readonly
int
_rowId
;
11
12
private
PropertyDefinitionHandle
Handle
=>
PropertyDefinitionHandle
.
FromRowId
(
_rowId
);
13
14
public
StringHandle
Name
=>
_reader
.
PropertyTable
.
GetName
(
Handle
);
15
16
public
PropertyAttributes
Attributes
=>
_reader
.
PropertyTable
.
GetFlags
(
Handle
);
17
18
public
BlobHandle
Signature
=>
_reader
.
PropertyTable
.
GetSignature
(
Handle
);
19
20
internal
PropertyDefinition
(
MetadataReader
reader,
PropertyDefinitionHandle
handle
)
21
{
22
_reader
= reader;
23
_rowId
=
handle
.RowId;
24
}
25
26
public
MethodSignature<TType>
DecodeSignature<TType, TGenericContext>
(
ISignatureTypeProvider<TType, TGenericContext>
provider, TGenericContext genericContext)
27
{
28
SignatureDecoder<TType, TGenericContext>
signatureDecoder =
new
SignatureDecoder<TType, TGenericContext>
(provider,
_reader
, genericContext);
29
BlobReader
blobReader =
_reader
.
GetBlobReader
(
Signature
);
30
return
signatureDecoder.
DecodeMethodSignature
(ref blobReader);
31
}
32
33
public
ConstantHandle
GetDefaultValue
()
34
{
35
return
_reader
.
ConstantTable
.
FindConstant
(
Handle
);
36
}
37
38
public
CustomAttributeHandleCollection
GetCustomAttributes
()
39
{
40
return
new
CustomAttributeHandleCollection
(
_reader
,
Handle
);
41
}
42
43
public
PropertyAccessors
GetAccessors
()
44
{
45
int
getterRowId = 0;
46
int
setterRowId = 0;
47
ImmutableArray<MethodDefinitionHandle>
.
Builder
builder =
null
;
48
ushort methodCount;
49
int
num =
_reader
.
MethodSemanticsTable
.
FindSemanticMethodsForProperty
(
Handle
, out methodCount);
50
for
(ushort num2 = 0; num2 < methodCount; num2++)
51
{
52
int
rowId = num + num2;
53
switch
(
_reader
.
MethodSemanticsTable
.
GetSemantics
(rowId))
54
{
55
case
MethodSemanticsAttributes
.Getter:
56
getterRowId =
_reader
.
MethodSemanticsTable
.
GetMethod
(rowId).
RowId
;
57
break
;
58
case
MethodSemanticsAttributes
.Setter:
59
setterRowId =
_reader
.
MethodSemanticsTable
.
GetMethod
(rowId).
RowId
;
60
break
;
61
case
MethodSemanticsAttributes
.Other:
62
if
(builder ==
null
)
63
{
64
builder =
ImmutableArray
.CreateBuilder<
MethodDefinitionHandle
>();
65
}
66
builder.Add(
_reader
.
MethodSemanticsTable
.
GetMethod
(rowId));
67
break
;
68
}
69
}
70
ImmutableArray<MethodDefinitionHandle>
others = builder?.ToImmutable() ??
ImmutableArray<MethodDefinitionHandle>
.
Empty
;
71
return
new
PropertyAccessors
(getterRowId, setterRowId, others);
72
}
73
}
System.Collections.Immutable.ImmutableArray.Builder
Definition
ImmutableArray.cs:227
System.Collections.Immutable.ImmutableArray.Empty
static readonly ImmutableArray< T > Empty
Definition
ImmutableArray.cs:760
System.Collections.Immutable.ImmutableArray
Definition
ImmutableArray.cs:223
System.Reflection.Metadata.MetadataReader.MethodSemanticsTable
MethodSemanticsTableReader MethodSemanticsTable
Definition
MetadataReader.cs:123
System.Reflection.Metadata.MetadataReader.ConstantTable
ConstantTableReader ConstantTable
Definition
MetadataReader.cs:97
System.Reflection.Metadata.MetadataReader.GetBlobReader
BlobReader GetBlobReader(BlobHandle handle)
Definition
MetadataReader.cs:944
System.Reflection.Metadata.MetadataReader.PropertyTable
PropertyTableReader PropertyTable
Definition
MetadataReader.cs:121
System.Reflection.Metadata.MetadataReader
Definition
MetadataReader.cs:12
System.Signature
Definition
Signature.cs:8
System.Reflection.Metadata.ISignatureTypeProvider
Definition
ISignatureTypeProvider.cs:4
System.Collections.Immutable
Definition
AllocFreeConcurrentStack.cs:4
System.Reflection.Metadata.Ecma335
Definition
ArrayShapeEncoder.cs:3
System.Reflection.Metadata
Definition
AssemblyExtensions.cs:4
System.Reflection.MethodSemanticsAttributes
MethodSemanticsAttributes
Definition
MethodSemanticsAttributes.cs:5
System.Reflection.PropertyAttributes
PropertyAttributes
Definition
PropertyAttributes.cs:5
System.ExceptionArgument.handle
@ handle
System.Reflection.Metadata.BlobHandle
Definition
BlobHandle.cs:6
System.Reflection.Metadata.BlobReader
Definition
BlobReader.cs:10
System.Reflection.Metadata.ConstantHandle
Definition
ConstantHandle.cs:4
System.Reflection.Metadata.CustomAttributeHandleCollection
Definition
CustomAttributeHandleCollection.cs:7
System.Reflection.Metadata.Ecma335.ConstantTableReader.FindConstant
ConstantHandle FindConstant(EntityHandle parentHandle)
Definition
ConstantTableReader.cs:57
System.Reflection.Metadata.Ecma335.MethodSemanticsTableReader.GetMethod
MethodDefinitionHandle GetMethod(int rowId)
Definition
MethodSemanticsTableReader.cs:39
System.Reflection.Metadata.Ecma335.MethodSemanticsTableReader.GetSemantics
MethodSemanticsAttributes GetSemantics(int rowId)
Definition
MethodSemanticsTableReader.cs:45
System.Reflection.Metadata.Ecma335.MethodSemanticsTableReader.FindSemanticMethodsForProperty
int FindSemanticMethodsForProperty(PropertyDefinitionHandle propertyDef, out ushort methodCount)
Definition
MethodSemanticsTableReader.cs:64
System.Reflection.Metadata.Ecma335.PropertyTableReader.GetFlags
PropertyAttributes GetFlags(PropertyDefinitionHandle handle)
Definition
PropertyTableReader.cs:35
System.Reflection.Metadata.Ecma335.PropertyTableReader.GetSignature
BlobHandle GetSignature(PropertyDefinitionHandle handle)
Definition
PropertyTableReader.cs:47
System.Reflection.Metadata.Ecma335.PropertyTableReader.GetName
StringHandle GetName(PropertyDefinitionHandle handle)
Definition
PropertyTableReader.cs:41
System.Reflection.Metadata.Ecma335.SignatureDecoder.DecodeMethodSignature
MethodSignature< TType > DecodeMethodSignature(ref BlobReader blobReader)
Definition
SignatureDecoder.cs:118
System.Reflection.Metadata.Ecma335.SignatureDecoder
Definition
SignatureDecoder.cs:6
System.Reflection.Metadata.Handle
Definition
Handle.cs:6
System.Reflection.Metadata.MethodDefinitionHandle.RowId
int RowId
Definition
MethodDefinitionHandle.cs:9
System.Reflection.Metadata.MethodDefinitionHandle
Definition
MethodDefinitionHandle.cs:4
System.Reflection.Metadata.MethodSignature
Definition
MethodSignature.cs:6
System.Reflection.Metadata.PropertyAccessors
Definition
PropertyAccessors.cs:6
System.Reflection.Metadata.PropertyDefinitionHandle.FromRowId
static PropertyDefinitionHandle FromRowId(int rowId)
Definition
PropertyDefinitionHandle.cs:16
System.Reflection.Metadata.PropertyDefinitionHandle
Definition
PropertyDefinitionHandle.cs:4
System.Reflection.Metadata.PropertyDefinition.PropertyDefinition
PropertyDefinition(MetadataReader reader, PropertyDefinitionHandle handle)
Definition
PropertyDefinition.cs:20
System.Reflection.Metadata.PropertyDefinition.Attributes
PropertyAttributes Attributes
Definition
PropertyDefinition.cs:16
System.Reflection.Metadata.PropertyDefinition.DecodeSignature< TType, TGenericContext >
MethodSignature< TType > DecodeSignature< TType, TGenericContext >(ISignatureTypeProvider< TType, TGenericContext > provider, TGenericContext genericContext)
Definition
PropertyDefinition.cs:26
System.Reflection.Metadata.PropertyDefinition.GetDefaultValue
ConstantHandle GetDefaultValue()
Definition
PropertyDefinition.cs:33
System.Reflection.Metadata.PropertyDefinition.GetAccessors
PropertyAccessors GetAccessors()
Definition
PropertyDefinition.cs:43
System.Reflection.Metadata.PropertyDefinition._rowId
readonly int _rowId
Definition
PropertyDefinition.cs:10
System.Reflection.Metadata.PropertyDefinition._reader
readonly MetadataReader _reader
Definition
PropertyDefinition.cs:8
System.Reflection.Metadata.PropertyDefinition.Name
StringHandle Name
Definition
PropertyDefinition.cs:14
System.Reflection.Metadata.PropertyDefinition.GetCustomAttributes
CustomAttributeHandleCollection GetCustomAttributes()
Definition
PropertyDefinition.cs:38
System.Reflection.Metadata.PropertyDefinition
Definition
PropertyDefinition.cs:7
System.Reflection.Metadata.StringHandle
Definition
StringHandle.cs:6
source
System.Reflection.Metadata
System.Reflection.Metadata
PropertyDefinition.cs
Generated by
1.10.0