internal ITransformationRuleDependency Depend(Predicate <Computation> filter, Func <Computation, object[]> selector, GeneralTransformationRule transformation, Action <object, object> persistor, bool executeBefore, bool needOutput)
        {
            if (transformation == null)
            {
                throw new ArgumentNullException("transformation");
            }
            if (selector == null)
            {
                throw new ArgumentNullException("selector");
            }

            var dependency = new SingleDependency()
            {
                Filter                   = filter,
                Selector                 = selector,
                Persistor                = persistor,
                BaseTransformation       = this,
                DependencyTransformation = transformation,
                ExecuteBefore            = executeBefore,
                NeedOutput               = needOutput
            };

            Dependencies.Add(dependency);

            return(dependency);
        }
Beispiel #2
0
        public void InitTestContext()
        {
            ruleT1 = new TestRuleT1();
            ruleDependent = new OtherRuleT1();
            transformation = new MockTransformation(ruleT1, ruleDependent);
            transformation.Initialize();
            context = new MockContext(transformation);

            dependency = new SingleDependency();

            dependency.BaseTransformation = ruleT1;
            dependency.DependencyTransformation = ruleDependent;
            dependency.ExecuteBefore = true;

            c_Test = new MockComputation(new object[] { "a" }, ruleT1, context, "b");
            c_Dependent = new MockComputation(new object[] { new Dummy() }, ruleDependent, context, null);

            context.Computations.Add(c_Test);
            context.Computations.Add(c_Dependent);
        }
        internal ITransformationRuleDependency Depend(Predicate<Computation> filter, Func<Computation, object[]> selector, GeneralTransformationRule transformation, Action<object, object> persistor, bool executeBefore, bool needOutput)
        {
            if (transformation == null) throw new ArgumentNullException("transformation");
            if (selector == null) throw new ArgumentNullException("selector");

            var dependency = new SingleDependency()
            {
                Filter = filter,
                Selector = selector,
                Persistor = persistor,
                BaseTransformation = this,
                DependencyTransformation = transformation,
                ExecuteBefore = executeBefore,
                NeedOutput = needOutput
            };

            Dependencies.Add(dependency);

            return dependency;
        }