public static IFileIndexer GetFileIndexer(string file) { if (string.IsNullOrEmpty(file)) { return(null); } var fileIndexer = _fileIndexers.SingleOrDefault(ds => ds.CanIndex(file)); return(fileIndexer); }
public static IDataSource GetDataSource(string name) { if (string.IsNullOrEmpty(name)) { name = AppConfig.OPENCONTENT; } var dataSource = _dataSources.SingleOrDefault(ds => ds.Name == name); if (dataSource == null) { throw new ArgumentException(string.Format("DataSource provider {0} doesn't exist", name)); } return(dataSource); }
public static IDataSource GetDataSource(string name) { if (string.IsNullOrEmpty(name)) { name = App.Config.Opencontent; } var dataSource = _dataSources.SingleOrDefault(ds => ds.Name == name); if (dataSource == null) { throw new ArgumentException($"DataSource provider {name} doesn't exist"); } return(dataSource); }