public static JavaScriptHostingConfig AddModuleFolder(this JavaScriptHostingConfig config, string scriptRootFolder) { ModuleLocator locator = new ModuleLocator(scriptRootFolder); config.ModuleFileLoaders.Add(locator.LoadModule); return(config); }
public static IExternalReader GetReader(ISource source, IRule behavior) { var behaviorType = behavior.GetType(); var sourceAttrib = behaviorType.GetCustomAttribute <SourcePointerAttribute>(true); var readerFactory = ModuleLocator.Resolve <IExternalReaderFactory>(sourceAttrib.ReaderFactory); return(readerFactory.GetReader(source, behavior)); }
public ISearch GetAnalogsSearchEngine() { var engine = ModuleLocator.Resolve <IAnalogSearchEngine>(); engine.Limit = SearchResultsLimit; return(engine); }
public ISearch GetPrimarySearchEngine() { var engine = UseSmartPrimarySearchEngine ? ModuleLocator.Resolve <ISmartSearchEngine>() as ISearch : ModuleLocator.Resolve <IQuickSearchEngine>() as ISearch; engine.Limit = SearchResultsLimit; return(engine); }
public static IExternalInvokerFactory GetFactory(string location) { // ToDo: нормальное IoC вместо этого быдлокода if (location.EndsWith(@".xls") || location.EndsWith(@".xlsx")) { return(ModuleLocator.Resolve <IExcelInvokerFactory>()); } throw new NotImplementedException("Location " + location + " does not supported yet."); }
public SimpleJigger(ITextStammer stammer = null, Func <PartItem, string> searchPropertyGetter = null) { _stammer = stammer ?? ModuleLocator.Resolve <ITextStammer>(); _defaultPropertyGetter = searchPropertyGetter ?? GetDefaultSearchProperty; }