private void ReadObjectProcessStream(StreamReader reader) { using (var jsonReader = new JsonTextReader(reader) { SupportMultipleContent = true }) { while (jsonReader.Read()) { try { var result = _jsonSerializer.Deserialize <ResultObject>(jsonReader); switch (result) { case ExceptionResultObject exceptionResult: Error?.Invoke(exceptionResult); break; case InputReadRequest _: ReadInput?.Invoke(); break; default: Dumped?.Invoke(result); break; } } catch (Exception ex) { Dumped?.Invoke(ResultObject.Create("Error deserializing result: " + ex.Message, DumpQuotas.Default)); } } } }
private async Task ReadProcessStream(StreamReader reader) { while (!reader.EndOfStream) { var line = await reader.ReadLineAsync().ConfigureAwait(false); if (line != null) { Dumped?.Invoke(ResultObject.Create(line, DumpQuotas.Default)); } } }
public static T Dump <T>(this T o, string?header = null, int maxDepth = DumpQuotas.DefaultMaxDepth, int maxExpandedDepth = DumpQuotas.DefaultMaxExpandedDepth, int maxEnumerableLength = DumpQuotas.DefaultMaxEnumerableLength, int maxStringLength = DumpQuotas.DefaultMaxStringLength) { Dumped?.Invoke(new DumpData(o, header, new DumpQuotas(maxDepth, maxExpandedDepth, maxEnumerableLength, maxStringLength))); return(o); }
private void OnDumped(IList <ResultObject> results) => Dumped?.Invoke(results);
public static T Dump <T>(this T o, string header = null) { Dumped?.Invoke(o, header); return(o); }
public static T Dump <T>(this T obj, string nameval = "") { Dumped?.Invoke(obj, nameval); return(obj); }
public static T Dump <T>(this T o) { Dumped?.Invoke(o, DumpTarget.Text); return(o); }
public static T DumpToPropertyGrid <T>(this T o) { Dumped?.Invoke(o, DumpTarget.PropertyGrid); return(o); }