示例#1
0
        public static string FormatJson(JToken value)
        {
            var builder   = new ColoredStringBuilder();
            var formatter = new WhatIfJsonFormatter(builder);

            formatter.FormatJson(value, "");

            return(builder.ToString());
        }
示例#2
0
        public static string Format(PSWhatIfOperationResult result)
        {
            var builder   = new ColoredStringBuilder();
            var formatter = new WhatIfOperationResultFormatter(builder);

            formatter.FormatPreviewNotice();
            formatter.FormatLegend(result.Changes);
            formatter.FormatResourceChanges(result.Changes);
            formatter.FormatStats(result.Changes);

            return(builder.ToString());
        }
 private WhatIfOperationResultFormatter(ColoredStringBuilder builder)
     : base(builder)
 {
 }
示例#4
0
 public WhatIfJsonFormatter(ColoredStringBuilder builder)
 {
     this.Builder = builder;
 }
示例#5
0
 public AnsiColorScope(ColoredStringBuilder builder, Color color)
 {
     this.builder = builder;
     this.builder.PushColor(color);
 }