This class holds the ActivityId that would be set on the thread for ETW during the trace.
Esempio n. 1
0
        internal static EventTraceActivity GetActivity(string id)
        {
            EventTraceActivity activity = null;
            if (!string.IsNullOrEmpty(id))
            {
                int pos = id.IndexOf('_');
                Guid guidPart;
                if ((pos > 0 && Guid.TryParse(id.Substring(0, pos), out guidPart))
                    || Guid.TryParse(id, out guidPart))
                {
                    activity = new EventTraceActivity(guidPart);
                }
            }

            return activity ?? new EventTraceActivity();
        }