public void GetResults(IMutableEngineConfiguration config) { foreach (var handler in _handlers.Values) { handler.GetResults(config); } }
protected override void ProcessResults(IMutableEngineConfiguration config, IEnumerable <IAction> results) { foreach (var action in results) { config.AddAction(action); } }
public IEngine Setup(Func <IMutableEngineConfiguration> creator, Action <IMutableEngineConfiguration> configurator) { if (creator == null) { throw new ArgumentNullException("creator"); } if (configurator == null) { throw new ArgumentNullException("configurator"); } IMutableEngineConfiguration config = creator(); if (config == null) { throw new InvalidOperationException("config from creator() is null"); } _config = config; configurator(config); _globalContext = config.ContextProvider(); _plan = config.PlanProvider(); foreach (var action in _config.Actions) { action.SetEngine(this); } return(this); }
public static void AddLink(this IMutableEngineConfiguration mutableConfig, IAction source, IEnumerable <IAction> destinationList) { foreach (var destination in destinationList) { mutableConfig.AddLink(source, destination); } }
protected override void ProcessResults(IMutableEngineConfiguration config, IEnumerable <ILink> results) { foreach (var link in results) { config.AddLink(link); } }
public static void AddAction(this IMutableEngineConfiguration mutableConfig, IEnumerable <IAction> actions) { foreach (var action in actions) { mutableConfig.AddAction(action); } }
protected override void ProcessResults(IMutableEngineConfiguration config, IEnumerable <IServiceInfo> results) { foreach (var serviceInfo in results) { config.ServiceResolver.RegisterService(serviceInfo); } }
public static void RegisterLogService(this IMutableEngineConfiguration mutableConfig, Func <ILoggerService> logService) { if (logService == null) { throw new ArgumentNullException("logService"); } mutableConfig.RegisterService <ILoggerService>(logService); }
public static void RegisterDbService(this IMutableEngineConfiguration mutableConfig, Func <IDbQueryService> dbService) { if (dbService == null) { throw new ArgumentNullException("dbService"); } mutableConfig.RegisterService <IDbQueryService>(dbService); }
public static void UseNinjectServiceResolver(this IMutableEngineConfiguration mutableConfig, IKernel kernel) { if (kernel == null) { throw new ArgumentNullException("kernel"); } mutableConfig.SetServiceResolver(new NinjectServiceResolver(kernel)); }
public static void UseOleDbService(this IMutableEngineConfiguration mutableConfig) { mutableConfig.RegisterDbService(() => new OleDbQueryService()); }
public static void UseEnumerablePlanner(this IMutableEngineConfiguration mutableConfig) { mutableConfig.SetPlanProvider(() => new EnumerablePlanner().GetPlan(mutableConfig)); }
protected abstract void ProcessResults(IMutableEngineConfiguration config, IEnumerable <T> results);
protected override void ProcessResults(IMutableEngineConfiguration config, IEnumerable <ISource> results) { // do nothing }
public static void UseDefaultContextProvider(this IMutableEngineConfiguration mutableConfig) { mutableConfig.SetContextProvider(() => new Context()); }
public static void UseNullLogger(this IMutableEngineConfiguration mutableConfig) { mutableConfig.RegisterLogService(() => new NullLogger()); }
public static void UseSchemaService(this IMutableEngineConfiguration mutableConfig) { mutableConfig.RegisterService <ISchemaService>(() => new SchemaService()); }
public void Configure(IMutableEngineConfiguration config) { _configurator(config); }
public void GetResults(IMutableEngineConfiguration config) { ProcessResults(config, _items.Values); }
public static void UseDefaultServiceResolver(this IMutableEngineConfiguration mutableConfig) { mutableConfig.SetServiceResolver(new SimpleServiceResolver()); }
public void Configure(IMutableEngineConfiguration config) { ProcessXml(_document.Root); _handlers.GetResults(config); }
public static void UseStringDistanceService(this IMutableEngineConfiguration mutableConfig) { mutableConfig.RegisterService <IStringDistanceService>(() => new StringDistanceService()); }
public static void UseNLog(this IMutableEngineConfiguration config, string loggerName) { config.RegisterLogService(() => new NLogEngineLogger(loggerName)); }
public static void RegisterService <T>(this IMutableEngineConfiguration mutableConfig, Func <IService> serviceProvider) where T : IService { mutableConfig.ServiceResolver.RegisterService <T>(serviceProvider); }