public TailViewModel Create(FileInfo fileInfo) { if (fileInfo == null) throw new ArgumentNullException(nameof(fileInfo)); var fileWatcher = _objectProvider.Get<IFileWatcher>(new[] { new ExplictArg("fileInfo", fileInfo), new ExplictArg("scheduler",_schedulerProvider.Background) }); var searchMetadataCollection = _objectProvider.Get<ISearchMetadataCollection>(); var searchHints = _objectProvider.Get<SearchHints>(); var searchOptionsViewModel = new SearchOptionsViewModel(searchMetadataCollection, _schedulerProvider, searchHints); var searchInfo = _objectProvider.Get<ISearchInfoCollection> ( new[] { new ExplictArg("fileWatcher", fileWatcher), new ExplictArg("searchMetadataCollection", searchMetadataCollection), } ); //I hate explicity specify named args - so fragile but hey ho. return _objectProvider.Get<TailViewModel>(new[] { new ExplictArg("fileWatcher", fileWatcher), new ExplictArg("searchInfoCollection", searchInfo), new ExplictArg("searchMetadataCollection", searchMetadataCollection), new ExplictArg("searchOptionsViewModel", searchOptionsViewModel) }); }
private TailViewModel CreateView(FileInfo fileInfo) { if (fileInfo == null) throw new ArgumentNullException(nameof(fileInfo)); var fileWatcher = _objectProvider.Get<IFileWatcher>(new[] { new ExplictArg("fileInfo", fileInfo), new ExplictArg("scheduler",_schedulerProvider.Background) }); var searchMetadataCollection = _objectProvider.Get<ISearchMetadataCollection>(); var searchHints = _objectProvider.Get<SearchHints>(); var searchOptionsViewModel = new SearchOptionsViewModel(searchMetadataCollection, _searchMetadataFactory, _schedulerProvider, _colourProvider, _iconProvider, _textAssociationCollection, searchHints, _themeProvider); var searchInfo = _objectProvider.Get<ISearchInfoCollection> ( new[] { new ExplictArg("fileWatcher", fileWatcher), new ExplictArg("searchMetadataCollection", searchMetadataCollection), } ); //I hate explicity specify named args - so fragile but hey ho. var viewModel = _objectProvider.Get<TailViewModel>(new[] { new ExplictArg("fileWatcher", fileWatcher), new ExplictArg("searchInfoCollection", searchInfo), new ExplictArg("searchMetadataCollection", searchMetadataCollection), new ExplictArg("searchOptionsViewModel", searchOptionsViewModel), new ExplictArg("tailViewStateControllerFactory", _tailViewStateControllerFactory) }); return viewModel; }