Esempio n. 1
0
            private void HandleEvent(TraceEventType eventType, params object[] data)
            {
                if (eventType == TraceEventType.Error)
                {
                    exceptionCount++;
                    Console.Error.WriteLine(Misc.ArrayToString(data));

                    // Try to catch a dynamically generated exception
                    if ((data.Length == 1) && (data[0] is System.Exception) && (((System.Exception)data[0]).Message == ASSERTED_HELLO_VALUE))
                    {
                        foundDynamicException = true;
                    }
                }
                else if (eventType == TraceEventType.Critical)
                {
                    exceptionCount++;
                    Console.Error.WriteLine(Misc.ArrayToString(data));

                    // Stop rule processing on fatal exceptions
                    bre.Stop();
                }
                else if ((eventType == TraceEventType.Information) && (data.Length == 1) && (data[0].ToString() == ASSERTED_HELLO_VALUE))
                {
                    foundDynamicLog = true;
                    Console.Out.WriteLine(Misc.ArrayToString(data));
                }
            }