using System;
namespace OpenMacroBoard.SDK
{
///
/// Extensions for enrichment ;-)
///
public static class MacroBoardFeatureExtensions
{
///
/// Wraps an with an button press effect adapter.
///
/// The board that should be wrapped.
/// The configuration that should be used. Changes to the configuration later also takes effect.
/// Returns a new board that implements the button press effect.
/// The provided board is null.
public static IMacroBoard WithButtonPressEffect(this IMacroBoard macroBoard, ButtonPressEffectConfig config = null)
{
if (macroBoard is null)
{
throw new ArgumentNullException(nameof(macroBoard));
}
return new ButtonPressEffectAdapter(macroBoard, config);
}
///
/// Wraps an with a disconnect replay adapter.
///
/// The board that should be wrapped.
/// Returns a new board that implements the replay feature.
///
/// This adapter makes sure, that if a device is disconnected that previously set properties like
/// images and brightness are replayed if the device is connected again.
///
/// The provided board is null.
public static IMacroBoard WithDisconnectReplay(this IMacroBoard macroBoard)
{
if (macroBoard is null)
{
throw new ArgumentNullException(nameof(macroBoard));
}
return new DisconnectReplayAdapter(macroBoard);
}
}
}