示例#1
0
        internal bool MightHaveChildren(IVariableInformation variable)
        {
            VisualizerInfo visualizer = VisualizerScanner.FindType(variable);
            ExpandType     expandType = visualizer?.GetExpandType();

            if (expandType != null)
            {
                if (expandType.Items != null && expandType.Items.Length > 0)
                {
                    return(true);
                }

                return(!expandType.HideRawView && variable.MightHaveChildren());
            }

            SmartPointerType smartPointerType = visualizer?.GetSmartPointerType();

            return(smartPointerType != null || variable.MightHaveChildren());
        }
示例#2
0
        IChildAdapter CreateNatvisChildAdapter(VisualizerInfo visualizer,
                                               IVariableInformation variable)
        {
            ExpandType expandType = visualizer.GetExpandType();

            if (expandType != null)
            {
                return(_natvisCollectionFactory.Create(variable, expandType,
                                                       visualizer.NatvisScope));
            }

            SmartPointerType smartPointerType = visualizer.GetSmartPointerType();

            if (smartPointerType != null)
            {
                return(_smartPointerFactory.Create(
                           variable, smartPointerType, visualizer.NatvisScope, variable.GetChildAdapter()));
            }

            return(variable.GetChildAdapter());
        }
示例#3
0
        internal IChildAdapter GetChildAdapter(IVariableInformation variable)
        {
            VisualizerInfo visualizer = VisualizerScanner.FindType(variable);

            if (visualizer?.Visualizer.Items == null)
            {
                return(variable.GetChildAdapter());
            }

            IChildAdapter childAdapter = CreateNatvisChildAdapter(visualizer, variable);

            // Special case for SSE registers. VS calls VariableInformationEnum.Count, even if
            // the SSE registers are not visible. Without this, we would have to expand all
            // children just to get the count, which slows down the register window a lot.
            if (variable.CustomVisualizer == CustomVisualizer.SSE ||
                variable.CustomVisualizer == CustomVisualizer.SSE2)
            {
                return(new SseAdapter(visualizer.GetExpandType().Items.Length, childAdapter));
            }

            return(childAdapter);
        }