Ejemplo n.º 1
0
 /// <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;
 }
Ejemplo n.º 2
0
 /// <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));
 }
Ejemplo n.º 3
0
 /// <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;
 }
Ejemplo n.º 4
0
 /// <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;
 }
Ejemplo n.º 5
0
 /// <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;
 }
Ejemplo n.º 6
0
 /// <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;
 }
Ejemplo n.º 7
0
 /// <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();
Ejemplo n.º 8
0
 /// <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));
Ejemplo n.º 9
0
 /// <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;
 }
Ejemplo n.º 10
0
 /// <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;
 }
Ejemplo n.º 11
0
 /// <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;
 }