Example #1
0
        /// <summary>
        /// Creates a new computation for the given transformation rule with the given input arguments
        /// </summary>
        /// <param name="transformationRule">The transformation rule responsible for the transformation of the input data</param>
        /// <param name="context">The transformation context, in which the computation is done</param>
        protected Computation(GeneralTransformationRule transformationRule, IComputationContext context)
        {
            if (transformationRule == null) throw new ArgumentNullException("transformationRule");
            if (context == null) throw new ArgumentNullException("context");

            TransformationRule = transformationRule;
            Context = context;

            context.ConnectWith(this);
        }
 /// <summary>
 /// Creates a new Computation instance for this transformation rule or the given input
 /// </summary>
 /// <param name="input">The input arguments for this computation</param>
 /// <param name="context">The context for this computation</param>
 /// <returns>A computation object</returns>
 public sealed override Computation CreateComputation(object[] input, IComputationContext context)
 {
     if (input == null)
     {
         return(null);
     }
     if (input.Length != InputType.Length)
     {
         throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.ErrTransformationRuleWrongNumberOfArguments, this.GetType().Name));
     }
     return(new SimpleComputation(this, input, context));
 }
Example #3
0
        /// <summary>
        /// Creates a new computation for the given transformation rule with the given input arguments
        /// </summary>
        /// <param name="transformationRule">The transformation rule responsible for the transformation of the input data</param>
        /// <param name="context">The transformation context, in which the computation is done</param>
        protected Computation(GeneralTransformationRule transformationRule, IComputationContext context)
        {
            if (transformationRule == null)
            {
                throw new ArgumentNullException("transformationRule");
            }
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            TransformationRule = transformationRule;
            Context            = context;

            context.ConnectWith(this);
        }
 /// <summary>
 /// Creates a new Computation instance for this transformation rule or the given input 
 /// </summary>
 /// <param name="input">The input arguments for this computation</param>
 /// <param name="context">The context for this computation</param>
 /// <returns>A computation object</returns>
 public abstract Computation CreateComputation(object[] input, IComputationContext context);
 public SimpleComputation(TransformationRule <T> transformationRule, object[] input, IComputationContext context)
     : base(transformationRule, context, input)
 {
 }
 /// <summary>
 /// Creates a new Computation instance for this transformation rule or the given input 
 /// </summary>
 /// <param name="input">The input arguments for this computation</param>
 /// <param name="context">The context for this computation</param>
 /// <returns>A computation object</returns>
 public override Computation CreateComputation(object[] input, IComputationContext context)
 {
     if (input == null) return null;
     if (input.Length != InputType.Length) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.ErrTransformationRuleWrongNumberOfArguments, this.GetType().Name));
     return new SimpleComputation(this, input, context);
 }
 /// <summary>
 /// Creates a new Computation instance for this transformation rule or the given input
 /// </summary>
 /// <param name="input">The input arguments for this computation</param>
 /// <param name="context">The context for this computation</param>
 /// <returns>A computation object</returns>
 public abstract Computation CreateComputation(object[] input, IComputationContext context);
Example #8
0
 public override Computation CreateComputation(object[] input, IComputationContext context)
 {
     return(new RTLComputation(rule, context, (TRight)input[0]));
 }
 public SynchronizationComputation(TransformationRuleBase <TIn, TOut> rule, TransformationRuleBase <TOut, TIn> reverseRule, IComputationContext context, TIn input)
     : base(rule, context)
 {
     Opposite = new OppositeComputation(this, reverseRule);
     Input    = input;
 }
Example #10
0
 /// <summary>
 /// Creates a new in-place computation for the given transformation rule and the given transformation context
 /// </summary>
 /// <param name="transformationRule">The transformation rule for this computation</param>
 /// <param name="context">The transformation context in which this computations resides</param>
 /// <param name="input">The input parameter for this computation</param>
 protected InPlaceComputation(InPlaceTransformationRuleBase <TIn> transformationRule, IComputationContext context, TIn input)
     : base(transformationRule, context, input)
 {
 }
