[11700] | 1 | // |
---|
| 2 | // TextEditorOptions.cs |
---|
| 3 | // |
---|
| 4 | // Author: |
---|
| 5 | // Mike Krüger <mkrueger@xamarin.com> |
---|
| 6 | // |
---|
| 7 | // Copyright (c) 2012 Xamarin Inc. (http://xamarin.com) |
---|
| 8 | // |
---|
| 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy |
---|
| 10 | // of this software and associated documentation files (the "Software"), to deal |
---|
| 11 | // in the Software without restriction, including without limitation the rights |
---|
| 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
---|
| 13 | // copies of the Software, and to permit persons to whom the Software is |
---|
| 14 | // furnished to do so, subject to the following conditions: |
---|
| 15 | // |
---|
| 16 | // The above copyright notice and this permission notice shall be included in |
---|
| 17 | // all copies or substantial portions of the Software. |
---|
| 18 | // |
---|
| 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
---|
| 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
---|
| 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
---|
| 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
---|
| 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
---|
| 24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
---|
| 25 | // THE SOFTWARE. |
---|
| 26 | |
---|
| 27 | using System; |
---|
| 28 | |
---|
| 29 | namespace ICSharpCode.NRefactory.CSharp |
---|
| 30 | { |
---|
| 31 | /// <summary> |
---|
| 32 | /// The text editor options class holds basic information about the text editor settings that influences code generation and formatting beside |
---|
| 33 | /// the CSharpFormattingOptions. |
---|
| 34 | /// </summary> |
---|
| 35 | public class TextEditorOptions |
---|
| 36 | { |
---|
| 37 | public static readonly TextEditorOptions Default = new TextEditorOptions (); |
---|
| 38 | |
---|
| 39 | /// <summary> |
---|
| 40 | /// Gets or sets a value indicating if tabs need to be replaced by spaces. If that is true, all indenting will be done with spaces only, |
---|
| 41 | /// otherwise the indenting will start with tabs. |
---|
| 42 | /// </summary> |
---|
| 43 | public bool TabsToSpaces { |
---|
| 44 | get; |
---|
| 45 | set; |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | /// <summary> |
---|
| 49 | /// Gets or sets the size of the tab chacter as spaces. |
---|
| 50 | /// </summary> |
---|
| 51 | public int TabSize { |
---|
| 52 | get; |
---|
| 53 | set; |
---|
| 54 | } |
---|
| 55 | |
---|
| 56 | /// <summary> |
---|
| 57 | /// Gets or sets the size of a single indent as spaces. |
---|
| 58 | /// </summary> |
---|
| 59 | public int IndentSize { |
---|
| 60 | get; |
---|
| 61 | set; |
---|
| 62 | } |
---|
| 63 | |
---|
| 64 | /// <summary> |
---|
| 65 | /// Gets or sets the continuation indent. A continuation indent is the indent that will be put after an embedded statement that is no block. |
---|
| 66 | /// </summary> |
---|
| 67 | public int ContinuationIndent { |
---|
| 68 | get; |
---|
| 69 | set; |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | /// <summary> |
---|
| 73 | /// Gets or sets the label indent. A label indent is the indent that will be put before an label. |
---|
| 74 | /// (Note: it may be negative -IndentSize would cause that labels are unindented) |
---|
| 75 | /// </summary> |
---|
| 76 | public int LabelIndent { |
---|
| 77 | get; |
---|
| 78 | set; |
---|
| 79 | } |
---|
| 80 | |
---|
| 81 | /// <summary> |
---|
| 82 | /// Gets or sets the eol marker. |
---|
| 83 | /// </summary> |
---|
| 84 | public string EolMarker { |
---|
| 85 | get; |
---|
| 86 | set; |
---|
| 87 | } |
---|
| 88 | |
---|
| 89 | /// <summary> |
---|
| 90 | /// If true blank lines will be indented up to the indent level, otherwise blank lines will have the length 0. |
---|
| 91 | /// </summary> |
---|
| 92 | public bool IndentBlankLines { |
---|
| 93 | get; |
---|
| 94 | set; |
---|
| 95 | } |
---|
| 96 | |
---|
| 97 | /// <summary> |
---|
| 98 | /// Gets or sets the length of the desired line length. The formatting engine will wrap at wrap points set to Wrapping.WrapIfTooLong if the line length is too long. |
---|
| 99 | /// 0 means do not wrap. |
---|
| 100 | /// </summary> |
---|
| 101 | public int WrapLineLength { |
---|
| 102 | get; |
---|
| 103 | set; |
---|
| 104 | } |
---|
| 105 | |
---|
| 106 | public TextEditorOptions() |
---|
| 107 | { |
---|
| 108 | TabsToSpaces = false; |
---|
| 109 | TabSize = 4; |
---|
| 110 | IndentSize = 4; |
---|
| 111 | ContinuationIndent = 4; |
---|
| 112 | WrapLineLength = 0; |
---|
| 113 | EolMarker = Environment.NewLine; |
---|
| 114 | } |
---|
| 115 | } |
---|
| 116 | } |
---|