> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.nimbleapps.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Operation

> A class with observable elements to describe the different components of reporting operation progress to an end user.

## Definition

**Assembly:** CloudNimble.BlazorEssentials.dll

**Namespace:** CloudNimble.BlazorEssentials.Merlin

**Inheritance:** CloudNimble.BlazorEssentials.BlazorObservable

## Syntax

```csharp theme={"dark"}
CloudNimble.BlazorEssentials.Merlin.Operation
```

## Summary

A class with observable elements to describe the different components of reporting operation progress to an end user.

## Constructors

### &#x20;.ctor

#### Syntax

```csharp theme={"dark"}
public Operation(string title, System.Collections.Generic.IEnumerable<CloudNimble.BlazorEssentials.Merlin.OperationStep> steps, string successText, string failureText, string inProgressText = "Working...", string notStartedText = "", bool shouldObserveStatus = true)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `title` | `string` | - |
| `steps` | `System.Collections.Generic.IEnumerable<CloudNimble.BlazorEssentials.Merlin.OperationStep>` | - |
| `successText` | `string` | Initializer for the Success value on the DisplayText property. |
| `failureText` | `string` | Initializer for the Failure value on the DisplayText property. |
| `inProgressText` | `string` | Initializer for the InProgress value on the DisplayText property. |
| `notStartedText` | `string` | Initializer for the NotStarted value on the DisplayText property. |
| `shouldObserveStatus` | `bool` | Initializer for internal flag indicating if the control should trigger the StateHasChanged action in the [BlazorObservable](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable.md) when the [OperationStatus](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStatus.md) changes. |

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `CloudNimble.BlazorEssentials.BlazorObservable`

Creates a new instance of the [BlazorObservable](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable.md) class.

#### Syntax

```csharp theme={"dark"}
public BlazorObservable(CloudNimble.BlazorEssentials.StateHasChangedConfig stateHasChangedConfig = null)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `stateHasChangedConfig` | `CloudNimble.BlazorEssentials.StateHasChangedConfig` | - |

## Properties

### &#x20;CurrentIcon

A computed string that determines what the icon should be as the Steps change.

#### Syntax

```csharp theme={"dark"}
public string CurrentIcon { get; set; }
```

#### Property Value

Type: `string`

### &#x20;CurrentIconColor

A computed string that determines what the icon color should be as the Steps change.

#### Syntax

```csharp theme={"dark"}
public string CurrentIconColor { get; set; }
```

#### Property Value

Type: `string`

### &#x20;CurrentProgressClass

A computed string containing the DisplayText for the currently running OperationStep.

#### Syntax

```csharp theme={"dark"}
public string CurrentProgressClass { get; set; }
```

#### Property Value

Type: `string`

### &#x20;DisplayIcon

The icon to display to the end user through the Operation lifecycle.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.BlazorEssentials.Merlin.OperationStatusDisplay DisplayIcon { get; set; }
```

#### Property Value

Type: `CloudNimble.BlazorEssentials.Merlin.OperationStatusDisplay`

#### Remarks

This property is is not observable.

### &#x20;DisplayIconColor

The colors to use for the [Operation.CurrentIcon](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/Operation.md#currenticon) through the Operation lifecycle.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.BlazorEssentials.Merlin.OperationStatusDisplay DisplayIconColor { get; set; }
```

#### Property Value

Type: `CloudNimble.BlazorEssentials.Merlin.OperationStatusDisplay`

#### Remarks

This property is is not observable.

### &#x20;DisplayProgressClass

The CSS Class to use for the Alert's background through the Operation lifecycle.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.BlazorEssentials.Merlin.OperationStatusDisplay DisplayProgressClass { get; set; }
```

#### Property Value

Type: `CloudNimble.BlazorEssentials.Merlin.OperationStatusDisplay`

#### Remarks

This property is is not observable.

### &#x20;DisplayText

The text to display to the end user through the Operation lifecycle.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.BlazorEssentials.Merlin.OperationStatusDisplay DisplayText { get; set; }
```

#### Property Value

Type: `CloudNimble.BlazorEssentials.Merlin.OperationStatusDisplay`

#### Remarks

This property is is not observable.

### &#x20;LoadingStatus Inherited

