Class LinkableList<T>
- Namespace
- ActivityPub.Types.Util
- Assembly
- ActivityPub.Types.dll
Synthetic type to represent a list of
T
or Links to T
public class LinkableList<T> : List<Linkable<T>>, IList<Linkable<T>>, ICollection<Linkable<T>>, IReadOnlyList<Linkable<T>>, IReadOnlyCollection<Linkable<T>>, IEnumerable<Linkable<T>>, IList, ICollection, IEnumerable where T : ASType
Type Parameters
T
- Inheritance
-
LinkableList<T>
- Implements
-
ICollection<Linkable<T>>IEnumerable<Linkable<T>>
- Inherited Members
- Extension Methods
Constructors
LinkableList()
Initializes a new instance of the List<T> class that is empty and has the default initial capacity.
public LinkableList()
LinkableList(IEnumerable<ASLink>)
Initializes a new instance of the List<T> class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied.
public LinkableList(IEnumerable<ASLink> links)
Parameters
links
IEnumerable<ASLink>
Exceptions
- ArgumentNullException
collection
is null.
LinkableList(IEnumerable<Linkable<T>>)
Initializes a new instance of the List<T> class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied.
public LinkableList(IEnumerable<Linkable<T>> collection)
Parameters
collection
IEnumerable<Linkable<T>>The collection whose elements are copied to the new list.
Exceptions
- ArgumentNullException
collection
is null.
LinkableList(IEnumerable<T>)
Initializes a new instance of the List<T> class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied.
public LinkableList(IEnumerable<T> values)
Parameters
values
IEnumerable<T>
Exceptions
- ArgumentNullException
collection
is null.
LinkableList(int)
Initializes a new instance of the List<T> class that is empty and has the specified initial capacity.
public LinkableList(int capacity)
Parameters
capacity
intThe number of elements that the new list can initially store.
Exceptions
- ArgumentOutOfRangeException
capacity
is less than 0.
Properties
LinkItems
All link items within the collection.
public IEnumerable<ASLink> LinkItems { get; }
Property Value
ValueItems
All non-link items within the collection
public IEnumerable<T> ValueItems { get; }
Property Value
- IEnumerable<T>
Methods
Add(Linkable<T>)
Adds an object to the end of the List<T>.
public void Add(Linkable<T> linkable)
Parameters
linkable
Linkable<T>
AddRange(IEnumerable<ASLink>)
Adds multiple links to the list
public void AddRange(IEnumerable<ASLink> links)
Parameters
links
IEnumerable<ASLink>
AddRange(IEnumerable<Linkable<T>>)
Adds the elements of the specified collection to the end of the List<T>.
public void AddRange(IEnumerable<Linkable<T>> linkables)
Parameters
linkables
IEnumerable<Linkable<T>>
Exceptions
- ArgumentNullException
collection
is null.
AddRange(IEnumerable<T>)
Adds multiple values to the list
public void AddRange(IEnumerable<T> values)
Parameters
values
IEnumerable<T>
Operators
implicit operator LinkableList<T>(ASLink)
Constructs a linkable list from a single link
public static implicit operator LinkableList<T>(ASLink link)
Parameters
link
ASLink
Returns
- LinkableList<T>
implicit operator LinkableList<T>(ASUri)
Constructs a linkable list from a single link URI
public static implicit operator LinkableList<T>(ASUri link)
Parameters
link
ASUri
Returns
- LinkableList<T>
implicit operator LinkableList<T>(Linkable<T>)
Constructs a linkable list from a single linkable
public static implicit operator LinkableList<T>(Linkable<T> linkable)
Parameters
linkable
Linkable<T>
Returns
- LinkableList<T>
implicit operator LinkableList<T>(List<ASLink>)
Constructs a linkable list from a list of links
public static implicit operator LinkableList<T>(List<ASLink> values)
Parameters
Returns
- LinkableList<T>
implicit operator LinkableList<T>(List<T>)
Constructs a linkable list from a list of values
public static implicit operator LinkableList<T>(List<T> values)
Parameters
values
List<T>
Returns
- LinkableList<T>
implicit operator LinkableList<T>(string)
Constructs a linkable list from a single link URI
public static implicit operator LinkableList<T>(string link)
Parameters
link
string
Returns
- LinkableList<T>
implicit operator LinkableList<T>(Uri)
Constructs a linkable list from a single link URI
public static implicit operator LinkableList<T>(Uri link)
Parameters
link
Uri
Returns
- LinkableList<T>
implicit operator LinkableList<T>(T)
Constructs a linkable list from a single value
public static implicit operator LinkableList<T>(T value)
Parameters
value
T
Returns
- LinkableList<T>