static void BuildBindableListFromDebugItems(DebugLine list, Dictionary <string, DebugLineGroup> groups, IDebugItemResult result, bool isInputs) { if (string.IsNullOrEmpty(result.GroupName)) { list.LineItems.Add(new DebugLineItem(result)); } else { if (!groups.TryGetValue(result.GroupName, out DebugLineGroup group)) { var label = isInputs ? string.Format("{0} = ", result.Label) : result.Label; group = new DebugLineGroup(result.GroupName, label) { MoreLink = result.MoreLink }; groups.Add(group.GroupName, group); list.LineItems.Add(group); } if (!group.Rows.TryGetValue(result.GroupIndex, out DebugLineGroupRow row)) { row = new DebugLineGroupRow(); group.Rows.Add(result.GroupIndex, row); } row.LineItems.Add(new DebugLineItem(result)); } }
static void BuildBindableListFromDebugItems(IEnumerable <IDebugItem> debugItems, ICollection <object> destinationList) { destinationList.Clear(); if (debugItems == null) { return; } foreach (var item in debugItems) { var list = new DebugLine(); var groups = new Dictionary <string, DebugLineGroup>(); foreach (var result in item.FetchResultsList()) { if (string.IsNullOrEmpty(result.GroupName)) { list.LineItems.Add(new DebugLineItem(result)); } else { DebugLineGroup group; if (!groups.TryGetValue(result.GroupName, out group)) { group = new DebugLineGroup(result.GroupName, result.Label) { MoreLink = result.MoreLink }; groups.Add(group.GroupName, group); list.LineItems.Add(group); } DebugLineGroupRow row; if (!group.Rows.TryGetValue(result.GroupIndex, out row)) { row = new DebugLineGroupRow(); group.Rows.Add(result.GroupIndex, row); } row.LineItems.Add(new DebugLineItem(result)); } } destinationList.Add(list); } }