Framework/Listeners/ListenerHelper.ps1

Set-StrictMode -Version Latest
#Class to register appropriate listeners based on environment
class ListenerHelper
{
    static ListenerHelper()
    {
    }

    static [void] RegisterListeners()
    {
        [WriteFolderPath]::GetInstance().RegisterEvents();
        [WriteDetailedLog]::GetInstance().RegisterEvents();
        [WriteSummaryFile]::GetInstance().RegisterEvents();
        [WritePsConsole]::GetInstance().RegisterEvents();
        [WriteDataFile]::GetInstance().RegisterEvents();
        [OMSOutput]::GetInstance().RegisterEvents();
        [EventHubOutput]::GetInstance().RegisterEvents();
        [WebhookOutput]::GetInstance().RegisterEvents();
        [AIOrgTelemetry]::GetInstance().RegisterEvents();
        [UsageTelemetry]::GetInstance().RegisterEvents();
        [RemoteReportsListner]::GetInstance().RegisterEvents();
        [WriteEnvironmentFile]::GetInstance().RegisterEvents();
        [WriteCAStatus]::GetInstance().RegisterEvents();
        [WriteFixControlFiles]::GetInstance().RegisterEvents();
    }


    static [void] UnregisterListeners()
    {
        [WriteFolderPath]::GetInstance().UnregisterEvents();
        [WriteDetailedLog]::GetInstance().UnregisterEvents();
        [WriteSummaryFile]::GetInstance().UnregisterEvents();
        [WritePsConsole]::GetInstance().UnregisterEvents();
        [WriteDataFile]::GetInstance().UnregisterEvents();
        [OMSOutput]::GetInstance().UnregisterEvents();
        [EventHubOutput]::GetInstance().UnregisterEvents();
        [WebhookOutput]::GetInstance().UnregisterEvents();
        [AIOrgTelemetry]::GetInstance().UnregisterEvents();
        [UsageTelemetry]::GetInstance().UnregisterEvents();
        [RemoteReportsListner]::GetInstance().UnregisterEvents();
        [WriteEnvironmentFile]::GetInstance().UnregisterEvents();
        [WriteCAStatus]::GetInstance().UnregisterEvents();
        [WriteFixControlFiles]::GetInstance().UnregisterEvents();
    }
}
#[ListenerHelper]::RegisterListeners();