Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SingleItemReadOnlyList.cs
Go to the documentation of this file.
2
4{
5 private readonly object _item;
6
7 public object this[int index]
8 {
9 get
10 {
11 if (index != 0)
12 {
13 throw new ArgumentOutOfRangeException("index");
14 }
15 return _item;
16 }
17 set
18 {
20 }
21 }
22
23 public bool IsFixedSize => true;
24
25 public bool IsReadOnly => true;
26
27 public int Count => 1;
28
29 public bool IsSynchronized => false;
30
31 public object SyncRoot => this;
32
34 {
35 _item = item;
36 }
37
39 {
40 yield return _item;
41 }
42
43 public bool Contains(object value)
44 {
45 if (_item != null)
46 {
47 return _item.Equals(value);
48 }
49 return value == null;
50 }
51
52 public int IndexOf(object value)
53 {
54 if (!Contains(value))
55 {
56 return -1;
57 }
58 return 0;
59 }
60
61 public void CopyTo(Array array, int index)
62 {
64 array.SetValue(_item, index);
65 }
66
67 public int Add(object value)
68 {
70 }
71
76
77 public void Insert(int index, object value)
78 {
80 }
81
82 public void Remove(object value)
83 {
85 }
86
91}
static void ValidateCopyToArguments(int sourceCount, Array array, int index)
static string NotSupported_ReadOnlyCollection
Definition SR.cs:28
Definition SR.cs:7