protected virtual void OnCommErrorEvent(CommErrorEventArgs args)
        {
            if (args.EventType == 0)
            {
                return;
            }

            if (Log.SerialTrace(System.Diagnostics.TraceEventType.Verbose))
            {
                Log.Serial.TraceEvent(System.Diagnostics.TraceEventType.Verbose, 0,
                                      "{0}: CommErrorEvent: {1}", m_Name, args.EventType.ToString());
            }

            EventHandler <CommErrorEventArgs> handler = CommErrorEvent;

            if (handler != null)
            {
                handler(this, args);
            }
        }
示例#2
0
        protected virtual void OnCommErrorEvent(CommErrorEventArgs args)
        {
            if (args.EventType == 0)
            {
                return;
            }

            if (SerialTrace.TraceSer.Switch.ShouldTrace(System.Diagnostics.TraceEventType.Verbose))
            {
                // args.EventType.ToString() is relatively expensive, so only do it if we're logging
                SerialTrace.TraceSer.TraceEvent(System.Diagnostics.TraceEventType.Verbose, 0,
                                                "{0}: CommErrorEvent: {1}", m_Name, args.EventType.ToString());
            }

            EventHandler <CommErrorEventArgs> handler = CommErrorEvent;

            if (handler != null)
            {
                handler(this, args);
            }
        }