Exemplo n.º 1
0
        private bool TryLoadLastAppState()
        {
            var result = true;

            try
            {
                MaterialState = _stateManager.LoadMaterialColorState();
            }
            catch (Exception e)
            {
                Status = "Can't load last material state";

                _logger.Log(e);

                MaterialState = new MaterialColorState();

                result = false;
            }

            try
            {
                OnionState = _stateManager.LoadOnionState();
            }
            catch (Exception e)
            {
                Status = "Can't load last onion state";

                _logger.Log(e);

                OnionState = new OnionState();

                result = false;
            }

            try
            {
                TemperatureOverlayState = _stateManager.LoadTemperatureState();
            }
            catch (Exception e)
            {
                Status = "Can't load last temperature overlay state";

                _logger.Log(e);

                TemperatureOverlayState = new TemperatureOverlayState();

                result = false;
            }

            return(result);
        }
Exemplo n.º 2
0
        public bool TryLoadConfiguratorState(out MaterialColorState state)
        {
            try
            {
                state = _configuratorStateManager.LoadMaterialColorState();
                return(true);
            }
            catch (Exception ex)
            {
                var message = "Can't load configurator state.";

                _logger.Log(ex);
                _logger.Log(message);

                Debug.LogError(message);

                state = new MaterialColorState();

                return(false);
            }
        }