public IDataSourceViewModel GetOrAddPath(string path)
        {
            IDataSourceViewModel dataSource;

            if (Directory.Exists(path))
            {
                dataSource = _dataSources.GetOrAddFolder(path);
            }
            else
            {
                dataSource = _dataSources.GetOrAddFile(path);
            }

            OpenFile(dataSource);
            return(dataSource);
        }
 public void GetOrAddFile(string fileName)
 {
     CurrentDataSource = _dataSources.GetOrAddFile(fileName);
 }
Example #3
0
        public void TestAdd1()
        {
            var model = _model.GetOrAddFile("foo");

            _model.SelectedItem.Should().BeSameAs(model);
            model.IsVisible.Should().BeTrue();
        }