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);
        }
Esempio n. 2
0
        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);
        }