public TraceStorageEngineEvent(DaxStudioTraceEventArgs ev, int rowNumber)
 {
     RowNumber = rowNumber;
     Subclass = ev.EventSubclass;
     Query = ev.TextData.RemoveDaxGuids().RemoveXmSqlSquareBrackets();
     // Skip Duration/Cpu Time for Cache Match
     if (Subclass != DaxStudioTraceEventSubclass.VertiPaqCacheExactMatch)
     {
         Duration = ev.Duration;
         CpuTime = ev.CpuTime;
     }
 }
 public void OnTraceEvent( DaxStudioTraceEventArgs e)
 {
     if (TraceEvent != null)
         TraceEvent(this, e);
 }
        private DaxStudioTraceEventArgs CreateTraceEventArg(xlAmo.TraceEventArgs traceEvent)
        {
            long cpuTime;
            long duration;

            // not all events have CpuTime
            try
            {
                cpuTime = traceEvent.CpuTime;
            }
            catch (ArgumentNullException)
            {
                cpuTime = 0;
            }
            // not all events have a duration
            try
            {
                duration = traceEvent.Duration;
            }
            catch (ArgumentNullException)
            {
                duration = 0;
            }

            var dsEvent = new DaxStudioTraceEventArgs(
                traceEvent.EventClass.ToString(),
                traceEvent.EventSubclass.ToString(),
                duration,
                cpuTime,
                traceEvent.TextData);
            return dsEvent;
        }
 public void OnTraceComplete(DaxStudioTraceEventArgs[] capturedEvents)
 {
     if (TraceCompleted != null)
     { TraceCompleted(this, capturedEvents.ToList<DaxStudioTraceEventArgs>()); }
 }