Example #1
0
 internal void Action(ConditionalInstance <TService> .ConditionalInstanceExpression condition)
 {
     IfFeatureToggled(condition);
     if (Default != null)
     {
         Default(condition);
     }
 }
        /// <summary>
        /// Conditional binding of instances
        /// </summary>
        /// <param name="configuration"></param>
        /// <returns></returns>
        public ConditionalInstance <PLUGINTYPE> ConditionallyUse(
            Action <ConditionalInstance <PLUGINTYPE> .ConditionalInstanceExpression> configuration)
        {
            var instance = new ConditionalInstance <PLUGINTYPE>(configuration);

            Use(instance);

            return(instance);
        }
Example #3
0
        public void SetUp()
        {
            instance = new ConditionalInstance <Rule>(x =>
            {
                x.If(context => context.RequestedName == "red").ThenIt.IsThis(Red);
                x.If(context => context.RequestedName == "green").ThenIt.IsThis(Green);
                x.If(context => context.RequestedName == "blue").ThenIt.IsThis(Blue);
                x.TheDefault.IsThis(Default);
            });


            _session = new BuildSession();
        }
        public void SetUp()
        {
            instance = new ConditionalInstance<Rule>(x =>
            {
                x.If(context => context.RequestedName == "red").ThenIt.IsThis(Red);
                x.If(context => context.RequestedName == "green").ThenIt.IsThis(Green);
                x.If(context => context.RequestedName == "blue").ThenIt.IsThis(Blue);
                x.TheDefault.IsThis(Default);
            });

            _session = new BuildSession();
        }