SMEAppHouse.Core.TopshelfAdapter.Aggregation
10.0.0
dotnet add package SMEAppHouse.Core.TopshelfAdapter.Aggregation --version 10.0.0
NuGet\Install-Package SMEAppHouse.Core.TopshelfAdapter.Aggregation -Version 10.0.0
<PackageReference Include="SMEAppHouse.Core.TopshelfAdapter.Aggregation" Version="10.0.0" />
<PackageVersion Include="SMEAppHouse.Core.TopshelfAdapter.Aggregation" Version="10.0.0" />
<PackageReference Include="SMEAppHouse.Core.TopshelfAdapter.Aggregation" />
paket add SMEAppHouse.Core.TopshelfAdapter.Aggregation --version 10.0.0
#r "nuget: SMEAppHouse.Core.TopshelfAdapter.Aggregation, 10.0.0"
#:package SMEAppHouse.Core.TopshelfAdapter.Aggregation@10.0.0
#addin nuget:?package=SMEAppHouse.Core.TopshelfAdapter.Aggregation&version=10.0.0
#tool nuget:?package=SMEAppHouse.Core.TopshelfAdapter.Aggregation&version=10.0.0
SMEAppHouse.Core.TopshelfAdapter.Aggregation
Overview
SMEAppHouse.Core.TopshelfAdapter.Aggregation is a library for aggregating and managing multiple Topshelf services. It provides a controller pattern for managing collections of service workers with unified control operations.
Target Framework: .NET 8.0
Namespace: SMEAppHouse.Core.TopshelfAdapter.Aggregation
Public Classes and Interfaces
1. ServiceController
Controller for managing multiple Topshelf service workers.
Namespace: SMEAppHouse.Core.TopshelfAdapter.Aggregation
Implements: IServiceController
Key Properties:
ObservableCollection<ITopshelfClientExt> ServiceWorkers- Collection of service workers
Key Events:
ServiceWorkerInitializedEventHandler OnServiceWorkerInitialized- Raised when a worker is initialized
Key Methods:
Control Methods
public void ResumeAll()
public void HaltAll()
public void ShutdownAll()
Constructor:
public ServiceController()
Example:
using SMEAppHouse.Core.TopshelfAdapter;
using SMEAppHouse.Core.TopshelfAdapter.Aggregation;
using SMEAppHouse.Core.TopshelfAdapter.Common;
var controller = new ServiceController();
// Add service workers
var service1 = new DataProcessingService(options1, logger);
var service2 = new EmailService(options2, logger);
var service3 = new ReportService(options3, logger);
controller.ServiceWorkers.Add(service1);
controller.ServiceWorkers.Add(service2);
controller.ServiceWorkers.Add(service3);
// Subscribe to initialization events
controller.OnServiceWorkerInitialized += (sender, e) =>
{
Console.WriteLine($"Service worker initialized: {e.ServiceWorker.GetType().Name}");
};
// Control all services
controller.ResumeAll(); // Start all services
// ...
controller.HaltAll(); // Pause all services
// ...
controller.ShutdownAll(); // Shutdown all services
2. IServiceController
Interface for service controllers.
Namespace: SMEAppHouse.Core.TopshelfAdapter.Aggregation
Properties:
ObservableCollection<ITopshelfClientExt> ServiceWorkersServiceWorkerInitializedEventHandler OnServiceWorkerInitialized
Methods:
void ResumeAll()
void HaltAll()
void ShutdownAll()
3. ServiceWorkerInitializedEventArgs
Event arguments for service worker initialization.
Namespace: SMEAppHouse.Core.TopshelfAdapter.Aggregation
Properties:
ITopshelfClient ServiceWorker- The initialized service worker
Complete Usage Examples
Example 1: Managing Multiple Services
using SMEAppHouse.Core.TopshelfAdapter.Aggregation;
using SMEAppHouse.Core.TopshelfAdapter.Common;
public class ServiceManager
{
private ServiceController _controller;
public void InitializeServices()
{
_controller = new ServiceController();
// Create and add services
var dataService = new DataProcessingService(GetOptions(), GetLogger());
var emailService = new EmailService(GetOptions(), GetLogger());
var reportService = new ReportService(GetOptions(), GetLogger());
_controller.ServiceWorkers.Add(dataService);
_controller.ServiceWorkers.Add(emailService);
_controller.ServiceWorkers.Add(reportService);
// Monitor initialization
_controller.OnServiceWorkerInitialized += (sender, e) =>
{
Console.WriteLine($"Initialized: {e.ServiceWorker.GetType().Name}");
};
}
public void StartAllServices()
{
_controller.ResumeAll();
}
public void PauseAllServices()
{
_controller.HaltAll();
}
public void StopAllServices()
{
_controller.ShutdownAll();
}
}
Example 2: Service Lifecycle Management
public class ApplicationServiceHost
{
private ServiceController _controller;
public void Start()
{
_controller = new ServiceController();
// Register services
RegisterServices();
// Start all
_controller.ResumeAll();
}
public void Stop()
{
_controller?.ShutdownAll();
}
private void RegisterServices()
{
// Add your services here
}
}
Key Features
- Service Aggregation: Manage multiple services in one controller
- Unified Control: Control all services with single method calls
- Observable Collection: Track service additions/removals
- Event Monitoring: Track when services are initialized
- Lifecycle Management: Resume, Halt, and Shutdown all services
Dependencies
- SMEAppHouse.Core.CodeKits
- SMEAppHouse.Core.TopshelfAdapter
- SMEAppHouse.Core.TopshelfAdapter.Common
Notes
- Services are managed in an
ObservableCollection - Collection changes are automatically tracked
- All control methods operate on all services in the collection
- Services can be added/removed from the collection at runtime
- Initialization events are automatically wired when services are added
License
Copyright © Nephiora IT Solutions 2025
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- SMEAppHouse.Core.CodeKits (>= 10.0.0)
- SMEAppHouse.Core.TopshelfAdapter (>= 10.0.0)
- SMEAppHouse.Core.TopshelfAdapter.Common (>= 10.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.0 | 191 | 2/25/2026 |
| 9.0.9 | 179 | 11/29/2025 |
| 9.0.8 | 157 | 11/29/2025 |
| 9.0.7 | 169 | 11/29/2025 |
| 1.4.1906.15 | 958 | 6/12/2019 |
| 1.4.1906.14 | 848 | 6/9/2019 |
| 1.4.1811.9 | 927 | 11/9/2018 |
| 1.3.18073.3 | 909 | 11/8/2018 |
release notes