Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
AttachmentCollection.cs
Go to the documentation of this file.
1
using
System.Collections.Generic
;
2
using
System.Collections.ObjectModel
;
3
4
namespace
System.Net.Mail
;
5
6
public
sealed
class
AttachmentCollection
:
Collection
<Attachment>,
IDisposable
7
{
8
private
bool
_disposed
;
9
10
internal
AttachmentCollection
()
11
{
12
}
13
14
public
void
Dispose
()
15
{
16
if
(
_disposed
)
17
{
18
return
;
19
}
20
using
(
IEnumerator<Attachment>
enumerator
=
GetEnumerator
())
21
{
22
while
(
enumerator
.MoveNext())
23
{
24
Attachment
current =
enumerator
.Current;
25
current.
Dispose
();
26
}
27
}
28
Clear
();
29
_disposed
=
true
;
30
}
31
32
protected
override
void
RemoveItem
(
int
index
)
33
{
34
if
(
_disposed
)
35
{
36
throw
new
ObjectDisposedException
(GetType().
FullName
);
37
}
38
base
.RemoveItem(
index
);
39
}
40
41
protected
override
void
ClearItems
()
42
{
43
if
(
_disposed
)
44
{
45
throw
new
ObjectDisposedException
(GetType().
FullName
);
46
}
47
base
.ClearItems();
48
}
49
50
protected
override
void
SetItem
(
int
index
,
Attachment
item
)
51
{
52
if
(
_disposed
)
53
{
54
throw
new
ObjectDisposedException
(GetType().
FullName
);
55
}
56
if
(
item
==
null
)
57
{
58
throw
new
ArgumentNullException
(
"item"
);
59
}
60
base
.SetItem(
index
,
item
);
61
}
62
63
protected
override
void
InsertItem
(
int
index
,
Attachment
item
)
64
{
65
if
(
_disposed
)
66
{
67
throw
new
ObjectDisposedException
(GetType().
FullName
);
68
}
69
if
(
item
==
null
)
70
{
71
throw
new
ArgumentNullException
(
"item"
);
72
}
73
base
.InsertItem(
index
,
item
);
74
}
75
}
System.ArgumentNullException
Definition
ArgumentNullException.cs:10
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.Collections.ObjectModel.Collection< Attachment >::Clear
void Clear()
Definition
Collection.cs:115
System.Collections.ObjectModel.Collection< Attachment >::GetEnumerator
IEnumerator< T > GetEnumerator()
Definition
Collection.cs:134
System.Collections.ObjectModel.Collection
Definition
Collection.cs:12
System.Net.Mail.AttachmentBase.Dispose
void Dispose()
Definition
AttachmentBase.cs:140
System.Net.Mail.AttachmentCollection.InsertItem
override void InsertItem(int index, Attachment item)
Definition
AttachmentCollection.cs:63
System.Net.Mail.AttachmentCollection.ClearItems
override void ClearItems()
Definition
AttachmentCollection.cs:41
System.Net.Mail.AttachmentCollection._disposed
bool _disposed
Definition
AttachmentCollection.cs:8
System.Net.Mail.AttachmentCollection.SetItem
override void SetItem(int index, Attachment item)
Definition
AttachmentCollection.cs:50
System.Net.Mail.AttachmentCollection.AttachmentCollection
AttachmentCollection()
Definition
AttachmentCollection.cs:10
System.Net.Mail.AttachmentCollection.Dispose
void Dispose()
Definition
AttachmentCollection.cs:14
System.Net.Mail.AttachmentCollection.RemoveItem
override void RemoveItem(int index)
Definition
AttachmentCollection.cs:32
System.Net.Mail.AttachmentCollection
Definition
AttachmentCollection.cs:7
System.Net.Mail.Attachment
Definition
Attachment.cs:8
System.ObjectDisposedException
Definition
ObjectDisposedException.cs:9
System.IDisposable
Definition
IDisposable.cs:4
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
System.Collections.ObjectModel
Definition
EventArgsCache.cs:4
System.Net.Mail
Definition
AlternateView.cs:5
System.TypeNameKind.FullName
@ FullName
System.ExceptionArgument.item
@ item
System.ExceptionArgument.index
@ index
source
System.Net.Mail
System.Net.Mail
AttachmentCollection.cs
Generated by
1.10.0