Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
MethodImplementationHandleCollection.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
MethodImplementationHandleCollection
:
IReadOnlyCollection
<MethodImplementationHandle>,
IEnumerable
<MethodImplementationHandle>,
IEnumerable
7
{
8
public
struct
Enumerator
:
IEnumerator
<MethodImplementationHandle>,
IEnumerator
,
IDisposable
9
{
10
private
readonly
int
_lastRowId
;
11
12
private
int
_currentRowId
;
13
14
public
MethodImplementationHandle
Current
=>
MethodImplementationHandle
.
FromRowId
((
int
)((
long
)
_currentRowId
& 0
xFFFFFFL
));
15
16
object
IEnumerator.Current =>
Current
;
17
18
internal
Enumerator
(
int
firstRowId
,
int
lastRowId
)
19
{
20
_currentRowId
=
firstRowId
- 1;
21
_lastRowId
=
lastRowId
;
22
}
23
24
public
bool
MoveNext
()
25
{
26
if
(
_currentRowId
>=
_lastRowId
)
27
{
28
_currentRowId
= 16777216;
29
return
false
;
30
}
31
_currentRowId
++;
32
return
true
;
33
}
34
35
void
IEnumerator
.
Reset
()
36
{
37
throw
new
NotSupportedException
();
38
}
39
40
void
IDisposable
.
Dispose
()
41
{
42
}
43
}
44
45
private
readonly
int
_firstRowId
;
46
47
private
readonly
int
_lastRowId
;
48
49
public
int
Count
=>
_lastRowId
-
_firstRowId
+ 1;
50
51
internal
MethodImplementationHandleCollection
(
MetadataReader
reader,
TypeDefinitionHandle
containingType
)
52
{
53
if
(
containingType
.IsNil)
54
{
55
_firstRowId
= 1;
56
_lastRowId
= reader.
MethodImplTable
.NumberOfRows;
57
}
58
else
59
{
60
reader.
MethodImplTable
.GetMethodImplRange(
containingType
,
out
_firstRowId
,
out
_lastRowId
);
61
}
62
}
63
64
public
Enumerator
GetEnumerator
()
65
{
66
return
new
Enumerator
(
_firstRowId
,
_lastRowId
);
67
}
68
69
IEnumerator<MethodImplementationHandle>
IEnumerable<MethodImplementationHandle>
.
GetEnumerator
()
70
{
71
return
GetEnumerator
();
72
}
73
74
IEnumerator
IEnumerable
.
GetEnumerator
()
75
{
76
return
GetEnumerator
();
77
}
78
}
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.MethodImplTable
MethodImplTableReader MethodImplTable
Definition
MetadataReader.cs:125
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.MethodImplementationHandleCollection.Enumerator._currentRowId
int _currentRowId
Definition
MethodImplementationHandleCollection.cs:12
System.Reflection.Metadata.MethodImplementationHandleCollection.Enumerator.Current
MethodImplementationHandle Current
Definition
MethodImplementationHandleCollection.cs:14
System.Reflection.Metadata.MethodImplementationHandleCollection.Enumerator.Current
object IEnumerator. Current
Definition
MethodImplementationHandleCollection.cs:16
System.Reflection.Metadata.MethodImplementationHandleCollection.Enumerator._lastRowId
readonly int _lastRowId
Definition
MethodImplementationHandleCollection.cs:10
System.Reflection.Metadata.MethodImplementationHandleCollection.Enumerator.Enumerator
Enumerator(int firstRowId, int lastRowId)
Definition
MethodImplementationHandleCollection.cs:18
System.Reflection.Metadata.MethodImplementationHandleCollection.Enumerator.MoveNext
bool MoveNext()
Definition
MethodImplementationHandleCollection.cs:24
System.Reflection.Metadata.MethodImplementationHandleCollection.Enumerator
Definition
MethodImplementationHandleCollection.cs:9
System.Reflection.Metadata.MethodImplementationHandleCollection._lastRowId
readonly int _lastRowId
Definition
MethodImplementationHandleCollection.cs:47
System.Reflection.Metadata.MethodImplementationHandleCollection.MethodImplementationHandleCollection
MethodImplementationHandleCollection(MetadataReader reader, TypeDefinitionHandle containingType)
Definition
MethodImplementationHandleCollection.cs:51
System.Reflection.Metadata.MethodImplementationHandleCollection.GetEnumerator
Enumerator GetEnumerator()
Definition
MethodImplementationHandleCollection.cs:64
System.Reflection.Metadata.MethodImplementationHandleCollection.Count
int Count
Definition
MethodImplementationHandleCollection.cs:49
System.Reflection.Metadata.MethodImplementationHandleCollection._firstRowId
readonly int _firstRowId
Definition
MethodImplementationHandleCollection.cs:45
System.Reflection.Metadata.MethodImplementationHandleCollection
Definition
MethodImplementationHandleCollection.cs:7
System.Reflection.Metadata.MethodImplementationHandle.FromRowId
static MethodImplementationHandle FromRowId(int rowId)
Definition
MethodImplementationHandle.cs:16
System.Reflection.Metadata.MethodImplementationHandle
Definition
MethodImplementationHandle.cs:4
System.Reflection.Metadata.TypeDefinitionHandle
Definition
TypeDefinitionHandle.cs:4
source
System.Reflection.Metadata
System.Reflection.Metadata
MethodImplementationHandleCollection.cs
Generated by
1.10.0