Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CustomAttributeHandleCollection.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
CustomAttributeHandleCollection
:
IReadOnlyCollection
<CustomAttributeHandle>,
IEnumerable
<CustomAttributeHandle>,
IEnumerable
7
{
8
public
struct
Enumerator
:
IEnumerator
<CustomAttributeHandle>,
IEnumerator
,
IDisposable
9
{
10
private
readonly
MetadataReader
_reader
;
11
12
private
readonly
int
_lastRowId
;
13
14
private
int
_currentRowId
;
15
16
public
CustomAttributeHandle
Current
17
{
18
get
19
{
20
if
(
_reader
.
CustomAttributeTable
.PtrTable !=
null
)
21
{
22
return
GetCurrentCustomAttributeIndirect
();
23
}
24
return
CustomAttributeHandle
.
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
CustomAttributeHandle
GetCurrentCustomAttributeIndirect
()
38
{
39
return
CustomAttributeHandle
.
FromRowId
(
_reader
.
CustomAttributeTable
.PtrTable[(
_currentRowId
& 0
xFFFFFF
) - 1]);
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
CustomAttributeHandleCollection
(
MetadataReader
reader)
72
{
73
_reader
= reader;
74
_firstRowId
= 1;
75
_lastRowId
= reader.
CustomAttributeTable
.NumberOfRows;
76
}
77
78
internal
CustomAttributeHandleCollection
(
MetadataReader
reader,
EntityHandle
handle
)
79
{
80
_reader
= reader;
81
reader.
CustomAttributeTable
.GetAttributeRange(
handle
,
out
_firstRowId
,
out
_lastRowId
);
82
}
83
84
public
Enumerator
GetEnumerator
()
85
{
86
return
new
Enumerator
(
_reader
,
_firstRowId
,
_lastRowId
);
87
}
88
89
IEnumerator<CustomAttributeHandle>
IEnumerable<CustomAttributeHandle>
.
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.CustomAttributeTable
CustomAttributeTableReader CustomAttributeTable
Definition
MetadataReader.cs:99
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.ExceptionArgument.handle
@ handle
System.Reflection.Metadata.CustomAttributeHandleCollection.Enumerator.Current
CustomAttributeHandle Current
Definition
CustomAttributeHandleCollection.cs:17
System.Reflection.Metadata.CustomAttributeHandleCollection.Enumerator._currentRowId
int _currentRowId
Definition
CustomAttributeHandleCollection.cs:14
System.Reflection.Metadata.CustomAttributeHandleCollection.Enumerator.GetCurrentCustomAttributeIndirect
CustomAttributeHandle GetCurrentCustomAttributeIndirect()
Definition
CustomAttributeHandleCollection.cs:37
System.Reflection.Metadata.CustomAttributeHandleCollection.Enumerator._lastRowId
readonly int _lastRowId
Definition
CustomAttributeHandleCollection.cs:12
System.Reflection.Metadata.CustomAttributeHandleCollection.Enumerator.MoveNext
bool MoveNext()
Definition
CustomAttributeHandleCollection.cs:42
System.Reflection.Metadata.CustomAttributeHandleCollection.Enumerator._reader
readonly MetadataReader _reader
Definition
CustomAttributeHandleCollection.cs:10
System.Reflection.Metadata.CustomAttributeHandleCollection.Enumerator.Current
object IEnumerator. Current
Definition
CustomAttributeHandleCollection.cs:28
System.Reflection.Metadata.CustomAttributeHandleCollection.Enumerator.Enumerator
Enumerator(MetadataReader reader, int firstRowId, int lastRowId)
Definition
CustomAttributeHandleCollection.cs:30
System.Reflection.Metadata.CustomAttributeHandleCollection.Enumerator
Definition
CustomAttributeHandleCollection.cs:9
System.Reflection.Metadata.CustomAttributeHandleCollection.Count
int Count
Definition
CustomAttributeHandleCollection.cs:69
System.Reflection.Metadata.CustomAttributeHandleCollection._firstRowId
readonly int _firstRowId
Definition
CustomAttributeHandleCollection.cs:65
System.Reflection.Metadata.CustomAttributeHandleCollection.CustomAttributeHandleCollection
CustomAttributeHandleCollection(MetadataReader reader)
Definition
CustomAttributeHandleCollection.cs:71
System.Reflection.Metadata.CustomAttributeHandleCollection._reader
readonly MetadataReader _reader
Definition
CustomAttributeHandleCollection.cs:63
System.Reflection.Metadata.CustomAttributeHandleCollection.GetEnumerator
Enumerator GetEnumerator()
Definition
CustomAttributeHandleCollection.cs:84
System.Reflection.Metadata.CustomAttributeHandleCollection._lastRowId
readonly int _lastRowId
Definition
CustomAttributeHandleCollection.cs:67
System.Reflection.Metadata.CustomAttributeHandleCollection.CustomAttributeHandleCollection
CustomAttributeHandleCollection(MetadataReader reader, EntityHandle handle)
Definition
CustomAttributeHandleCollection.cs:78
System.Reflection.Metadata.CustomAttributeHandleCollection
Definition
CustomAttributeHandleCollection.cs:7
System.Reflection.Metadata.CustomAttributeHandle.FromRowId
static CustomAttributeHandle FromRowId(int rowId)
Definition
CustomAttributeHandle.cs:16
System.Reflection.Metadata.CustomAttributeHandle
Definition
CustomAttributeHandle.cs:4
System.Reflection.Metadata.EntityHandle
Definition
EntityHandle.cs:6
source
System.Reflection.Metadata
System.Reflection.Metadata
CustomAttributeHandleCollection.cs
Generated by
1.10.0