Class ListNdefRecord
List class for type NdefRecord that has been automatically generated
Implements
Inherited Members
Namespace: System.Collections.Generic
Assembly: Iot.Device.Ndef.dll
Syntax
public class ListNdefRecord : IEnumerable
Constructors
| Improve this Doc View SourceListNdefRecord()
Initializes a new instance of the System.Collections.Generic.List class that is empty and has the default initial capacity.
Declaration
public ListNdefRecord()
ListNdefRecord(IEnumerable)
Initializes a new instance of the System.Collections.Generic.List class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied.
Declaration
public ListNdefRecord(IEnumerable collection)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable | collection | The collection whose elements are copied to the new list. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | collection is null |
ListNdefRecord(Int32)
Initializes a new instance of the System.Collections.Generic.List class that is empty and has the specified initial capacity.
Declaration
public ListNdefRecord(int capacity)
Parameters
Type | Name | Description |
---|---|---|
Int32 | capacity | The number of elements that the new list can initially store. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | capacity is less than 0. |
Properties
| Improve this Doc View SourceCapacity
Gets or sets the total number of elements the internal data structure can hold without resizing.
Declaration
public int Capacity { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | System.Collections.Generic.List.Capacity is set to a value that is less than System.Collections.Generic.List.Count |
Count
Gets the number of elements contained in the System.Collections.Generic.List
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 |
Item[Int32]
Gets or sets the element at the specified index.
Declaration
public NdefRecord this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The zero-based index of the element to get or set. |
Property Value
Type | Description |
---|---|
NdefRecord | The element at the specified index. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | index is less than 0. -or- index is equal to or greater than System.Collections.Generic.List.Count. |
Methods
| Improve this Doc View SourceAdd(NdefRecord)
Adds an object to the end of the System.Collections.Generic.List.
Declaration
public void Add(NdefRecord item)
Parameters
Type | Name | Description |
---|---|---|
NdefRecord | item | The object to be added to the end of the System.Collections.Generic.List. The value can be null for reference types. |
AddRange(IEnumerable)
Adds the elements of the specified collection to the end of the System.Collections.Generic.List.
Declaration
public void AddRange(IEnumerable collection)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable | collection | The collection whose elements should be added to the end of the System.Collections.Generic.List. The collection itself cannot be null, but it can contain elements that are null, if type NdefRecord is a reference type. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | collection is null. |
Contains(NdefRecord)
Determines whether an element is in the System.Collections.Generic.List.
Declaration
public bool Contains(NdefRecord item)
Parameters
Type | Name | Description |
---|---|---|
NdefRecord | item | The object to locate in the System.Collections.Generic.List. The value can be null for reference types. |
Returns
Type | Description |
---|---|
Boolean | true if item is found in the System.Collections.Generic.List; otherwise, false. |
CopyTo(NdefRecord[])
Copies the entire System.Collections.Generic.List to a compatible one-dimensional array, starting at the beginning of the target array.
Declaration
public void CopyTo(NdefRecord[] array)
Parameters
Type | Name | Description |
---|---|---|
NdefRecord[] | array | The one-dimensional System.Array that is the destination of the elements copied from System.Collections.Generic.List. The System.Array must have zero-based indexing. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | array is null. |
ArgumentException | The number of elements in the source System.Collections.Generic.List is greater than the number of elements that the destination array can contain. |
CopyTo(NdefRecord[], Int32)
Copies the entire System.Collections.Generic.List to a compatible one-dimensional array, starting at the specified index of the target array.
Declaration
public void CopyTo(NdefRecord[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
NdefRecord[] | array | The one-dimensional System.Array that is the destination of the elements copied from System.Collections.Generic.List. The System.Array must have zero-based indexing. |
Int32 | arrayIndex | The zero-based index in array at which copying begins. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | array is null. |
ArgumentOutOfRangeException | arrayIndex is less than 0. |
ArgumentException | The number of elements in the source System.Collections.Generic.List is greater than the available space from arrayIndex to the end of the destination array. |
CopyTo(Int32, NdefRecord[], Int32, Int32)
Copies a range of elements from the System.Collections.Generic.List to a compatible one-dimensional array, starting at the specified index of the target array.
Declaration
public void CopyTo(int index, NdefRecord[] array, int arrayIndex, int count)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The zero-based index in the source System.Collections.Generic.List at which copying begins. |
NdefRecord[] | array | The one-dimensional System.Array that is the destination of the elements copied from System.Collections.Generic.List. The System.Array must have zero-based indexing. |
Int32 | arrayIndex | The zero-based index in array at which copying begins. |
Int32 | count | The number of elements to copy. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | array is null. |
ArgumentOutOfRangeException | index is less than 0. -or- arrayIndex is less than 0. -or- count is less than 0. |
ArgumentException | index is equal to or greater than the System.Collections.Generic.List.Count of the source System.Collections.Generic.List. -or- The number of elements from index to the end of the source System.Collections.Generic.List is greater than the available space from arrayIndex to the end of the destination array. |
GetEnumerator()
Returns an enumerator that iterates through the System.Collections.Generic.List.
Declaration
public IEnumerator GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator | A System.Collections.Generic.List.Enumerator for the System.Collections.Generic.List. |
GetRange(Int32, Int32)
Creates a shallow copy of a range of elements in the source System.Collections.Generic.List.
Declaration
public ListNdefRecord GetRange(int index, int count)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The zero-based System.Collections.Generic.List index at which the range starts. |
Int32 | count | The number of elements in the range. |
Returns
Type | Description |
---|---|
ListNdefRecord | A shallow copy of a range of elements in the source System.Collections.Generic.List. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | index is less than 0. -or- count is less than 0. |
ArgumentException | index and count do not denote a valid range of elements in the System.Collections.Generic.List. |
IndexOf(NdefRecord)
Searches for the specified object and returns the zero-based index of the first occurrence within the entire System.Collections.Generic.List.
Declaration
public int IndexOf(NdefRecord item)
Parameters
Type | Name | Description |
---|---|---|
NdefRecord | item | The object to locate in the System.Collections.Generic.List. The value can be null for reference types. |
Returns
Type | Description |
---|---|
Int32 | The zero-based index of the first occurrence of item within the entire System.Collections.Generic.List, if found; otherwise, -1. |
IndexOf(NdefRecord, Int32)
Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the System.Collections.Generic.List that extends from the specified index to the last element.
Declaration
public int IndexOf(NdefRecord item, int index)
Parameters
Type | Name | Description |
---|---|---|
NdefRecord | item | The object to locate in the System.Collections.Generic.List. The value can be null for reference types. |
Int32 | index | The zero-based starting index of the search. 0 (zero) is valid in an empty list. |
Returns
Type | Description |
---|---|
Int32 | The zero-based index of the first occurrence of item within the range of elements in the System.Collections.Generic.List that extends from index to the last element, if found; otherwise, -1. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | index is outside the range of valid indexes for the System.Collections.Generic.List. |
IndexOf(NdefRecord, Int32, Int32)
Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the System.Collections.Generic.List that starts at the specified index and contains the specified number of elements.
Declaration
public int IndexOf(NdefRecord item, int index, int count)
Parameters
Type | Name | Description |
---|---|---|
NdefRecord | item | The object to locate in the System.Collections.Generic.List. The value can be null for reference types. |
Int32 | index | The zero-based starting index of the search. 0 (zero) is valid in an empty list. |
Int32 | count | The number of elements in the section to search. |
Returns
Type | Description |
---|---|
Int32 | The zero-based index of the first occurrence of item within the range of elements in the System.Collections.Generic.List that starts at index and contains count number of elements, if found; otherwise, -1. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | index is outside the range of valid indexes for the System.Collections.Generic.List. -or- count is less than 0. -or- index and count do not specify a valid section in the System.Collections.Generic.List. |
Insert(Int32, NdefRecord)
Inserts an element into the System.Collections.Generic.List at the specified index.
Declaration
public void Insert(int index, NdefRecord item)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The zero-based index at which item should be inserted. |
NdefRecord | item | The object to insert. The value can be null for reference types. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | index is less than 0. -or- index is greater than System.Collections.Generic.List.Count. |
InsertRange(Int32, IEnumerable)
Inserts the elements of a collection into the System.Collections.Generic.List at the specified index.
Declaration
public void InsertRange(int index, IEnumerable collection)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The zero-based index at which the new elements should be inserted. |
IEnumerable | collection | The collection whose elements should be inserted into the System.Collections.Generic.List. The collection itself cannot be null, but it can contain elements that are null, if type NdefRecord is a reference type. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | collection is null. |
ArgumentOutOfRangeException | index is less than 0. -or- index is greater than System.Collections.Generic.List.Count. |
LastIndexOf(NdefRecord)
Searches for the specified object and returns the zero-based index of the last occurrence within the entire System.Collections.Generic.List.
Declaration
public int LastIndexOf(NdefRecord item)
Parameters
Type | Name | Description |
---|---|---|
NdefRecord | item | The object to locate in the System.Collections.Generic.List. The value can be null for reference types. |
Returns
Type | Description |
---|---|
Int32 | The zero-based index of the last occurrence of item within the entire the System.Collections.Generic.List, if found; otherwise, -1. |
LastIndexOf(NdefRecord, Int32)
Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the System.Collections.Generic.List that extends from the first element to the specified index.
Declaration
public int LastIndexOf(NdefRecord item, int index)
Parameters
Type | Name | Description |
---|---|---|
NdefRecord | item | The object to locate in the System.Collections.Generic.List. The value can be null for reference types. |
Int32 | index | The zero-based starting index of the backward search. |
Returns
Type | Description |
---|---|
Int32 | The zero-based index of the last occurrence of item within the range of elements in the System.Collections.Generic.List that extends from the first element to index, if found; otherwise, -1. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | index is outside the range of valid indexes for the System.Collections.Generic.List. |
LastIndexOf(NdefRecord, Int32, Int32)
Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the System.Collections.Generic.List that contains the specified number of elements and ends at the specified index.
Declaration
public int LastIndexOf(NdefRecord item, int index, int count)
Parameters
Type | Name | Description |
---|---|---|
NdefRecord | item | The object to locate in the System.Collections.Generic.List. The value can be null for reference types. |
Int32 | index | The zero-based starting index of the backward search. |
Int32 | count | The number of elements in the section to search. |
Returns
Type | Description |
---|---|
Int32 | The zero-based index of the last occurrence of item within the range of elements in the System.Collections.Generic.List that contains count number of elements and ends at index, if found; otherwise, -1. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | index is outside the range of valid indexes for the System.Collections.Generic.List. -or- count is less than 0. -or- index and count do not specify a valid section in the System.Collections.Generic.List. |
Remove(NdefRecord)
Removes the first occurrence of a specific object from the System.Collections.Generic.List.
Declaration
public bool Remove(NdefRecord item)
Parameters
Type | Name | Description |
---|---|---|
NdefRecord | item | The object to remove from the System.Collections.Generic.List. The value can be null for reference types. |
Returns
Type | Description |
---|---|
Boolean | true if item is successfully removed; otherwise, false. This method also returns false if item was not found in the System.Collections.Generic.List. |
RemoveAt(Int32)
Removes the element at the specified index of the System.Collections.Generic.List.
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The zero-based index of the element to remove. |
RemoveRange(Int32, Int32)
Removes a range of elements from the System.Collections.Generic.List.
Declaration
public void RemoveRange(int index, int count)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The zero-based starting index of the range of elements to remove. |
Int32 | count | The number of elements to remove. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | index is less than 0. -or- count is less than 0. |
ArgumentException | index and count do not denote a valid range of elements in the System.Collections.Generic.List. |
ToArray()
Copies the elements of the System.Collections.Generic.List to a new array.
Declaration
public NdefRecord[] ToArray()
Returns
Type | Description |
---|---|
NdefRecord[] | An array containing copies of the elements of the System.Collections.Generic.List. |
Explicit Interface Implementations
| Improve this Doc View SourceIEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator |