Пример #1
0
 private void butCreateDefultHue_Click(object sender, RoutedEventArgs e)
 {
     Tools tools = new Tools();
     tools.CreateDefaultHueFile();
 }
Пример #2
0
        /// <summary>
        /// Loads up Default.hue as current configuration. Also recreates the file if it does not exist.
        /// </summary>
        private void LoadDefaultSettings()
        {
            Tools tools = new Tools();

            try
            {
                _currentioconfig = tools.ImportConfig<IOConfig.InputConfig>(AppDomain.CurrentDomain.BaseDirectory + "Plugins\\IO\\Default.hue");
                ReadSettingsToControls(_currentioconfig.Settings);
            }
            catch (Exception ex) when (ex is FileNotFoundException)
            {
                tools.CreateDefaultHueFile();
                _currentioconfig = tools.ImportConfig<IOConfig.InputConfig>(AppDomain.CurrentDomain.BaseDirectory + "Plugins\\IO\\Default.hue");
                ReadSettingsToControls(_currentioconfig.Settings);
                return;
            }

            catch (Exception)
            {
                throw;
            }
        }