Class ServiceCollection
Default implementation of IServiceCollection.
Implements
Inherited Members
Namespace: nanoFramework.DependencyInjection
Assembly: nanoFramework.DependencyInjection.dll
Syntax
public class ServiceCollection : IServiceCollection
Constructors
ServiceCollection()
Declaration
public ServiceCollection()
Properties
Count
Gets the number of elements contained in the collection.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
IsReadOnly
Gets a value indicating whether the collection is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
bool |
this[int]
Gets or sets the ServiceDescriptor at the specified index.
Declaration
public ServiceDescriptor this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
int | index | The zero-based index of the item to add. |
Property Value
Type | Description |
---|---|
ServiceDescriptor |
Methods
Add(ServiceDescriptor)
Adds an item to the collection.
Declaration
public int Add(ServiceDescriptor item)
Parameters
Type | Name | Description |
---|---|---|
ServiceDescriptor | item | The ServiceDescriptor to add. |
Returns
Type | Description |
---|---|
int |
Clear()
Removes all ServiceDescriptor from the collection.
Declaration
public void Clear()
Contains(ServiceDescriptor)
Determines whether the collection contains a specific value.
Declaration
public bool Contains(ServiceDescriptor item)
Parameters
Type | Name | Description |
---|---|---|
ServiceDescriptor | item | The ServiceDescriptor to locate in the collection. |
Returns
Type | Description |
---|---|
bool |
CopyTo(ServiceDescriptor[], int)
Copies the elements of the collection to an Array starting at a particular Array index.
Declaration
public void CopyTo(ServiceDescriptor[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
ServiceDescriptor[] | array | The one-dimensional Array that is the destination of the elements copied from. The Array must have zero-based indexing. |
int | arrayIndex | The zero-based index in array at which copying begins. |
GetEnumerator()
Returns an enumerator that iterates through a collection.
Declaration
public IEnumerator GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator |
IndexOf(ServiceDescriptor)
Determines the index of a specific item in the collection.
Declaration
public int IndexOf(ServiceDescriptor item)
Parameters
Type | Name | Description |
---|---|---|
ServiceDescriptor | item | The ServiceDescriptor to get the index of. |
Returns
Type | Description |
---|---|
int |
Insert(int, ServiceDescriptor)
Inserts an item to the collection at the specified index.
Declaration
public void Insert(int index, ServiceDescriptor item)
Parameters
Type | Name | Description |
---|---|---|
int | index | The zero-based index at which ServiceDescriptor should be inserted. |
ServiceDescriptor | item | The ServiceDescriptor to insert. |
Remove(ServiceDescriptor)
Removes the first occurrence of a specific object from the collection.
Declaration
public void Remove(ServiceDescriptor item)
Parameters
Type | Name | Description |
---|---|---|
ServiceDescriptor | item | The ServiceDescriptor to remove. |
RemoveAt(int)
Removes the ServiceDescriptor item at the specified index.
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The zero-based index of the item to remove. |