예제 #1
0
    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);
                        }
                    }
                }
            }
        }
    }
예제 #2
0
        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));
                    }
                }
            }
        }