Beispiel #1
0
 /// <summary>
 /// Gets the stack frame length for only the strings in the stack frame.
 /// </summary>
 /// <returns></returns>
 private static int GetStackFrameLength(Coding4Fun.VisualStudio.ApplicationInsights.Extensibility.Implementation.External.StackFrame stackFrame)
 {
     return(((stackFrame.method != null) ? stackFrame.method.Length : 0) + ((stackFrame.assembly != null) ? stackFrame.assembly.Length : 0) + ((stackFrame.fileName != null) ? stackFrame.fileName.Length : 0));
 }
Beispiel #2
0
        /// <summary>
        /// Converts a System.Diagnostics.StackFrame to a Coding4Fun.VisualStudio.ApplicationInsights.Extensibility.Implementation.TelemetryTypes.StackFrame.
        /// </summary>
        /// <returns></returns>
        private static Coding4Fun.VisualStudio.ApplicationInsights.Extensibility.Implementation.External.StackFrame GetStackFrame(System.Diagnostics.StackFrame stackFrame, int frameId)
        {
            Coding4Fun.VisualStudio.ApplicationInsights.Extensibility.Implementation.External.StackFrame stackFrame2 = new Coding4Fun.VisualStudio.ApplicationInsights.Extensibility.Implementation.External.StackFrame
            {
                level = frameId
            };
            MethodBase method = stackFrame.GetMethod();
            string     text2  = stackFrame2.method = ((!(method.DeclaringType != null)) ? method.Name : (method.DeclaringType.FullName + "." + method.Name));

            stackFrame2.assembly = method.Module.Assembly.FullName;
            stackFrame2.fileName = stackFrame.GetFileName();
            int fileLineNumber = stackFrame.GetFileLineNumber();

            if (fileLineNumber != 0)
            {
                stackFrame2.line = fileLineNumber;
            }
            return(stackFrame2);
        }