public void GetResults(IMutableEngineConfiguration config)
 {
     foreach (var handler in _handlers.Values)
     {
         handler.GetResults(config);
     }
 }
예제 #2
0
 protected override void ProcessResults(IMutableEngineConfiguration config, IEnumerable <IAction> results)
 {
     foreach (var action in results)
     {
         config.AddAction(action);
     }
 }
예제 #3
0
        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);
     }
 }
예제 #5
0
 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);
     }
 }
예제 #7
0
 protected override void ProcessResults(IMutableEngineConfiguration config, IEnumerable <IServiceInfo> results)
 {
     foreach (var serviceInfo in results)
     {
         config.ServiceResolver.RegisterService(serviceInfo);
     }
 }
예제 #8
0
 public static void RegisterLogService(this IMutableEngineConfiguration mutableConfig, Func <ILoggerService> logService)
 {
     if (logService == null)
     {
         throw new ArgumentNullException("logService");
     }
     mutableConfig.RegisterService <ILoggerService>(logService);
 }
예제 #9
0
 public static void RegisterDbService(this IMutableEngineConfiguration mutableConfig, Func <IDbQueryService> dbService)
 {
     if (dbService == null)
     {
         throw new ArgumentNullException("dbService");
     }
     mutableConfig.RegisterService <IDbQueryService>(dbService);
 }
예제 #10
0
 public static void UseNinjectServiceResolver(this IMutableEngineConfiguration mutableConfig, IKernel kernel)
 {
     if (kernel == null)
     {
         throw new ArgumentNullException("kernel");
     }
     mutableConfig.SetServiceResolver(new NinjectServiceResolver(kernel));
 }
예제 #11
0
 public static void UseOleDbService(this IMutableEngineConfiguration mutableConfig)
 {
     mutableConfig.RegisterDbService(() => new OleDbQueryService());
 }
 public static void UseEnumerablePlanner(this IMutableEngineConfiguration mutableConfig)
 {
     mutableConfig.SetPlanProvider(() => new EnumerablePlanner().GetPlan(mutableConfig));
 }
예제 #13
0
 protected abstract void ProcessResults(IMutableEngineConfiguration config, IEnumerable <T> results);
예제 #14
0
 protected override void ProcessResults(IMutableEngineConfiguration config, IEnumerable <ISource> results)
 {
     // do nothing
 }
 public static void UseDefaultContextProvider(this IMutableEngineConfiguration mutableConfig)
 {
     mutableConfig.SetContextProvider(() => new Context());
 }
예제 #16
0
 public static void UseNullLogger(this IMutableEngineConfiguration mutableConfig)
 {
     mutableConfig.RegisterLogService(() => new NullLogger());
 }
예제 #17
0
 public static void UseSchemaService(this IMutableEngineConfiguration mutableConfig)
 {
     mutableConfig.RegisterService <ISchemaService>(() => new SchemaService());
 }
예제 #18
0
 public void Configure(IMutableEngineConfiguration config)
 {
     _configurator(config);
 }
예제 #19
0
 public void GetResults(IMutableEngineConfiguration config)
 {
     ProcessResults(config, _items.Values);
 }
예제 #20
0
 public static void UseDefaultServiceResolver(this IMutableEngineConfiguration mutableConfig)
 {
     mutableConfig.SetServiceResolver(new SimpleServiceResolver());
 }
예제 #21
0
 public void Configure(IMutableEngineConfiguration config)
 {
     ProcessXml(_document.Root);
     _handlers.GetResults(config);
 }
예제 #22
0
 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);
 }