49 lines
1.9 KiB
Markdown
49 lines
1.9 KiB
Markdown
|
|
---
|
||
|
|
source_files:
|
||
|
|
- Common/DTS.CommonCore/BusyIndicatorManager/xBusyIndicator.xaml.cs
|
||
|
|
- Common/DTS.CommonCore/BusyIndicatorManager/BusyIndicatorManager.cs
|
||
|
|
generated_at: "2026-04-17T16:36:20.045107+00:00"
|
||
|
|
model: "zai-org/GLM-5-FP8"
|
||
|
|
schema_version: 1
|
||
|
|
sha256: "1f7158417293cad9"
|
||
|
|
---
|
||
|
|
|
||
|
|
# BusyIndicatorManager Module Documentation
|
||
|
|
|
||
|
|
## 1. Purpose
|
||
|
|
|
||
|
|
This module provides a thread-safe, singleton-based manager for coordinating busy indicator states across an application. It allows multiple callers to register unique busy states (identified by integer IDs) with associated messages, ensuring the UI reflects the appropriate busy state when one or more operations are in progress. The `xBusyIndicator` class serves as a WPF UserControl component, likely intended for visual representation of the busy state, though its implementation is minimal in the provided source.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 2. Public Interface
|
||
|
|
|
||
|
|
### `BusyIndicatorManager` (class)
|
||
|
|
|
||
|
|
**Inherits from:** `NotificationObject` (Microsoft.Practices.Prism.ViewModel)
|
||
|
|
|
||
|
|
**Singleton Access:**
|
||
|
|
```csharp
|
||
|
|
public static BusyIndicatorManager Instance { get; }
|
||
|
|
```
|
||
|
|
Returns the singleton instance of `BusyIndicatorManager`, creating it lazily with thread synchronization via a lock on `SyncRoot`.
|
||
|
|
|
||
|
|
**Properties:**
|
||
|
|
```csharp
|
||
|
|
public bool IsBusy { get; private set; }
|
||
|
|
```
|
||
|
|
Indicates whether any busy operation is currently registered. Returns `true` when `busyParameters` dictionary contains one or more entries; `false` when empty.
|
||
|
|
|
||
|
|
```csharp
|
||
|
|
public string Message { get; private set; }
|
||
|
|
```
|
||
|
|
The current busy message to display. Updated to the most recently added or last remaining message in `busyParameters`.
|
||
|
|
|
||
|
|
**Methods:**
|
||
|
|
```csharp
|
||
|
|
public void ShowBusy(int id, string busyMessage)
|
||
|
|
```
|
||
|
|
Registers a busy state with the given `id` and `busyMessage`. If the ID already exists, the message is updated. Sets `IsBusy` to `true` and updates `Message` to `busyMessage`.
|
||
|
|
|
||
|
|
```csharp
|
||
|
|
public
|