Example #1
0
        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));
                    }
                }
            }
        }
Example #2
0
        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));
                }
            }
        }
Example #3
0
 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);
 }
Example #4
0
 private void OnDumped(IList <ResultObject> results) => Dumped?.Invoke(results);
Example #5
0
 public static T Dump <T>(this T o, string header = null)
 {
     Dumped?.Invoke(o, header);
     return(o);
 }
Example #6
0
 public static T Dump <T>(this T obj, string nameval = "")
 {
     Dumped?.Invoke(obj, nameval);
     return(obj);
 }
Example #7
0
 public static T Dump <T>(this T o)
 {
     Dumped?.Invoke(o, DumpTarget.Text);
     return(o);
 }
Example #8
0
 public static T DumpToPropertyGrid <T>(this T o)
 {
     Dumped?.Invoke(o, DumpTarget.PropertyGrid);
     return(o);
 }