Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
MethodDefinitionHandleCollection.cs
Go to the documentation of this file.
1
using
System.Collections
;
2
using
System.Collections.Generic
;
3
4
namespace
System.Reflection.Metadata
;
5
6
public
readonly
struct
MethodDefinitionHandleCollection
:
IReadOnlyCollection
<MethodDefinitionHandle>,
IEnumerable
<MethodDefinitionHandle>,
IEnumerable
7
{
8
public
struct
Enumerator
:
IEnumerator
<MethodDefinitionHandle>,
IEnumerator
,
IDisposable
9
{
10
private
readonly
MetadataReader
_reader
;
11
12
private
readonly
int
_lastRowId
;
13
14
private
int
_currentRowId
;
15
16
public
MethodDefinitionHandle
Current
17
{
18
get
19
{
20
if
(
_reader
.
UseMethodPtrTable
)
21
{
22
return
GetCurrentMethodIndirect
();
23
}
24
return
MethodDefinitionHandle
.
FromRowId
((
int
)((
long
)
_currentRowId
& 0
xFFFFFFL
));
25
}
26
}
27
28
object
IEnumerator.Current =>
Current
;
29
30
internal
Enumerator
(
MetadataReader
reader,
int
firstRowId
,
int
lastRowId
)
31
{
32
_reader
= reader;
33
_currentRowId
=
firstRowId
- 1;
34
_lastRowId
=
lastRowId
;
35
}
36
37
private
MethodDefinitionHandle
GetCurrentMethodIndirect
()
38
{
39
return
_reader
.
MethodPtrTable
.GetMethodFor(
_currentRowId
& 0
xFFFFFF
);
40
}
41
42
public
bool
MoveNext
()
43
{
44
if
(
_currentRowId
>=
_lastRowId
)
45
{
46
_currentRowId
= 16777216;
47
return
false
;
48
}
49
_currentRowId
++;
50
return
true
;
51
}
52
53
void
IEnumerator
.
Reset
()
54
{
55
throw
new
NotSupportedException
();
56
}
57
58
void
IDisposable
.
Dispose
()
59
{
60
}
61
}
62
63
private
readonly
MetadataReader
_reader
;
64
65
private
readonly
int
_firstRowId
;
66
67
private
readonly
int
_lastRowId
;
68
69
public
int
Count
=>
_lastRowId
-
_firstRowId
+ 1;
70
71
internal
MethodDefinitionHandleCollection
(
MetadataReader
reader)
72
{
73
_reader
= reader;
74
_firstRowId
= 1;
75
_lastRowId
= reader.
MethodDefTable
.NumberOfRows;
76
}
77
78
internal
MethodDefinitionHandleCollection
(
MetadataReader
reader,
TypeDefinitionHandle
containingType
)
79
{
80
_reader
= reader;
81
reader.
GetMethodRange
(
containingType
,
out
_firstRowId
,
out
_lastRowId
);
82
}
83
84
public
Enumerator
GetEnumerator
()
85
{
86
return
new
Enumerator
(
_reader
,
_firstRowId
,
_lastRowId
);
87
}
88
89
IEnumerator<MethodDefinitionHandle>
IEnumerable<MethodDefinitionHandle>
.
GetEnumerator
()
90
{
91
return
GetEnumerator
();
92
}
93
94
IEnumerator
IEnumerable
.
GetEnumerator
()
95
{
96
return
GetEnumerator
();
97
}
98
}
System.Collections.Generic.Dictionary.GetEnumerator
Enumerator GetEnumerator()
Definition
Dictionary.cs:984
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.NotSupportedException
Definition
NotSupportedException.cs:9
System.Reflection.Metadata.MetadataReader.MethodDefTable
MethodTableReader MethodDefTable
Definition
MetadataReader.cs:87
System.Reflection.Metadata.MetadataReader.GetMethodRange
void GetMethodRange(TypeDefinitionHandle typeDef, out int firstMethodRowId, out int lastMethodRowId)
Definition
MetadataReader.cs:794
System.Reflection.Metadata.MetadataReader.MethodPtrTable
MethodPtrTableReader MethodPtrTable
Definition
MetadataReader.cs:85
System.Reflection.Metadata.MetadataReader.UseMethodPtrTable
bool UseMethodPtrTable
Definition
MetadataReader.cs:191
System.Reflection.Metadata.MetadataReader
Definition
MetadataReader.cs:12
System.Collections.Generic.IEnumerable.GetEnumerator
new IEnumerator< T > GetEnumerator()
System.Collections.Generic.IEnumerable
Definition
IEnumerable.cs:4
System.Collections.Generic.IEnumerator
Definition
IEnumerator.cs:4
System.Collections.Generic.IReadOnlyCollection
Definition
IReadOnlyCollection.cs:4
System.Collections.IEnumerator.Reset
void Reset()
System.IDisposable.Dispose
void Dispose()
System.IDisposable
Definition
IDisposable.cs:4
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
System.Collections
Definition
BlockingCollection.cs:8
System.Reflection.Metadata
Definition
AssemblyExtensions.cs:4
System.Reflection.Metadata.MethodDefinitionHandleCollection.Enumerator.GetCurrentMethodIndirect
MethodDefinitionHandle GetCurrentMethodIndirect()
Definition
MethodDefinitionHandleCollection.cs:37
System.Reflection.Metadata.MethodDefinitionHandleCollection.Enumerator._lastRowId
readonly int _lastRowId
Definition
MethodDefinitionHandleCollection.cs:12
System.Reflection.Metadata.MethodDefinitionHandleCollection.Enumerator.Current
MethodDefinitionHandle Current
Definition
MethodDefinitionHandleCollection.cs:17
System.Reflection.Metadata.MethodDefinitionHandleCollection.Enumerator._reader
readonly MetadataReader _reader
Definition
MethodDefinitionHandleCollection.cs:10
System.Reflection.Metadata.MethodDefinitionHandleCollection.Enumerator.Current
object IEnumerator. Current
Definition
MethodDefinitionHandleCollection.cs:28
System.Reflection.Metadata.MethodDefinitionHandleCollection.Enumerator._currentRowId
int _currentRowId
Definition
MethodDefinitionHandleCollection.cs:14
System.Reflection.Metadata.MethodDefinitionHandleCollection.Enumerator.MoveNext
bool MoveNext()
Definition
MethodDefinitionHandleCollection.cs:42
System.Reflection.Metadata.MethodDefinitionHandleCollection.Enumerator.Enumerator
Enumerator(MetadataReader reader, int firstRowId, int lastRowId)
Definition
MethodDefinitionHandleCollection.cs:30
System.Reflection.Metadata.MethodDefinitionHandleCollection.Enumerator
Definition
MethodDefinitionHandleCollection.cs:9
System.Reflection.Metadata.MethodDefinitionHandleCollection.MethodDefinitionHandleCollection
MethodDefinitionHandleCollection(MetadataReader reader, TypeDefinitionHandle containingType)
Definition
MethodDefinitionHandleCollection.cs:78
System.Reflection.Metadata.MethodDefinitionHandleCollection.GetEnumerator
Enumerator GetEnumerator()
Definition
MethodDefinitionHandleCollection.cs:84
System.Reflection.Metadata.MethodDefinitionHandleCollection._lastRowId
readonly int _lastRowId
Definition
MethodDefinitionHandleCollection.cs:67
System.Reflection.Metadata.MethodDefinitionHandleCollection._firstRowId
readonly int _firstRowId
Definition
MethodDefinitionHandleCollection.cs:65
System.Reflection.Metadata.MethodDefinitionHandleCollection.Count
int Count
Definition
MethodDefinitionHandleCollection.cs:69
System.Reflection.Metadata.MethodDefinitionHandleCollection.MethodDefinitionHandleCollection
MethodDefinitionHandleCollection(MetadataReader reader)
Definition
MethodDefinitionHandleCollection.cs:71
System.Reflection.Metadata.MethodDefinitionHandleCollection._reader
readonly MetadataReader _reader
Definition
MethodDefinitionHandleCollection.cs:63
System.Reflection.Metadata.MethodDefinitionHandleCollection
Definition
MethodDefinitionHandleCollection.cs:7
System.Reflection.Metadata.MethodDefinitionHandle.FromRowId
static MethodDefinitionHandle FromRowId(int rowId)
Definition
MethodDefinitionHandle.cs:16
System.Reflection.Metadata.MethodDefinitionHandle
Definition
MethodDefinitionHandle.cs:4
System.Reflection.Metadata.TypeDefinitionHandle
Definition
TypeDefinitionHandle.cs:4
source
System.Reflection.Metadata
System.Reflection.Metadata
MethodDefinitionHandleCollection.cs
Generated by
1.10.0