src/TF2HUD.Editor/Classes/HUD/HUD.cs
/// <summary>
///     Reset user-settings to the default values defined in the HUD schema.
/// </summary>
Reset user-settings to the default values defined in the HUD schema.
Reset user - settings to the default values defined in the HUD schema .
public void ResetControl(Controls control)
        {
            try
            {
                switch (control.Control)
                {
                    case CheckBox check:
                        if (bool.TryParse(control.Value, out var value))
                            check.IsChecked = value;
                        Logger.Info($"Reset {control.Name} to {value}");
                        break;
                    case TextBox text:
                        text.Text = control.Value;
                        Logger.Info($"Reset {control.Name} to \"{control.Value}\"");
                        break;
                    case ColorPicker color:
                        var colors = Array.ConvertAll(control.Value.Split(' '), byte.Parse);
                        color.SelectedColor = Color.FromArgb(colors[^1], colors[0], colors[1], colors[2]);
                        Logger.Info($"Reset {control.Name} to {color.SelectedColor}");
                        break;
                    case ComboBox combo:
                        if (((ComboBoxItem) combo.Items[0]).Style == (Style) Application.Current.Resources["Crosshair"])
                            combo.SelectedValue = control.Value;
                        else
                            combo.SelectedIndex = int.Parse(control.Value);
                        Logger.Info($"Reset {control.Name} to \"{control.Value}\"");
                        break;
                    case IntegerUpDown integer:
                        integer.Text = control.Value;
                        break;
                }
            }
            catch (Exception e)
            {
                Logger.Error(e.Message);
                Console.WriteLine(e);
                throw;
            }
        }
public void ResetControl ( Controls control ) { try { switch ( control . Control ) { case CheckBox check : if ( bool . TryParse ( control . Value , out var value ) ) check . IsChecked = value ; Logger . Info ( $" Reset  { control . Name }  to  { value } " ) ; break ; case TextBox text : text . Text = control . Value ; Logger . Info ( $" Reset  { control . Name }  to  \" { control . Value } \" " ) ; break ; case ColorPicker color : var colors = Array . ConvertAll ( control . Value . Split ( ' ' ) , byte . Parse ) ; color . SelectedColor = Color . FromArgb ( colors [ ^ 1 ] , colors [ 0 ] , colors [ 1 ] , colors [ 2 ] ) ; Logger . Info ( $" Reset  { control . Name }  to  { color . SelectedColor } " ) ; break ; case ComboBox combo : if ( ( ( ComboBoxItem ) combo . Items [ 0 ] ) . Style == ( Style ) Application . Current . Resources [ " " ] ) combo . SelectedValue = control . Value ; else combo . SelectedIndex = int . Parse ( control . Value ) ; Logger . Info ( $" Reset  { control . Name }  to  \" { control . Value } \" " ) ; break ; case IntegerUpDown integer : integer . Text = control . Value ; break ; } } catch ( Exception e ) { Logger . Error ( e . Message ) ; Console . WriteLine ( e ) ; throw ; } }
Reset user-settings to the default values defined in the HUD schema.
Reset user - settings to the default values defined in the HUD schema .
control
Controls