/// <summary> /// Return the process name /// </summary> /// <param name="value">The process name</param> /// <param name="cache">Unused</param> /// <param name="source">Unused</param> /// <param name="eventType">Unused</param> /// <param name="id">Unused</param> /// <param name="formatOrMessage">Unused</param> /// <param name="data">Unused</param> /// <returns>True</returns> public override bool TryGetValue(out object value, TraceEventCache cache, string source, TraceEventType eventType, int id, string formatOrMessage, object[] data) { ExtendedTraceEventCache ext = cache as ExtendedTraceEventCache; if (ext != null) { value = ext.ExtendedProcessName; return(true); } value = _processName; return(_readOK); }
/// <summary> /// Get the ThreadId value from the TraceEventCache object /// </summary> /// <param name="value">The ThreadId if the TraceEventCache is not null</param> /// <param name="cache">The TraceEventCache from which to read the ThreadId</param> /// <param name="source">Unused</param> /// <param name="eventType">Unused</param> /// <param name="id">Unused</param> /// <param name="formatOrMessage">Unused</param> /// <param name="data">Unused</param> /// <returns>True if the cache value is not null otherwise false</returns> public override bool TryGetValue(out object value, TraceEventCache cache, string source, TraceEventType eventType, int id, string formatOrMessage, object[] data) { if (cache == null) { value = null; return(false); } ExtendedTraceEventCache ext = cache as ExtendedTraceEventCache; if (ext != null) { value = ext.ExtendedThreadId; return(true); } value = cache.ThreadId; return(true); }