Example #11
0
 public override Computation CreateComputation(object[] input, IComputationContext context)
 {
     throw new InvalidOperationException("This rule is only intended for tracing purposes and must not be called using regular dependencies.");
 }
Example #12
0
 public SimpleComputation(InPlaceTransformationRule <TIn> transformationRule, TIn input, IComputationContext context)
     : base(transformationRule, context, input)
 {
 }
Example #13
0
 /// <summary>
 /// Creates a new mocked computation
 /// </summary>
 /// <param name="input">The input for the mocked computation</param>
 /// <param name="rule">The transformation rule for the mocked computation</param>
 /// <param name="context">The transformation context</param>
 public MockComputation(object[] input, GeneralTransformationRule rule, IComputationContext context) : base(rule, context)
 {
     inputs = input;
 }
Example #14
0
 /// <summary>
 /// Creates a new mocked computation
 /// </summary>
 /// <param name="input">The input for the mocked computation</param>
 /// <param name="rule">The transformation rule for the mocked computation</param>
 /// <param name="context">The transformation context</param>
 /// <param name="output">The output for the transformation</param>
 public MockComputation(object[] input, GeneralTransformationRule rule, IComputationContext context, object output)
     : base(rule, context)
 {
     inputs = input;
     InitializeOutput(output);
 }
Example #15
0
 public SimpleComputation(TransformationRule <TIn, TOut> transformationRule, TIn input, IComputationContext context)
     : base(transformationRule, context, input)
 {
 }
Example #16
0
 /// <summary>
 /// Creates a new mocked computation
 /// </summary>
 /// <param name="input">The input for the mocked computation</param>
 /// <param name="rule">The transformation rule for the mocked computation</param>
 /// <param name="context">The transformation context</param>
 /// <param name="output">The output for the transformation</param>
 public MockComputation(object[] input, GeneralTransformationRule rule, IComputationContext context, object output)
     : base(rule, context)
 {
     inputs = input;
     InitializeOutput(output);
 }
Example #17
0
 /// <summary>
 /// Creates a new mocked computation
 /// </summary>
 /// <param name="input">The input for the mocked computation</param>
 /// <param name="rule">The transformation rule for the mocked computation</param>
 /// <param name="context">The transformation context</param>
 public MockComputation(object[] input, GeneralTransformationRule rule, IComputationContext context) : base(rule, context) { inputs = input; }
 public SimpleComputation(TransformationRule <TIn1, TIn2, TOut> transformationRule, TIn1 input1, TIn2 input2, IComputationContext context)
     : base(transformationRule, context, input1, input2)
 {
 }
 /// <summary>
 /// Creates a new transformation computation for the given input arguments
 /// </summary>
 /// <param name="transformationRule">The transformation rule for this computation</param>
 /// <param name="context">The context of this computation</param>
 /// <param name="input">The input for this computation</param>
 protected TransformationComputation(TransformationRuleBase <TIn, TOut> transformationRule, IComputationContext context, TIn input)
     : base(transformationRule, context, input)
 {
 }
 public SimpleComputation(InPlaceTransformationRule transformationRule, object[] input, IComputationContext context)
     : base(transformationRule, context, input) { }
Example #21
0
 public RTLComputation(SynchronizationRule <TLeft, TRight> rule, IComputationContext context, TRight right)
     : base(rule.RightToLeft, rule.LeftToRight, context, right)
 {
 }
 /// <summary>
 /// Creates a new computation within the given transformation context for the given input
 /// </summary>
 /// <param name="transformationRule">The transformation rule that was used to transform the input</param>
 /// <param name="context">The context of this transformation</param>
 /// <param name="input">The input for this transformation</param>
 protected ComputationBase(GeneralTransformationRule <TIn> transformationRule, IComputationContext context, TIn input)
     : base(transformationRule, context)
 {
     this.input = input;
 }