Example #1
0
        async Task <IVariableInformation> EvaluateItemAsync()
        {
            if (_store.HasVariable(0))
            {
                return(_store.GetVariable(0));
            }

            var formatStringContext = _item.DisplayString == null
                                          ? new NatvisStringFormatter.FormatStringContext()
                                          : new NatvisStringFormatter.FormatStringContext {
                StringElements = _item.DisplayString.Select(
                    e => new DisplayStringElement(e)),
                NatvisScope = _natvisScope
            };

            string displayName =
                await _stringFormatter.FormatDisplayStringAsync(formatStringContext, _variable);

            IVariableInformation syntheticInfo =
                new NatvisSyntheticVariableInformation(_stringFormatter, _natvisCollectionFactory,
                                                       _natvisScope, _item, _variable, displayName);

            _store.SaveVariable(0, syntheticInfo);
            return(syntheticInfo);
        }
Example #2
0
        public override async Task <IList <IVariableInformation> > GetChildrenAsync(
            int from, int count)
        {
            await InitAsync();

            if (_store.ValidationError != null)
            {
                return(new List <IVariableInformation>()
                {
                    _store.ValidationError
                }.GetRange(
                           from, count));
            }

            await TraverseAndEvaluateUpToAsync(from + count);

            return(Enumerable.Range(from, count).Select(i => _store.GetVariable(i)).ToList());
        }