Exemplo n.º 1
0
 internal void WriteStringToListener(EventListener listener, string msg, SessionMask m)
 {
     Contract.Assert(listener == null || (uint)m == (uint)SessionMask.FromId(0));
     
     if (m_eventSourceEnabled)
     {
         if (listener == null)
         {
             WriteEventString(0, (long) m.ToEventKeywords(), msg);
         }
         else
         {
             List<object> arg = new List<object>();
             arg.Add(msg);
             EventWrittenEventArgs eventCallbackArgs = new EventWrittenEventArgs(this);
             eventCallbackArgs.EventId = 0;
             eventCallbackArgs.Payload = new ReadOnlyCollection<object>(arg);
             listener.OnEventWritten(eventCallbackArgs);
         }
     }
 }
Exemplo n.º 2
0
 internal void WriteString(string msg, SessionMask m)
 {
     if (m_eventSourceEnabled)
     {
         WriteEventString(0, (long) m.ToEventKeywords(), msg);
         WriteStringToAllListeners(msg);
     }
 }