private void UpdateRootNodeText(NodeInfo node) { IInspectedObject root = GetInspectedObject(node); if (root == null) { return; } var ls = root.EnumInvolvedLogSources().FirstOrDefault(); if (ls == null) { return; } var nodeText = new StringBuilder(root.Id); if (!string.IsNullOrEmpty(ls.Annotation)) { nodeText.AppendFormat(" ({0})", ls.Annotation); } if (root.Comment != "") { nodeText.AppendFormat(" ({0})", root.Comment); } view.SetNodeText(node, nodeText.ToString()); }
static private string GetNodeText(IInspectedObject node, int level, ImmutableDictionary <ILogSource, string> annotationsMap) { switch (level) { case 0: return(""); case 1: var rootNodeText = new StringBuilder(node.Id); var ls = node.EnumInvolvedLogSources().FirstOrDefault(); if (ls != null && annotationsMap.TryGetValue(ls, out var logSourceAnnotation)) { rootNodeText.AppendFormat(" ({0})", logSourceAnnotation); } if (node.Comment != "") { rootNodeText.AppendFormat(" ({0})", node.Comment); } return(rootNodeText.ToString()); default: string nodeText = node.DisplayName; if (node.Comment != "") { nodeText += " (" + node.Comment + ")"; } return(nodeText); } }
static PaintNodeDelegate MakePaintNodeDelegate( Func <IStateInspectorOutputsGroup, FocusedMessageEventsRange> getFocusedMessageEqualRange ) { NodePaintInfo result(IObjectsTreeNode node, bool getPrimaryPropValue) { var ret = new NodePaintInfo(); IInspectedObject obj = (node as VisualizerNode)?.InspectedObject; if (obj == null) { return(ret); } ret.DrawingEnabled = true; var focusedMessageEventsRange = getFocusedMessageEqualRange(obj.Owner); var liveStatus = obj.GetLiveStatus(focusedMessageEventsRange); var coloring = GetLiveStatusColoring(liveStatus); ret.Coloring = coloring; if (liveStatus == InspectedObjectLiveStatus.Alive || liveStatus == InspectedObjectLiveStatus.Deleted || obj.IsTimeless) { if (getPrimaryPropValue) { ret.PrimaryPropValue = obj.GetCurrentPrimaryPropertyValue(focusedMessageEventsRange); } } if (obj.Parent == null) { var focusedLs = focusedMessageEventsRange?.FocusedMessage?.GetLogSource(); if (focusedLs != null) { ret.DrawFocusedMsgMark = obj.EnumInvolvedLogSources().Any(ls => ls == focusedLs); } } return(ret); } return(result); }
NodePaintInfo IViewModel.OnPaintNode(NodeInfo node, bool getPrimaryPropValue) { var ret = new NodePaintInfo(); IInspectedObject obj = GetInspectedObject(node); if (obj == null) { return(ret); } ret.DrawingEnabled = true; var focusedMessageInfo = GetFocusedMessageEqualRange(obj); var liveStatus = obj.GetLiveStatus(focusedMessageInfo); var coloring = GetLiveStatusColoring(liveStatus); ret.Coloring = coloring; if (liveStatus == InspectedObjectLiveStatus.Alive || liveStatus == InspectedObjectLiveStatus.Deleted || obj.IsTimeless) { if (getPrimaryPropValue) { ret.PrimaryPropValue = obj.GetCurrentPrimaryPropertyValue(focusedMessageInfo); } } if (obj.Parent == null && focusedMessageInfo != null) { var m = focusedMessageInfo.FocusedMessage.FocusedMessage; if (m != null) { var focusedLs = m.GetLogSource(); if (focusedLs != null) { ret.DrawFocusedMsgMark = obj.EnumInvolvedLogSources().Any(ls => ls == focusedLs); } } } return(ret); }