Show / Hide Table of Contents

Class TransformationContext

This is the most important class of NMF.Transformations as it handles all the transformation

Inheritance
object
TransformationContext
SynchronizationContext
ParallelTransformationContext2
TaskParallelTransformationContext2
TracingTransformationContext
Implements
ITransformationEngineContext
ITransformationContext
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: NMF.Transformations.Core
Assembly: NMF.Transformations.Core.dll
Syntax
public class TransformationContext : ITransformationEngineContext, ITransformationContext

Constructors

| Edit this page View Source

TransformationContext(Transformation)

Creates a new transformation context for the given transformation

Declaration
public TransformationContext(Transformation transformation)
Parameters
Type Name Description
Transformation transformation

The transformation, a context should be generated for

Properties

| Edit this page View Source

Bag

Gets a Bag, where dynamic data can be added

Declaration
public dynamic Bag { get; }
Property Value
Type Description
dynamic
Remarks

The value of this property is an ExpandoObject, so that the bag can be easily extended with new properties

| Edit this page View Source

Computations

Gets all computations (for custom trace purposes)

Declaration
public IEnumerable<Computation> Computations { get; }
Property Value
Type Description
IEnumerable<Computation>
| Edit this page View Source

Data

Gets a data dictionary, where data set during the transformation can be added

Declaration
public IDictionary<object, object> Data { get; }
Property Value
Type Description
IDictionary<object, object>
| Edit this page View Source

Input

Gets the input of the transformation context

Declaration
public object[] Input { get; set; }
Property Value
Type Description
object[]
Remarks

If the transformation has multiple inputs, this returns the first input

| Edit this page View Source

Inputs

Gets a collection of inputs

Declaration
public IList<object[]> Inputs { get; }
Property Value
Type Description
IList<object[]>
| Edit this page View Source

Output

Gets the output of the transformation context

Declaration
public object Output { get; }
Property Value
Type Description
object
Remarks

If the transformation has multiple outputs, this property returns the first output

| Edit this page View Source

Outputs

Gets a collection of outputs

Declaration
public IList<object> Outputs { get; }
Property Value
Type Description
IList<object>
| Edit this page View Source

Trace

Gets the object responsible for trace operations for this transformation context

Declaration
public ITransformationTrace Trace { get; }
Property Value
Type Description
ITransformationTrace
| Edit this page View Source

Transformation

Gets the parent transformation, that the context is based upon

Declaration
public Transformation Transformation { get; }
Property Value
Type Description
Transformation

Methods

| Edit this page View Source

AddTraceEntry(Computation)

Creates a trace entry for the given computation object

Declaration
protected virtual void AddTraceEntry(Computation computation)
Parameters
Type Name Description
Computation computation

The computation that needs to be added to the trace

Remarks

Override for custom trace entries. A null-check for the argument is not required.

| Edit this page View Source

CallPendingDependencies()

Calls dependencies of transformations executed so far

Declaration
public void CallPendingDependencies()
| Edit this page View Source

CallTransformation(GeneralTransformationRule, object[], IEnumerable)

Calls the given transformation with the specified input

Declaration
public Computation CallTransformation(GeneralTransformationRule transformationRule, object[] input, IEnumerable context)
Parameters
Type Name Description
GeneralTransformationRule transformationRule

The rule that should be applied

object[] input

The input for the transformation rule

IEnumerable context

The callers context

Returns
Type Description
Computation

The computation that handles this request

| Edit this page View Source

CreateComputationContext(object[], GeneralTransformationRule)

Creates a computation context for the given input with the given transformation rule

Declaration
protected virtual ComputationContext CreateComputationContext(object[] input, GeneralTransformationRule rule)
Parameters
Type Name Description
object[] input

The inputs

GeneralTransformationRule rule

The transformation rule to process these inputs

Returns
Type Description
ComputationContext

A computation context

| Edit this page View Source

CreateDelayedOutputs()

Creates the outputs of all delayed computations

Declaration
public void CreateDelayedOutputs()
| Edit this page View Source

ExecuteLevel(IList<Computation>)

Executes all computations of the given level

Declaration
protected virtual void ExecuteLevel(IList<Computation> computationsOfLevel)
Parameters
Type Name Description
IList<Computation> computationsOfLevel

The computations of the given level

| Edit this page View Source

ExecutePending()

Calls the transformation context to finish any things yet undone

Declaration
public void ExecutePending()
| Edit this page View Source

ExecutePendingComputations()

Executes all computations registered,but not already handled

Declaration
public void ExecutePendingComputations()
| Edit this page View Source

GetRule(Type[], Type)

Gets any rules that apply the given signature

Declaration
public GeneralTransformationRule GetRule(Type[] input, Type output)
Parameters
Type Name Description
Type[] input

The input argument type list

Type output

The output type

Returns
Type Description
GeneralTransformationRule

A random rule that has the given signature

| Edit this page View Source

GetRules(Type[], Type)

Gets all rules that apply the given signature

Declaration
public IEnumerable<GeneralTransformationRule> GetRules(Type[] input, Type output)
Parameters
Type Name Description
Type[] input

The input argument type list

Type output

The output type

Returns
Type Description
IEnumerable<GeneralTransformationRule>

A collection with all the rules that have the given signature

| Edit this page View Source

OnComputationCompleted(ComputationEventArgs)

Fires the ComputationCompleted event with the given event data

Declaration
protected virtual void OnComputationCompleted(ComputationEventArgs e)
Parameters
Type Name Description
ComputationEventArgs e

The event data

Events

| Edit this page View Source

ComputationCompleted

Gets fired when a computation completes

Declaration
public event EventHandler<ComputationEventArgs> ComputationCompleted
Event Type
Type Description
EventHandler<ComputationEventArgs>

Implements

ITransformationEngineContext
ITransformationContext

Extension Methods

TransformationContextExtensions.CallTransformation(ITransformationContext, GeneralTransformationRule, params object[])
TraceExtensions.GetOrCreateUserItem<TValue>(ITransformationContext, object, Func<TValue>)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX