Reformat() 공개 메소드

public Reformat ( IDocumentAccessor doc, IndentationSettings set ) : void
doc IDocumentAccessor
set IndentationSettings
리턴 void
		/// <summary>
		///     Performs indentation using the specified document accessor.
		/// </summary>
		/// <param name="document">Object used for accessing the document line-by-line</param>
		/// <param name="keepEmptyLines">Specifies whether empty lines should be kept</param>
		public int Indent(IDocumentAccessor document, bool keepEmptyLines, int caretOffset)
		{
			if (document == null)
				throw new ArgumentNullException("document");
			var settings = new IndentationSettings();
			settings.IndentString = IndentationString;
			settings.LeaveEmptyLines = keepEmptyLines;

			var r = new IndentationReformatter();
			r.Reformat(document, settings);
			return caretOffset;
		}
예제 #2
0
        /// <summary>
        ///     Performs indentation using the specified document accessor.
        /// </summary>
        /// <param name="document">Object used for accessing the document line-by-line</param>
        /// <param name="keepEmptyLines">Specifies whether empty lines should be kept</param>
        public int Indent(IDocumentAccessor document, bool keepEmptyLines, int caretOffset)
        {
            if (document == null)
            {
                throw new ArgumentNullException("document");
            }
            var settings = new IndentationSettings();

            settings.IndentString    = IndentationString;
            settings.LeaveEmptyLines = keepEmptyLines;

            var r = new IndentationReformatter();

            r.Reformat(document, settings);
            return(caretOffset);
        }