예제 #1
0
        public static IFileIndexer GetFileIndexer(string file)
        {
            if (string.IsNullOrEmpty(file))
            {
                return(null);
            }

            var fileIndexer = _fileIndexers.SingleOrDefault(ds => ds.CanIndex(file));

            return(fileIndexer);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }