Ejemplo n.º 1
0
        public FormattingOptions()
        {
            Indentation = new IndentationOptions();
            NewLines = new NewLinesOptions();
            Spacing = new SpacingOptions();

            SpacesPerIndent = 4;
            NewLine = Environment.NewLine;
        }
Ejemplo n.º 2
0
        public FormattingOptions()
        {
            Indentation = new IndentationOptions();
            NewLines    = new NewLinesOptions();
            Spacing     = new SpacingOptions();

            SpacesPerIndent = 4;
            NewLine         = Environment.NewLine;
        }
        public FormattingIndentationViewModel(IServiceProvider serviceProvider, IndentationOptions page)
            : base(serviceProvider)
        {
            Items.Add(new CheckBoxOptionViewModel(new Option<bool>("Indent block contents", () => page.IndentBlockContents, v => page.IndentBlockContents = v), BlockContentPreview, this));
            Items.Add(new CheckBoxOptionViewModel(new Option<bool>("Indent open and close braces", () => page.IndentOpenAndCloseBraces, v => page.IndentOpenAndCloseBraces = v), IndentBracePreview, this));
            Items.Add(new CheckBoxOptionViewModel(new Option<bool>("Indent case contents", () => page.IndentCaseContents, v => page.IndentCaseContents = v), SwitchCasePreview, this));
            Items.Add(new CheckBoxOptionViewModel(new Option<bool>("Indent case labels", () => page.IndentCaseLabels, v => page.IndentCaseLabels = v), SwitchCasePreview, this));

            Items.Add(new TextBlock { Text = "Preprocessor directive indentation" });

            Items.Add(new RadioButtonViewModel<PreprocessorDirectivePosition>(PreprocessorDirectivePreview, "directive", PreprocessorDirectivePosition.OneIndentToLeft,
                new Option<PreprocessorDirectivePosition>("One indent to the left", () => page.PreprocessorDirectivePosition, v => page.PreprocessorDirectivePosition = v), this));
            Items.Add(new RadioButtonViewModel<PreprocessorDirectivePosition>(PreprocessorDirectivePreview, "directive", PreprocessorDirectivePosition.MoveToLeftmostColumn,
                new Option<PreprocessorDirectivePosition>("Move to the leftmost column", () => page.PreprocessorDirectivePosition, v => page.PreprocessorDirectivePosition = v), this));
            Items.Add(new RadioButtonViewModel<PreprocessorDirectivePosition>(PreprocessorDirectivePreview, "directive", PreprocessorDirectivePosition.LeaveIndented,
                new Option<PreprocessorDirectivePosition>("Leave indented", () => page.PreprocessorDirectivePosition, v => page.PreprocessorDirectivePosition = v), this));
        }