protected void AddMethod <TInputValue>(ValueCheckExtDelegate <TInputValue> method) where TInputValue : struct { if (method == null) { throw new ArgumentNullException(nameof(method)); } if (!_AddInCacheDelegate <TInputValue>(_cacheValueCheckExtDelegates, method)) { throw new ArgumentException(string.Empty, nameof(method)); } }
public TInputOutputValue GetValue <TInputOutputValue>(TInputOutputValue value, TInputOutputValue minValue, TInputOutputValue maxValue, TInputOutputValue defaultValue, ValueCheckExtDelegate <TInputOutputValue> method) where TInputOutputValue : struct { if (method == null) { throw new ArgumentNullException(nameof(method)); } return(method.Invoke(value, minValue, maxValue) ? value : defaultValue); }
public bool IsValidValue <TInputValue>(TInputValue value, TInputValue minValue, TInputValue maxValue, ValueCheckExtDelegate <TInputValue> method) where TInputValue : struct { if (method == null) { throw new ArgumentNullException(nameof(method)); } return(method.Invoke(value, minValue, maxValue)); }