Пример #1
0
        // TODO: handle the situation when raw and expand formatter are both present
        public virtual IVariableInformation Create(
            RemoteValue remoteValue, string displayName = null,
            FormatSpecifier formatSpecifier             = null,
            CustomVisualizer customVisualizer           = CustomVisualizer.None)
        {
            IVariableInformation varInfo =
                _varInfoFactory.Create(remoteValue, displayName, formatSpecifier, customVisualizer);

            // Don't use Natvis for raw format specifier (!), e.g. "myvar,!".
            if (FormatSpecifierUtil.HasRawFormatSpecifier(varInfo.FormatSpecifier))
            {
                return(new CachingVariableInformation(varInfo));
            }

            var natvisVarInfo = new NatvisVariableInformation(_natvisExpander, varInfo);

            if (ExpandFormatSpecifierUtil.TryParseExpandFormatSpecifier(
                    natvisVarInfo.FormatSpecifier, out int expandedIndex))
            {
                return(new CachingVariableInformation(
                           _expandVariableFactory.Create(natvisVarInfo, expandedIndex)));
            }

            return(new CachingVariableInformation(natvisVarInfo));
        }
Пример #2
0
        public virtual IVariableInformation Create(
            RemoteValue remoteValue, string displayName = null,
            FormatSpecifier formatSpecifier             = null,
            CustomVisualizer customVisualizer           = CustomVisualizer.None)
        {
            IVariableInformation varInfo =
                _varInfoFactory.Create(remoteValue, displayName, formatSpecifier, customVisualizer);

            if (customVisualizer != CustomVisualizer.None)
            {
                varInfo = new NatvisVariableInformation(_natvisExpander, varInfo);
            }

            if (ExpandFormatSpecifierUtil.TryParseExpandFormatSpecifier(varInfo.FormatSpecifier,
                                                                        out int expandedIndex))
            {
                varInfo = _expandVariableFactory.Create(varInfo, expandedIndex);
            }

            return(new CachingVariableInformation(varInfo));
        }