Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
AssemblyReferenceHandleCollection.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
AssemblyReferenceHandleCollection
:
IReadOnlyCollection
<AssemblyReferenceHandle>,
IEnumerable
<AssemblyReferenceHandle>,
IEnumerable
7
{
8
public
struct
Enumerator
:
IEnumerator
<AssemblyReferenceHandle>,
IEnumerator
,
IDisposable
9
{
10
private
readonly
MetadataReader
_reader
;
11
12
private
int
_currentRowId
;
13
14
private
int
_virtualRowId
;
15
16
public
AssemblyReferenceHandle
Current
17
{
18
get
19
{
20
if
(
_virtualRowId
>= 0)
21
{
22
if
(
_virtualRowId
== 16777216)
23
{
24
return
default
(
AssemblyReferenceHandle
);
25
}
26
return
AssemblyReferenceHandle
.
FromVirtualIndex
((
AssemblyReferenceHandle
.
VirtualIndex
)
_virtualRowId
);
27
}
28
return
AssemblyReferenceHandle
.
FromRowId
((
int
)((
long
)
_currentRowId
& 0
xFFFFFFL
));
29
}
30
}
31
32
object
IEnumerator.Current =>
Current
;
33
34
internal
Enumerator
(
MetadataReader
reader)
35
{
36
_reader
= reader;
37
_currentRowId
= 0;
38
_virtualRowId
= -1;
39
}
40
41
public
bool
MoveNext
()
42
{
43
if
(
_currentRowId
<
_reader
.
AssemblyRefTable
.NumberOfNonVirtualRows)
44
{
45
_currentRowId
++;
46
return
true
;
47
}
48
if
(
_virtualRowId
<
_reader
.
AssemblyRefTable
.NumberOfVirtualRows - 1)
49
{
50
_virtualRowId
++;
51
return
true
;
52
}
53
_currentRowId
= 16777216;
54
_virtualRowId
= 16777216;
55
return
false
;
56
}
57
58
void
IEnumerator
.
Reset
()
59
{
60
throw
new
NotSupportedException
();
61
}
62
63
void
IDisposable
.
Dispose
()
64
{
65
}
66
}
67
68
private
readonly
MetadataReader
_reader
;
69
70
public
int
Count
=> _reader.AssemblyRefTable.NumberOfNonVirtualRows +
_reader
.
AssemblyRefTable
.NumberOfVirtualRows;
71
72
internal
AssemblyReferenceHandleCollection
(
MetadataReader
reader)
73
{
74
_reader
= reader;
75
}
76
77
public
Enumerator
GetEnumerator
()
78
{
79
return
new
Enumerator
(
_reader
);
80
}
81
82
IEnumerator<AssemblyReferenceHandle>
IEnumerable<AssemblyReferenceHandle>
.
GetEnumerator
()
83
{
84
return
GetEnumerator
();
85
}
86
87
IEnumerator
IEnumerable
.
GetEnumerator
()
88
{
89
return
GetEnumerator
();
90
}
91
}
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.AssemblyRefTable
AssemblyRefTableReader AssemblyRefTable
Definition
MetadataReader.cs:145
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.AssemblyReferenceHandleCollection.Enumerator.MoveNext
bool MoveNext()
Definition
AssemblyReferenceHandleCollection.cs:41
System.Reflection.Metadata.AssemblyReferenceHandleCollection.Enumerator.Enumerator
Enumerator(MetadataReader reader)
Definition
AssemblyReferenceHandleCollection.cs:34
System.Reflection.Metadata.AssemblyReferenceHandleCollection.Enumerator._currentRowId
int _currentRowId
Definition
AssemblyReferenceHandleCollection.cs:12
System.Reflection.Metadata.AssemblyReferenceHandleCollection.Enumerator._reader
readonly MetadataReader _reader
Definition
AssemblyReferenceHandleCollection.cs:10
System.Reflection.Metadata.AssemblyReferenceHandleCollection.Enumerator.Current
object IEnumerator. Current
Definition
AssemblyReferenceHandleCollection.cs:32
System.Reflection.Metadata.AssemblyReferenceHandleCollection.Enumerator.Current
AssemblyReferenceHandle Current
Definition
AssemblyReferenceHandleCollection.cs:17
System.Reflection.Metadata.AssemblyReferenceHandleCollection.Enumerator._virtualRowId
int _virtualRowId
Definition
AssemblyReferenceHandleCollection.cs:14
System.Reflection.Metadata.AssemblyReferenceHandleCollection.Enumerator
Definition
AssemblyReferenceHandleCollection.cs:9
System.Reflection.Metadata.AssemblyReferenceHandleCollection.Count
int Count
Definition
AssemblyReferenceHandleCollection.cs:70
System.Reflection.Metadata.AssemblyReferenceHandleCollection._reader
readonly MetadataReader _reader
Definition
AssemblyReferenceHandleCollection.cs:68
System.Reflection.Metadata.AssemblyReferenceHandleCollection.GetEnumerator
Enumerator GetEnumerator()
Definition
AssemblyReferenceHandleCollection.cs:77
System.Reflection.Metadata.AssemblyReferenceHandleCollection.AssemblyReferenceHandleCollection
AssemblyReferenceHandleCollection(MetadataReader reader)
Definition
AssemblyReferenceHandleCollection.cs:72
System.Reflection.Metadata.AssemblyReferenceHandleCollection
Definition
AssemblyReferenceHandleCollection.cs:7
System.Reflection.Metadata.AssemblyReferenceHandle.FromRowId
static AssemblyReferenceHandle FromRowId(int rowId)
Definition
AssemblyReferenceHandle.cs:33
System.Reflection.Metadata.AssemblyReferenceHandle.VirtualIndex
VirtualIndex
Definition
AssemblyReferenceHandle.cs:6
System.Reflection.Metadata.AssemblyReferenceHandle.FromVirtualIndex
static AssemblyReferenceHandle FromVirtualIndex(VirtualIndex virtualIndex)
Definition
AssemblyReferenceHandle.cs:38
System.Reflection.Metadata.AssemblyReferenceHandle
Definition
AssemblyReferenceHandle.cs:4
source
System.Reflection.Metadata
System.Reflection.Metadata
AssemblyReferenceHandleCollection.cs
Generated by
1.10.0