Пример #1
0
        void IRegistrationConfigurator.AddExecuteActivity <TActivity, TArguments>(Action <IExecuteActivityConfigurator <TActivity, TArguments> > configure)
        {
            IExecuteActivityRegistration ValueFactory(Type type)
            {
                ExecuteActivityRegistrationCache.Register(type, _containerRegistrar);

                return(new ExecuteActivityRegistration <TActivity, TArguments>());
            }

            var configurator = _executeActivityRegistrations.GetOrAdd(typeof(TActivity), ValueFactory);

            configurator.AddConfigureAction(configure);
        }
        public IExecuteActivityRegistrationConfigurator <TActivity, TArguments> AddExecuteActivity <TActivity, TArguments>(Type executeActivityDefinitionType,
                                                                                                                           Action <IExecuteActivityConfigurator <TActivity, TArguments> > configure = null)
            where TActivity : class, IExecuteActivity <TArguments>
            where TArguments : class
        {
            IExecuteActivityRegistration ValueFactory(Type type)
            {
                ExecuteActivityRegistrationCache.Register(type, Registrar);

                return(new ExecuteActivityRegistration <TActivity, TArguments>());
            }

            var registration = _executeActivities.GetOrAdd(typeof(TActivity), ValueFactory);

            registration.AddConfigureAction(configure);

            if (executeActivityDefinitionType != null)
            {
                ExecuteActivityDefinitionRegistrationCache.Register(executeActivityDefinitionType, Registrar);
            }

            return(new ExecuteActivityRegistrationConfigurator <TActivity, TArguments>(this));
        }
 public void AddExecuteActivity(Type activityType, Type activityDefinitionType)
 {
     _executeActivities.GetOrAdd(activityType,
                                 type => ExecuteActivityRegistrationCache.CreateRegistration(type, activityDefinitionType, Registrar));
 }
 public IExecuteActivityRegistrationConfigurator AddExecuteActivity(Type activityType, Type activityDefinitionType)
 {
     return(ExecuteActivityRegistrationCache.AddExecuteActivity(this, activityType, activityDefinitionType));
 }
Пример #5
0
 void IRegistrationConfigurator.AddExecuteActivity(Type activityType, Type activityDefinitionType)
 {
     _executeActivityRegistrations.GetOrAdd(activityType,
                                            type => ExecuteActivityRegistrationCache.CreateRegistration(type, activityDefinitionType, _containerRegistrar));
 }