/// <summary>
 /// Initializes a new instance of the <see cref="ICSharpCode.NRefactory.Al.AlFormatter"/> class.
 /// </summary>
 /// <param name="policy">The formatting policy to use.</param>
 /// <param name="options">The text editor options (optional). Default is: TextEditorOptions.Default</param>
 public AlFormatter(AlFormattingOptions policy, TextEditorOptions options = null)
 {
     if (policy == null)
     {
         throw new ArgumentNullException("policy");
     }
     this.policy  = policy;
     this.options = options ?? TextEditorOptions.Default;
 }
Exemplo n.º 2
0
        /// <summary>
        ///     Creates a new AlIndentEngine instance.
        /// </summary>
        /// <param name="document">
        ///     An instance of <see cref="IDocument"/> which is being parsed.
        /// </param>
        /// <param name="formattingOptions">
        ///     C# formatting options.
        /// </param>
        /// <param name="textEditorOptions">
        ///    Text editor options for indentation.
        /// </param>
        public AlIndentEngine(IDocument document, TextEditorOptions textEditorOptions, AlFormattingOptions formattingOptions)
        {
            this.formattingOptions = formattingOptions;
            this.textEditorOptions = textEditorOptions;
            this.document          = document;

            this.currentState = new GlobalBodyState(this);

            this.conditionalSymbols       = new HashSet <string>();
            this.customConditionalSymbols = new HashSet <string>();
            this.wordToken       = new StringBuilder();
            this.previousKeyword = string.Empty;
            this.newLineChar     = textEditorOptions.EolMarker[0];
        }
Exemplo n.º 3
0
 public ConstructFixer(AlFormattingOptions options, TextEditorOptions textEditorOptions)
 {
     this.options           = options;
     this.textEditorOptions = textEditorOptions;
 }
Exemplo n.º 4
0
 public Indent(TextEditorOptions options)
 {
     this.options = options;
     Reset();
 }