Files
2026-06-04 11:42:34 +02:00

133 lines
6.2 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
namespace System.Net.NetworkInformation
{
/// <summary>Stores a set of <see cref="T:System.Net.NetworkInformation.IPAddressInformation" /> types.</summary>
// Token: 0x02000160 RID: 352
public class IPAddressInformationCollection : IEnumerable, IEnumerable<IPAddressInformation>, ICollection<IPAddressInformation>
{
// Token: 0x06000BCD RID: 3021 RVA: 0x00024168 File Offset: 0x00022368
internal IPAddressInformationCollection()
{
}
/// <summary>Returns an object that can be used to iterate through this collection.</summary>
/// <returns>An object that implements the <see cref="T:System.Collections.IEnumerator" /> interface and provides access to the <see cref="T:System.Net.NetworkInformation.IPAddressInformation" /> types in this collection.</returns>
// Token: 0x06000BCE RID: 3022 RVA: 0x0002417C File Offset: 0x0002237C
IEnumerator IEnumerable.GetEnumerator()
{
return this.list.GetEnumerator();
}
/// <summary>Throws a <see cref="T:System.NotSupportedException" /> because this operation is not supported for this collection.</summary>
/// <param name="address">The object to be added to the collection.</param>
// Token: 0x06000BCF RID: 3023 RVA: 0x00024190 File Offset: 0x00022390
public virtual void Add(IPAddressInformation address)
{
if (this.IsReadOnly)
{
throw new NotSupportedException("The collection is read-only.");
}
this.list.Add(address);
}
/// <summary>Throws a <see cref="T:System.NotSupportedException" /> because this operation is not supported for this collection.</summary>
// Token: 0x06000BD0 RID: 3024 RVA: 0x000241C0 File Offset: 0x000223C0
public virtual void Clear()
{
if (this.IsReadOnly)
{
throw new NotSupportedException("The collection is read-only.");
}
this.list.Clear();
}
/// <summary>Checks whether the collection contains the specified <see cref="T:System.Net.NetworkInformation.IPAddressInformation" /> object.</summary>
/// <returns>true if the <see cref="T:System.Net.NetworkInformation.IPAddressInformation" /> object exists in the collection; otherwise. false.</returns>
/// <param name="address">The <see cref="T:System.Net.NetworkInformation.IPAddressInformation" /> object to be searched in the collection.</param>
// Token: 0x06000BD1 RID: 3025 RVA: 0x000241E4 File Offset: 0x000223E4
public virtual bool Contains(IPAddressInformation address)
{
return this.list.Contains(address);
}
/// <summary>Copies the collection to the specified array.</summary>
/// <param name="array">A one-dimensional array that receives a copy of the collection.</param>
/// <param name="offset">The zero-based index in <paramref name="array" /> at which the copy begins.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="array" /> is null. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="offset" /> is less than zero. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="array" /> is multidimensional.-or- The number of elements in this <see cref="T:System.Net.NetworkInformation.IPAddressInformation" /> is greater than the available space from <paramref name="offset" /> to the end of the destination <paramref name="array" />. </exception>
/// <exception cref="T:System.InvalidCastException">The elements in this <see cref="T:System.Net.NetworkInformation.IPAddressInformation" /> cannot be cast automatically to the type of the destination <paramref name="array" />. </exception>
// Token: 0x06000BD2 RID: 3026 RVA: 0x000241F4 File Offset: 0x000223F4
public virtual void CopyTo(IPAddressInformation[] array, int offset)
{
this.list.CopyTo(array, offset);
}
/// <summary>Returns an object that can be used to iterate through this collection.</summary>
/// <returns>An object that implements the <see cref="T:System.Collections.IEnumerator" /> interface and provides access to the <see cref="T:System.Net.NetworkInformation.IPAddressInformation" /> types in this collection.</returns>
// Token: 0x06000BD3 RID: 3027 RVA: 0x00024204 File Offset: 0x00022404
public virtual IEnumerator<IPAddressInformation> GetEnumerator()
{
return ((IEnumerable<IPAddressInformation>)this.list).GetEnumerator();
}
/// <summary>Throws a <see cref="T:System.NotSupportedException" /> because this operation is not supported for this collection.</summary>
/// <returns>Always throws a <see cref="T:System.NotSupportedException" />.</returns>
/// <param name="address">The object to be removed.</param>
// Token: 0x06000BD4 RID: 3028 RVA: 0x00024214 File Offset: 0x00022414
public virtual bool Remove(IPAddressInformation address)
{
if (this.IsReadOnly)
{
throw new NotSupportedException("The collection is read-only.");
}
return this.list.Remove(address);
}
/// <summary>Gets the number of <see cref="T:System.Net.NetworkInformation.IPAddressInformation" /> types in this collection.</summary>
/// <returns>An <see cref="T:System.Int32" /> value that contains the number of <see cref="T:System.Net.NetworkInformation.IPAddressInformation" /> types in this collection.</returns>
// Token: 0x170002FA RID: 762
// (get) Token: 0x06000BD5 RID: 3029 RVA: 0x00024244 File Offset: 0x00022444
public virtual int Count
{
get
{
return this.list.Count;
}
}
/// <summary>Gets a value that indicates whether access to this collection is read-only.</summary>
/// <returns>true in all cases.</returns>
// Token: 0x170002FB RID: 763
// (get) Token: 0x06000BD6 RID: 3030 RVA: 0x00024254 File Offset: 0x00022454
public virtual bool IsReadOnly
{
get
{
return true;
}
}
/// <summary>Gets the <see cref="T:System.Net.NetworkInformation.IPAddressInformation" /> at the specified index in the collection. </summary>
/// <returns>The <see cref="T:System.Net.NetworkInformation.IPAddressInformation" /> at the specified location.</returns>
/// <param name="index">The zero-based index of the element.</param>
// Token: 0x170002FC RID: 764
public virtual IPAddressInformation this[int index]
{
get
{
return this.list[index];
}
}
// Token: 0x04000BA3 RID: 2979
private List<IPAddressInformation> list = new List<IPAddressInformation>();
}
}