Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
EventDefinitionHandleCollection.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
EventDefinitionHandleCollection
:
IReadOnlyCollection
<EventDefinitionHandle>,
IEnumerable
<EventDefinitionHandle>,
IEnumerable
7
{
8
public
struct
Enumerator
:
IEnumerator
<EventDefinitionHandle>,
IEnumerator
,
IDisposable
9
{
10
private
readonly
MetadataReader
_reader
;
11
12
private
readonly
int
_lastRowId
;
13
14
private
int
_currentRowId
;
15
16
public
EventDefinitionHandle
Current
17
{
18
get
19
{
20
if
(
_reader
.
UseEventPtrTable
)
21
{
22
return
GetCurrentEventIndirect
();
23
}
24
return
EventDefinitionHandle
.
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
EventDefinitionHandle
GetCurrentEventIndirect
()
38
{
39
return
_reader
.
EventPtrTable
.GetEventFor(
_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
EventDefinitionHandleCollection
(
MetadataReader
reader)
72
{
73
_reader
= reader;
74
_firstRowId
= 1;
75
_lastRowId
= reader.
EventTable
.NumberOfRows;
76
}
77
78
internal
EventDefinitionHandleCollection
(
MetadataReader
reader,
TypeDefinitionHandle
containingType
)
79
{
80
_reader
= reader;
81
reader.
GetEventRange
(
containingType
,
out
_firstRowId
,
out
_lastRowId
);
82
}
83
84
public
Enumerator
GetEnumerator
()
85
{
86
return
new
Enumerator
(
_reader
,
_firstRowId
,
_lastRowId
);
87
}
88
89
IEnumerator<EventDefinitionHandle>
IEnumerable<EventDefinitionHandle>
.
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.EventTable
EventTableReader EventTable
Definition
MetadataReader.cs:115
System.Reflection.Metadata.MetadataReader.UseEventPtrTable
bool UseEventPtrTable
Definition
MetadataReader.cs:195
System.Reflection.Metadata.MetadataReader.GetEventRange
void GetEventRange(TypeDefinitionHandle typeDef, out int firstEventRowId, out int lastEventRowId)
Definition
MetadataReader.cs:813
System.Reflection.Metadata.MetadataReader.EventPtrTable
EventPtrTableReader EventPtrTable
Definition
MetadataReader.cs:113
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.EventDefinitionHandleCollection.Enumerator.MoveNext
bool MoveNext()
Definition
EventDefinitionHandleCollection.cs:42
System.Reflection.Metadata.EventDefinitionHandleCollection.Enumerator._lastRowId
readonly int _lastRowId
Definition
EventDefinitionHandleCollection.cs:12
System.Reflection.Metadata.EventDefinitionHandleCollection.Enumerator._reader
readonly MetadataReader _reader
Definition
EventDefinitionHandleCollection.cs:10
System.Reflection.Metadata.EventDefinitionHandleCollection.Enumerator.Current
EventDefinitionHandle Current
Definition
EventDefinitionHandleCollection.cs:17
System.Reflection.Metadata.EventDefinitionHandleCollection.Enumerator._currentRowId
int _currentRowId
Definition
EventDefinitionHandleCollection.cs:14
System.Reflection.Metadata.EventDefinitionHandleCollection.Enumerator.Current
object IEnumerator. Current
Definition
EventDefinitionHandleCollection.cs:28
System.Reflection.Metadata.EventDefinitionHandleCollection.Enumerator.GetCurrentEventIndirect
EventDefinitionHandle GetCurrentEventIndirect()
Definition
EventDefinitionHandleCollection.cs:37
System.Reflection.Metadata.EventDefinitionHandleCollection.Enumerator.Enumerator
Enumerator(MetadataReader reader, int firstRowId, int lastRowId)
Definition
EventDefinitionHandleCollection.cs:30
System.Reflection.Metadata.EventDefinitionHandleCollection.Enumerator
Definition
EventDefinitionHandleCollection.cs:9
System.Reflection.Metadata.EventDefinitionHandleCollection.Count
int Count
Definition
EventDefinitionHandleCollection.cs:69
System.Reflection.Metadata.EventDefinitionHandleCollection.GetEnumerator
Enumerator GetEnumerator()
Definition
EventDefinitionHandleCollection.cs:84
System.Reflection.Metadata.EventDefinitionHandleCollection.EventDefinitionHandleCollection
EventDefinitionHandleCollection(MetadataReader reader, TypeDefinitionHandle containingType)
Definition
EventDefinitionHandleCollection.cs:78
System.Reflection.Metadata.EventDefinitionHandleCollection._lastRowId
readonly int _lastRowId
Definition
EventDefinitionHandleCollection.cs:67
System.Reflection.Metadata.EventDefinitionHandleCollection.EventDefinitionHandleCollection
EventDefinitionHandleCollection(MetadataReader reader)
Definition
EventDefinitionHandleCollection.cs:71
System.Reflection.Metadata.EventDefinitionHandleCollection._reader
readonly MetadataReader _reader
Definition
EventDefinitionHandleCollection.cs:63
System.Reflection.Metadata.EventDefinitionHandleCollection._firstRowId
readonly int _firstRowId
Definition
EventDefinitionHandleCollection.cs:65
System.Reflection.Metadata.EventDefinitionHandleCollection
Definition
EventDefinitionHandleCollection.cs:7
System.Reflection.Metadata.EventDefinitionHandle.FromRowId
static EventDefinitionHandle FromRowId(int rowId)
Definition
EventDefinitionHandle.cs:16
System.Reflection.Metadata.EventDefinitionHandle
Definition
EventDefinitionHandle.cs:4
System.Reflection.Metadata.TypeDefinitionHandle
Definition
TypeDefinitionHandle.cs:4
source
System.Reflection.Metadata
System.Reflection.Metadata
EventDefinitionHandleCollection.cs
Generated by
1.10.0