/// <summary> /// Gets all the calls associated to a ListView /// </summary> /// <param name="id">The id of the ListView to retrives</param> /// <returns>The ListView and all the calls the match the filters</returns> public IHttpActionResult Get(int id) { try { var cv = new CallsView(); using (var context = new DbModel()) { var lv = context.ListViews .Include(x => x.Filters) .Where(x => x.Id == id) .FirstOrDefault(); if (lv == null) { return(NotFound()); } cv.ListView = lv; var calls = context.Calls.Where("ID>0"); foreach (var filter in lv.Filters) { calls = calls.Where(filter.Where); } cv.Calls = calls.ToList(); } return(Ok(cv)); } catch (Exception e) { logger.Error(e); return(InternalServerError(e)); } }
public async Task SetCallStack(Tuple <string, string, int>[] stack, int index = 0) { CallsView.BeginUpdate(); CallsView.Items.Clear(); foreach (var entry in stack) { ListViewItem item = new ListViewItem(entry.Item1 != "" ? string.Format("{0}()", entry.Item1) : "anon"); item.SubItems.Add(entry.Item2); item.SubItems.Add(entry.Item3.ToString()); CallsView.Items.Add(item); } CallsView.EndUpdate(); _frame = -1; await LoadStackFrame(index); }