示例#1
0
 protected override OperatorPlacementWhenWrappingPreference GetCurrentValue()
 {
     return(_setting.GetValue() switch
     {
         OperatorPlacementWhenWrappingPreference.BeginningOfLine => OperatorPlacementWhenWrappingPreference.BeginningOfLine,
         _ => OperatorPlacementWhenWrappingPreference.EndOfLine,
     });
示例#2
0
 protected override NewLineSetting GetCurrentValue()
 {
     return(_setting.GetValue() switch
     {
         "\n" => NewLineSetting.Newline,
         "\r" => NewLineSetting.CarriageReturn,
         "\r\n" => NewLineSetting.CarriageReturnNewline,
         _ => NewLineSetting.NotSet,
     });
        private void CheckBoxChanged(object sender, RoutedEventArgs e)
        {
            var value = RootCheckBox.IsChecked == true;

            if (_setting.GetValue() is bool currentValue &&
                value != currentValue)
            {
                _setting.SetValue(value);
            }
        }
 protected override IndentationSizeSetting GetCurrentValue()
 {
     return(_setting.GetValue() switch
     {
         1 => IndentationSizeSetting._1,
         2 => IndentationSizeSetting._2,
         3 => IndentationSizeSetting._3,
         4 => IndentationSizeSetting._4,
         5 => IndentationSizeSetting._5,
         6 => IndentationSizeSetting._6,
         7 => IndentationSizeSetting._7,
         _ => IndentationSizeSetting._8,
     });
示例#5
0
 protected override TabSizeSettings GetCurrentValue()
 {
     return(_setting.GetValue() switch
     {
         1 => TabSizeSettings._1,
         2 => TabSizeSettings._2,
         3 => TabSizeSettings._3,
         4 => TabSizeSettings._4,
         5 => TabSizeSettings._5,
         6 => TabSizeSettings._6,
         7 => TabSizeSettings._7,
         _ => TabSizeSettings._8,
     });
        public WhitespaceBoolSettingView(WhitespaceSetting setting)
        {
            InitializeComponent();
            RootCheckBox.SetValue(AutomationProperties.NameProperty, ServicesVSResources.Value);
            _setting = setting;

            if (setting.GetValue() is bool value)
            {
                RootCheckBox.IsChecked = value;
            }

            RootCheckBox.Checked   += CheckBoxChanged;
            RootCheckBox.Unchecked += CheckBoxChanged;
        }
示例#7
0
 protected override BinaryOperatorSpacingOptions GetCurrentValue()
 {
     return((BinaryOperatorSpacingOptions)_setting.GetValue() !);
 }
示例#8
0
 protected override LabelPositionOptions GetCurrentValue()
 {
     return((LabelPositionOptions)_setting.GetValue() !);
 }