# ISelectionItemProvider

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/automation/provider/trait-iselectionitemprovider/

**trait** · [`ferroui-controls`](/docs/0.5.0/api/ferroui-controls/) · v0.5.0

```rust
trait ISelectionItemProvider
```

Exposes methods and properties to support access by a UI Automation client to individual,
selectable child controls of containers that implement `ISelectionProvider`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/provider/i_selection_item_provider.rs#L9)

## Members

- [`peer`](#function-peer)
- [`is_selected`](#function-is_selected)
- [`selection_container`](#function-selection_container)
- [`add_to_selection`](#function-add_to_selection)
- [`remove_from_selection`](#function-remove_from_selection)
- [`select`](#function-select)

<a id="function-peer"></a>

### peer

```rust
fn peer(self: &Self) -> Ref<AutomationPeer>
```

The automation peer that provides this contract.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/provider/i_selection_item_provider.rs#L11)

<a id="function-is_selected"></a>

### is_selected

```rust
fn is_selected(self: &Self) -> bool
```

Gets a value that indicates whether an item is selected.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/provider/i_selection_item_provider.rs#L14)

<a id="function-selection_container"></a>

### selection_container

```rust
fn selection_container(self: &Self) -> Option<Rc<dyn ISelectionProvider>>
```

Gets the UI Automation provider that implements `ISelectionProvider` and acts as the
container for the calling object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/provider/i_selection_item_provider.rs#L18)

<a id="function-add_to_selection"></a>

### add_to_selection

```rust
fn add_to_selection(self: &Self) -> Result<(), AutomationError>
```

Adds the current element to the collection of selected items.
## Errors

An `AutomationError` when the state of the element refuses the call
(the exception the member throws in the original).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/provider/i_selection_item_provider.rs#L26)

<a id="function-remove_from_selection"></a>

### remove_from_selection

```rust
fn remove_from_selection(self: &Self) -> Result<(), AutomationError>
```

Removes the current element from the collection of selected items.
## Errors

An `AutomationError` when the state of the element refuses the call
(the exception the member throws in the original).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/provider/i_selection_item_provider.rs#L34)

<a id="function-select"></a>

### select

```rust
fn select(self: &Self) -> Result<(), AutomationError>
```

Clears any existing selection and then selects the current element.
## Errors

An `AutomationError` when the state of the element refuses the call
(the exception the member throws in the original).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/provider/i_selection_item_provider.rs#L42)

## Trait implementations

- [`ISelectionItemProvider`](/docs/0.5.0/api/ferroui-controls/automation/provider/trait-iselectionitemprovider/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
