public void Execute(JsonFormatterStrategyContext context) { if (!context.IsProcessingDoubleQuoteInitiatedString && !context.WasLastCharacterABackSlash) context.IsProcessingSingleQuoteInitiatedString = !context.IsProcessingSingleQuoteInitiatedString; context.AppendCurrentChar(); }
public void Execute(JsonFormatterStrategyContext context) { if (context.IsProcessingString) { context.AppendCurrentChar(); } }
public void Execute(JsonFormatterStrategyContext context) { if (context.IsProcessingString) { context.AppendCurrentChar(); } }
public void Execute(JsonFormatterStrategyContext context) { if (!context.IsProcessingSingleQuoteInitiatedString && !context.WasLastCharacterABackSlash) { context.IsProcessingDoubleQuoteInitiatedString = !context.IsProcessingDoubleQuoteInitiatedString; } context.AppendCurrentChar(); }
public void Execute(JsonFormatterStrategyContext context) { if (context.IsProcessingString) { context.AppendCurrentChar(); return; } PeformNonStringPrint(context); }
public void Execute(JsonFormatterStrategyContext context) { if (context.IsProcessingString) { context.AppendCurrentChar(); return; } PeformNonStringPrint(context); }
public void Execute(JsonFormatterStrategyContext context) { if (context.IsProcessingString) { context.AppendCurrentChar(); return; } context.CloseCurrentScope(); context.BuildContextIndents(); context.AppendCurrentChar(); }
public void Execute(JsonFormatterStrategyContext context) { context.AppendCurrentChar(); if (context.IsProcessingString) { return; } context.BuildContextIndents(); context.IsProcessingVariableAssignment = false; }
public void Execute(JsonFormatterStrategyContext context) { if (context.IsProcessingString) { context.AppendCurrentChar(); return; } context.CloseCurrentScope(); context.BuildContextIndents(); context.AppendCurrentChar(); }
public void Execute(JsonFormatterStrategyContext context) { context.AppendCurrentChar(); if (context.IsProcessingString) { return; } context.BuildContextIndents(); context.IsProcessingVariableAssignment = false; }
public void Execute(JsonFormatterStrategyContext context) { if (context.IsProcessingString) { context.AppendCurrentChar(); return; } context.IsProcessingVariableAssignment = true; context.AppendCurrentChar(); context.AppendSpace(); }
public void Execute(JsonFormatterStrategyContext context) { if (context.IsProcessingString) { context.AppendCurrentChar(); return; } context.IsProcessingVariableAssignment = true; context.AppendCurrentChar(); context.AppendSpace(); }
/// <summary> /// Returns a 'pretty printed' version of the specified JSON string, formatted for human /// consumption. /// </summary> /// <param name="json">A valid JSON string.</param> /// <returns>A 'pretty printed' version of the specified JSON string.</returns> public static string Format(string json) { if (json == null) { throw new ArgumentNullException("json should not be null."); } var context = new JsonFormatterStrategyContext(); var formatter = new JsonFormatterInternal(context); return(formatter.Format(json)); }
public void Execute(JsonFormatterStrategyContext context) { if (context.IsProcessingString) { context.AppendCurrentChar(); return; } context.AppendCurrentChar(); context.EnterObjectScope(); if (!IsBeginningOfNewLineAndIndentionLevel(context)) return; context.BuildContextIndents(); }
public void Execute(JsonFormatterStrategyContext context) { if (context.IsProcessingString) { context.AppendCurrentChar(); return; } context.AppendCurrentChar(); context.EnterObjectScope(); if (!IsBeginningOfNewLineAndIndentionLevel(context)) { return; } context.BuildContextIndents(); }
public void Execute(JsonFormatterStrategyContext context) { context.AppendCurrentChar(); }
private static void PeformNonStringPrint(JsonFormatterStrategyContext context) { context.CloseCurrentScope(); context.BuildContextIndents(); context.AppendCurrentChar(); }
private static void PeformNonStringPrint(JsonFormatterStrategyContext context) { context.CloseCurrentScope(); context.BuildContextIndents(); context.AppendCurrentChar(); }
private static bool IsBeginningOfNewLineAndIndentionLevel(JsonFormatterStrategyContext context) { return context.IsProcessingVariableAssignment || (!context.IsStart && !context.IsInArrayScope); }
private static bool IsBeginningOfNewLineAndIndentionLevel(JsonFormatterStrategyContext context) { return(context.IsProcessingVariableAssignment || (!context.IsStart && !context.IsInArrayScope)); }
public void Execute(JsonFormatterStrategyContext context) { context.AppendCurrentChar(); }