private void OnStateChanged(AsyncData data) { using (data) { ResultCode resultCode; if (!data.TryGetResultCode(out resultCode) || resultCode != ResultCode.Ok) { return; } using (var stateBag = data.GetDataAs <StateBag>()) { if (stateBag != null) { if (_isInitialized) { T value; if (GetData(stateBag, out value)) { _currentValue = new EyeXEngineStateValue <T>(value); } } } } } }
private void OnStateChanged(AsyncData data) { using (data) { ResultCode resultCode; if (!data.TryGetResultCode(out resultCode) || resultCode != ResultCode.Ok) { return; } using (var stateBag = data.GetDataAs <StateBag>()) { T value; if (stateBag.TryGetStateValue(out value, _statePath)) { SetCurrentValue(new EngineStateValue <T>(value)); } } } }