public Pv2ServerRxParam(IPv2ServerParamsInterface paramSvc, TParamType param) { _paramSvc = paramSvc; _param = param; _subscribe = _paramSvc.OnRemoteUpdated .Filter <TParamType, TParamValue, TValue>(param) .Subscribe(this); OnNext(_param.GetValue(_paramSvc.Read(_param))); }
public static bool ReadBool(this IPv2ServerParamsInterface src, Pv2ParamType param) { if (param is not Pv2BoolParamType type) { throw new Exception($"Wrong type: want {nameof(Pv2BoolParamType)}. Got {param.GetType().Name}"); } var paramResult = src.Read(param); return(type.GetValue(paramResult)); }