Example #1
0
        private static void SharedState_SpyEvent(object sender, Cortex.Net.Spy.SpyEventArgs e)
        {
            var type = e.GetType();

            Trace.WriteLine("-------------");
            Trace.WriteLine($"[Spy] Event: {type.Name}");
            foreach (var prop in type.GetProperties())
            {
                Trace.WriteLine($"[Spy] {prop.Name}: {prop.GetValue(e)}");
            }
        }
Example #2
0
        private static void SharedState_SpyEvent(object sender, Cortex.Net.Spy.SpyEventArgs e)
        {
            var type = e.GetType();

            Trace.WriteLine("-------------");
            Trace.WriteLine($"[Spy] Event: {type.Name}");
            foreach (var prop in type.GetProperties())
            {
                object value = prop.GetValue(e);

                if (value is IEnumerable enumerable && !(value is string))
                {
                    int counter = 0;
                    foreach (var val in enumerable)
                    {
                        Trace.WriteLine($"[Spy] {prop.Name}{counter++}: {val}");
                    }
                }