Exemplo n.º 1
0
        void Activity <TInstance> .Execute <T>(Composer composer, TInstance instance, T value)
        {
            composer.Execute(() =>
            {
                Activity <TInstance> activity = _activityFactory();

                return(composer.ComposeActivity(activity, instance));
            });
        }
        void Activity <TInstance, TData> .Execute(Composer composer, TInstance instance, TData value)
        {
            composer.Execute(() =>
            {
                if (_filterExpression(value) == false)
                {
                    return(composer.ComposeCompleted());
                }

                return(composer.ComposeActivity(_activity, instance, value));
            });
        }
Exemplo n.º 3
0
        void Activity <TInstance> .Execute <T>(Composer composer, TInstance instance, T value)
        {
            composer.Execute(() =>
            {
                object dataValue = value;
                if (dataValue == null)
                {
                    throw new ArgumentNullException("value", "The data argument cannot be null");
                }

                if (!(dataValue is TData))
                {
                    string message = "Expected Type " + typeof(TData).Name + " but was " + value.GetType().Name;
                    throw new ArgumentException(message, "value");
                }

                return(composer.ComposeActivity(_activity, instance, (TData)dataValue));
            });
        }