> [!NOTE]
>
> Inherited from `CloudNimble.BlazorEssentials.BlazorObservable`

A [BlazorObservable.LoadingStatus](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable.md#loadingstatus) specifying the current state of the required data for this Observable.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.BlazorEssentials.LoadingStatus LoadingStatus { get; set; }
```

#### Property Value

Type: `CloudNimble.BlazorEssentials.LoadingStatus`

### &#x20;ProgressPercent

A computed number containing the percentage of all the OperationSteps in the "Succeeded" status.

#### Syntax

```csharp theme={"dark"}
public System.Decimal ProgressPercent { get; set; }
```

#### Property Value

Type: `System.Decimal`

### &#x20;ProgressText

A computed string containing the DisplayText for the currently running OperationStep.

#### Syntax

```csharp theme={"dark"}
public string ProgressText { get; set; }
```

#### Property Value

Type: `string`

### &#x20;ResultText

A computed string that determines if we display the SuccessText or FailureText based on the collective outcome of all the Steps.

#### Syntax

```csharp theme={"dark"}
public string ResultText { get; set; }
```

#### Property Value

Type: `string`

### &#x20;ShowPanel

A computed boolean specifying whether or not the \<div> showing the status of this Operation should be displayed.

#### Syntax

```csharp theme={"dark"}
public bool ShowPanel { get; set; }
```

#### Property Value

Type: `bool`

### &#x20;StateHasChanged Inherited

> [!NOTE]
>
> Inherited from `CloudNimble.BlazorEssentials.BlazorObservable`

Determines how to trigger StateHasChanged events in a Blazor component.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.BlazorEssentials.StateHasChangedConfig StateHasChanged { get; set; }
```

#### Property Value

Type: `CloudNimble.BlazorEssentials.StateHasChangedConfig`

### &#x20;Status

A computed boolean specifying whether or not ALL of the OperationSteps are successful.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.BlazorEssentials.Merlin.OperationStatus Status { get; private set; }
```

#### Property Value

Type: `CloudNimble.BlazorEssentials.Merlin.OperationStatus`

### &#x20;Steps

A [ObservableCollection\`1](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.observablecollection-1) containing the different steps of the Operation.

#### Syntax

```csharp theme={"dark"}
public System.Collections.ObjectModel.ObservableCollection<CloudNimble.BlazorEssentials.Merlin.OperationStep> Steps { get; set; }
```

#### Property Value

Type: `System.Collections.ObjectModel.ObservableCollection<CloudNimble.BlazorEssentials.Merlin.OperationStep>`

### &#x20;Title

The text to display to the end user regarding what is happening in this step.

#### Syntax

```csharp theme={"dark"}
public string Title { get; set; }
```

#### Property Value

Type: `string`

## Methods

### &#x20;Dispose Override

> [!NOTE]
>
> Inherited from `CloudNimble.BlazorEssentials.BlazorObservable`

#### Syntax

```csharp theme={"dark"}
protected override void Dispose(bool disposing)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `disposing` | `bool` | - |

### &#x20;ReplaceSteps

#### Syntax

```csharp theme={"dark"}
public void ReplaceSteps(System.Collections.Generic.List<CloudNimble.BlazorEssentials.Merlin.OperationStep> steps)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `steps` | `System.Collections.Generic.List<CloudNimble.BlazorEssentials.Merlin.OperationStep>` | - |

### &#x20;Reset

Changes all of the Steps back to "NotStarted" so the Operation can be run again.

#### Syntax

```csharp theme={"dark"}
public void Reset()
```

### &#x20;Start

Starts the Operation, looping through each step until it is finished or until a step fails.

#### Syntax

```csharp theme={"dark"}
public void Start()
```

### &#x20;UpdateStep

Modify the status of a specific [OperationStep](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStep.md).

#### Syntax

```csharp theme={"dark"}
public void UpdateStep(int id, CloudNimble.BlazorEssentials.Merlin.OperationStepStatus status, string errorText)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `id` | `int` | [OperationStep](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStep.md) identifier. |
| `status` | `CloudNimble.BlazorEssentials.Merlin.OperationStepStatus` | New [OperationStepStatus](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStepStatus.md). |
| `errorText` | `string` | New value for the ErrorText property on the [OperationStep](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Merlin/OperationStep.md). |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.