Class ServiceCollection
Default implementation of IServiceCollection.
Inherited Members
Namespace: Unity.AppUI.MVVM
Syntax
public class ServiceCollection : IServiceCollection, IList<ServiceDescriptor>, ICollection<ServiceDescriptor>, IEnumerable<ServiceDescriptor>, IEnumerable
Properties
Count
The number of services in the collection.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 |
Implements
IsReadOnly
The collection is not read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
Boolean |
Implements
Item[Int32]
Get or set a service in the collection.
Declaration
public ServiceDescriptor this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index of the service to get or set. |
Property Value
Type | Description |
---|---|
ServiceDescriptor |
Implements
Methods
Add(ServiceDescriptor)
Add a service to the collection.
Declaration
public void Add(ServiceDescriptor item)
Parameters
Type | Name | Description |
---|---|---|
ServiceDescriptor | item | The service to add. |
Implements
Clear()
Clear all services from the collection.
Declaration
public void Clear()
Implements
Contains(ServiceDescriptor)
Check if the collection contains a service.
Declaration
public bool Contains(ServiceDescriptor item)
Parameters
Type | Name | Description |
---|---|---|
ServiceDescriptor | item | The service to check for. |
Returns
Type | Description |
---|---|
Boolean | True if the collection contains the service. |
Implements
CopyTo(ServiceDescriptor[], Int32)
Copy the services to an array.
Declaration
public void CopyTo(ServiceDescriptor[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
ServiceDescriptor[] | array | The array to copy to. |
Int32 | arrayIndex | The index to start copying at. |
Implements
GetEnumerator()
Get an enumerator for the services.
Declaration
public IEnumerator<ServiceDescriptor> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<ServiceDescriptor> | The enumerator. |
Implements
IndexOf(ServiceDescriptor)
Get the index of a service in the collection.
Declaration
public int IndexOf(ServiceDescriptor item)
Parameters
Type | Name | Description |
---|---|---|
ServiceDescriptor | item | The service to get the index of. |
Returns
Type | Description |
---|---|
Int32 | The index of the service. |
Implements
Insert(Int32, ServiceDescriptor)
Insert a service into the collection.
Declaration
public void Insert(int index, ServiceDescriptor item)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index to insert the service at. |
ServiceDescriptor | item | The service to insert. |
Implements
Remove(ServiceDescriptor)
Remove a service from the collection.
Declaration
public bool Remove(ServiceDescriptor item)
Parameters
Type | Name | Description |
---|---|---|
ServiceDescriptor | item | The service to remove. |
Returns
Type | Description |
---|---|
Boolean | True if the service was removed. |
Implements
RemoveAt(Int32)
Remove a service from the collection.
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index of the service to remove. |
Implements
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Get an enumerator for the services.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator | The enumerator. |