コード例 #1
0
        private void CheckBoxChanged(object sender, RoutedEventArgs e)
        {
            var value = RootCheckBox.IsChecked == true;

            if (_setting.GetValue() is bool currentValue && value != currentValue)
            {
                _setting.SetValue(value);
            }
        }
コード例 #2
0
ファイル: NewLineViewModel.cs プロジェクト: belav/roslyn
 protected override NewLineSetting GetCurrentValue()
 {
     return(_setting.GetValue() switch
     {
         "\n" => NewLineSetting.Newline,
         "\r" => NewLineSetting.CarrageReturn,
         "\r\n" => NewLineSetting.CarrageReturnNewline,
         _ => NewLineSetting.NotSet,
     });
コード例 #3
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,
     });
コード例 #4
0
 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
        public FormattingBoolSettingView(FormattingSetting 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;
        }
コード例 #6
0
 protected override BinaryOperatorSpacingOptions GetCurrentValue()
 {
     return((BinaryOperatorSpacingOptions)_setting.GetValue() !);
 }
コード例 #7
0
 protected override LabelPositionOptions GetCurrentValue()
 {
     return((LabelPositionOptions)_setting.GetValue() !);
 }