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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SMEAppHouse.Core.TopshelfAdapter.Aggregation" Version="10.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SMEAppHouse.Core.TopshelfAdapter.Aggregation" Version="10.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SMEAppHouse.Core.TopshelfAdapter.Aggregation" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SMEAppHouse.Core.TopshelfAdapter.Aggregation --version 10.0.0
                    
#r "nuget: SMEAppHouse.Core.TopshelfAdapter.Aggregation, 10.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SMEAppHouse.Core.TopshelfAdapter.Aggregation@10.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SMEAppHouse.Core.TopshelfAdapter.Aggregation&version=10.0.0
                    
Install as a Cake Addin
#tool nuget:?package=SMEAppHouse.Core.TopshelfAdapter.Aggregation&version=10.0.0
                    
Install as a Cake Tool

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> ServiceWorkers
  • ServiceWorkerInitializedEventHandler 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

  1. Service Aggregation: Manage multiple services in one controller
  2. Unified Control: Control all services with single method calls
  3. Observable Collection: Track service additions/removals
  4. Event Monitoring: Track when services are initialized
  5. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 190 2/25/2026
9.0.9 178 11/29/2025
9.0.8 156 11/29/2025
9.0.7 168 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