namespace KLHZ.Trader.Core.Common { public static class BotModeSwitcher { private readonly static object _locker = new(); private static bool _canClose = true; private static bool _canOpen = false; public static bool CanClose() { lock (_locker) return _canClose; } public static bool CanOpen() { lock (_locker) return _canOpen; } public static void StopClosing() { lock (_locker) _canClose = false; } public static void StopOpening() { lock (_locker) _canOpen = false; } public static void StartClosing() { lock (_locker) _canClose = true; } public static void StartOpening() { lock (_locker) _canOpen = true; } } }