protected bool Equals(Blink1Preset other) { var equal = Color.R.Equals(other.Color.R) && Color.G.Equals(other.Color.G) && Color.B.Equals(other.Color.B) && PresetDuration.Equals(other.PresetDuration); return(equal); }
protected bool Equals(Blink1Preset other) { var equal = Color.R.Equals(other.Color.R) && Color.G.Equals(other.Color.G) && Color.B.Equals(other.Color.B) && PresetDuration.Equals(other.PresetDuration); return equal; }
public bool Save(Blink1Preset preset, ushort position) { if (position < numberOfPresets) { if (EnableGamma) { var color = ProcessColor(preset.Color); var correctedPreset = new Blink1Preset(color, preset.Duration); return(commandBus.SendCommand(new SetPresetCommand(correctedPreset, position))); } return(commandBus.SendCommand(new SetPresetCommand(preset, position))); } var message = $"Unable to save a preset outside the upper count ({numberOfPresets}) of preset slots"; throw new ArgumentOutOfRangeException(nameof(position), message); }
public bool Save(Blink1Preset preset, ushort position) { if (position < numberOfPresets) { if (EnableGamma) { var color = ProcessColor(preset.Color); var correctedPreset = new Blink1Preset(color, preset.Duration); return commandBus.SendCommand(new SetPresetCommand(correctedPreset, position)); } return commandBus.SendCommand(new SetPresetCommand(preset, position)); } var message = string.Format("Unable to save a preset outside the upper count ({0}) of preset slots", numberOfPresets); throw new ArgumentOutOfRangeException("position", message); }