Ejemplo 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);
        }
Ejemplo n.º 2
0
        public InjectorView()
        {
            try
            {
                InitializeComponent();
            }
            catch (Exception e)
            {
                var logger = new Common.IO.Logger(Common.Paths.InjectorLogFileName);

                logger.Log("InjectorView init failed.");
                logger.Log(e);

                Application.Current.Shutdown(2);
            }
        }
Ejemplo n.º 3
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);
            }
        }