private static ClassAndMethod GetCallerDetails() { var result = new ClassAndMethod { ClassName = "Unknown", MethodName = "Unknown" }; var trace = new StackTrace(false); for (var index = 0; index <= trace.FrameCount - 1; index++) { StackFrame frame = trace.GetFrame(index); MethodBase method = frame.GetMethod(); if (!method.DeclaringType.Equals(typeof(LoggingManager)) && !method.DeclaringType.Equals(typeof(Log4NetExtensionMethods))) { result.ClassName = method.ReflectedType.FullName; result.MethodName = method.Name; // I would like to get the values that created the exception, but could not find a simple way to get them break; } } return(result); }
private void MethodComboBox_SelectedIndexChanged(object sender, EventArgs e) { _classAndMethod = _assemblyLoader.GetClient((string)methodComboBox.SelectedValue); Cursor.Current = Cursors.WaitCursor; List <ThriftObject> objs = ThriftObjectFactory.CreateThriftObjects(_classAndMethod.Method.GetParameters()); requestTreeView.Nodes.Clear(); requestTreeView.BeginUpdate(); TreeNode[] nodes = ConvertToTreeNodes(objs); requestTreeView.Nodes.AddRange(nodes); requestTreeView.EndUpdate(); Cursor.Current = Cursors.Default; }
private static ClassAndMethod GetCallerDetails() { var result = new ClassAndMethod { ClassName = "Unknown", MethodName = "Unknown" }; var trace = new StackTrace(false); for (var index = 0; index <= trace.FrameCount - 1; index++) { StackFrame frame = trace.GetFrame(index); MethodBase method = frame.GetMethod(); if (!method.DeclaringType.Equals(typeof(LoggingManager)) && !method.DeclaringType.Equals(typeof(Log4NetExtensionMethods))) { result.ClassName = method.ReflectedType.FullName; result.MethodName = method.Name; // I would like to get the values that created the exception, but could not find a simple way to get them break; } } return result; }