/// <summary> /// Initializes a new instance of the <see cref="CloseElementFormatter"/> class. /// </summary> /// <param name="context"> /// The context in which to format. /// </param> public CloseElementFormatter(FormattingContext context) { this.context = context; }
/// <summary> /// Initializes a new instance of the <see cref="XamlFormatter"/> class. /// </summary> /// <param name="context"> /// The context. /// </param> public XamlFormatter(FormattingContext context) { this.context = context ?? throw new ArgumentNullException(nameof(context)); }
/// <summary> /// Initializes a new instance of the <see cref="CommentFormatter"/> class. /// </summary> /// <param name="context"> /// The context. /// </param> public CommentFormatter(FormattingContext context) { this.context = context; }
/// <summary> /// Initializes a new instance of the <see cref="SignificantWhiteSpaceFormatter"/> class. /// </summary> /// <param name="context"> /// The context. /// </param> public SignificantWhiteSpaceFormatter(FormattingContext context) { this.context = context; }
/// <summary> /// Initializes a new instance of the <see cref="XmlDeclarationFormatter"/> class. /// </summary> /// <param name="context"> /// The context. /// </param> public XmlDeclarationFormatter(FormattingContext context) { this.context = context; }
/// <summary> /// Initializes a new instance of the <see cref="ProcessingInstructionFormatter"/> class. /// </summary> /// <param name="context"> /// The context. /// </param> public ProcessingInstructionFormatter(FormattingContext context) { this.context = context; }
/// <summary> /// TAppends a line selectively to the builder depending on the current state of the formatting context. /// </summary> /// <param name="builder"> /// The builder. /// </param> /// <param name="context"> /// The context. /// </param> /// <returns> /// The original <see cref="StringBuilder"/>. /// </returns> public static StringBuilder AppendLine(this StringBuilder builder, FormattingContext context) => context.Element.PreserveSpace ? builder : builder.AppendLine();
/// <summary> /// Indents the builder to the current formatting depth. /// </summary> /// <param name="builder"> /// The builder. /// </param> /// <param name="context"> /// The context. /// </param> /// <param name="respectWhiteSpace"> /// A value indicating whether to respect white space. /// </param> /// <returns> /// The original <see cref="StringBuilder"/>. /// </returns> public static StringBuilder Indent( this StringBuilder builder, FormattingContext context, bool respectWhiteSpace = true) => builder.Append(context.GetIndent(respectWhiteSpace));
/// <summary> /// Initializes a new instance of the <see cref="MarkupExtensionFormatter"/> class. /// </summary> /// <param name="context"> /// The context. /// </param> public MarkupExtensionFormatter(FormattingContext context) { this.context = context; }
/// <summary> /// Initializes a new instance of the <see cref="TextFormatter"/> class. /// </summary> /// <param name="context"> /// The context. /// </param> public TextFormatter(FormattingContext context) { this.context = context; }
/// <summary> /// Initializes a new instance of the <see cref="AttributeFormatter"/> class. /// </summary> /// <param name="context"> /// The context. /// </param> public AttributeFormatter(FormattingContext context) { this.context = context; }