public DropDownSetting(byte id, string name, List <string> items, int defaultValue)
     : base(id, name, SettingKind.NormalSetting)
 {
     ArgumentVerifier.CantBeNull(items, nameof(items));
     ArgumentVerifier.ShouldBeTrue(l => l.Count > 0, items, $"{nameof(items)} has to have at least one element");
     ArgumentVerifier.ShouldBeTrue(v => v >= 0, defaultValue, $"{nameof(defaultValue)} should be 0 or higher");
     _items        = items;
     _defaultValue = defaultValue;
 }
Пример #2
0
 /// <summary>
 /// Sets up the setting with the control specified
 /// </summary>
 /// <param name="controlToUse"></param>
 public virtual void Setup(IInputControl <T> controlToUse)
 {
     ArgumentVerifier.CantBeNull(controlToUse, nameof(controlToUse));
     _inputControl = controlToUse;
     _inputControl.ValueChanged += _inputControl_ValueChanged;
 }
Пример #3
0
 /// <summary>
 /// Sets the output control to log the messages on we're receiving.
 /// </summary>
 /// <param name="outputControl"></param>
 public void Setup(ApplicationOutput outputControl)
 {
     ArgumentVerifier.CantBeNull(outputControl, nameof(outputControl));
     _outputControl = outputControl;
 }