public NatvisCollectionEntity.Factory CreateNatvisCollectionFactory(
            NatvisExpressionEvaluator evaluator, NatvisSizeParser sizeParser,
            NatvisStringFormatter stringFormatter)
        {
            var itemFactory           = new ItemEntity.Factory(GetNatvisDiagnosticLogger(), evaluator);
            var indexListItemsFactory = new IndexListItemsEntity.Factory(
                GetNatvisDiagnosticLogger(), evaluator, sizeParser);
            var arrayItemsFactory =
                new ArrayItemsEntity.Factory(GetNatvisDiagnosticLogger(), evaluator, sizeParser);
            var syntheticItemFactory = new SyntheticItemEntity.Factory(GetNatvisDiagnosticLogger(),
                                                                       evaluator, stringFormatter);
            var expandedItemFactory =
                new ExpandedItemEntity.Factory(GetNatvisDiagnosticLogger(), evaluator);
            var linkedListItemsFactory = new LinkedListItemsEntity.Factory(
                GetNatvisDiagnosticLogger(), evaluator, sizeParser);
            var treeItemsFactory =
                new TreeItemsEntity.Factory(GetNatvisDiagnosticLogger(), evaluator, sizeParser);

            var customListItemsFactory = new CustomListItemsEntity.Factory(
                GetNatvisDiagnosticLogger(), evaluator, GetVariableNameTransformer());

            return(new NatvisCollectionEntity.Factory(
                       itemFactory, syntheticItemFactory, expandedItemFactory, indexListItemsFactory,
                       arrayItemsFactory, linkedListItemsFactory, treeItemsFactory, customListItemsFactory,
                       GetNatvisDiagnosticLogger(), GetCustomListsEnabled));
        }
        public virtual NatvisExpander GetNatvis()
        {
            if (_natvisExpander == null)
            {
                var natvisSizeParser = new NatvisSizeParser(GetNatvisDiagnosticLogger(),
                                                            GetNatvisExpressionEvaluator());

                var natvisStringFormatter = new NatvisStringFormatter(
                    GetNatvisExpressionEvaluator(), GetNatvisDiagnosticLogger(),
                    GetNatvisVisualizerScanner(), GetTaskExecutor());

                var natvisCollectionFactory = CreateNatvisCollectionFactory(
                    GetNatvisExpressionEvaluator(), natvisSizeParser, natvisStringFormatter);

                var natvisSmartPointerFactory = new SmartPointerEntity.Factory(
                    GetNatvisDiagnosticLogger(), GetNatvisExpressionEvaluator());

                _natvisExpander =
                    new NatvisExpander(natvisCollectionFactory, natvisSmartPointerFactory,
                                       natvisStringFormatter, GetNatvisVisualizerScanner());
            }

            return(_natvisExpander);
        }