namespace PepperDash.Core.Abstractions; /// /// Allows pre-registration of Crestron service implementations before the Debug /// static class initialises. Call from the composition root /// (e.g. ControlSystem constructor) before any code touches Debug.*. /// Test projects should call it with no-op / in-memory implementations so that the /// Debug static constructor never tries to reach the real Crestron SDK. /// public static class DebugServiceRegistration { /// Gets the registered environment abstraction, or null if not registered. public static ICrestronEnvironment? Environment { get; private set; } /// Gets the registered console abstraction, or null if not registered. public static ICrestronConsole? Console { get; private set; } /// Gets the registered data-store abstraction, or null if not registered. public static ICrestronDataStore? DataStore { get; private set; } /// /// Registers the service implementations that Debug will use when its /// static constructor runs. Any parameter may be null to leave the /// corresponding service unregistered (the Debug class will skip that /// capability gracefully). /// public static void Register( ICrestronEnvironment? environment, ICrestronConsole? console, ICrestronDataStore? dataStore) { Environment = environment; Console = console; DataStore = dataStore; } }