public static void Replace(AstTransformationNode item, IEnumerable<AstTransformationNode> replacements) { var transformations = GetParentTransformationCollection(item); if (transformations != null) { transformations.Replace(item, replacements); } }
protected Transformation(LoweringContext context, AstTransformationNode astTransformationNode) : base(astTransformationNode.Name) { var dflc = context as DataflowLoweringContext; Dataflow = dflc.Dataflow; ValidateExternalMetadata = astTransformationNode.ValidateExternalMetadata; BindingList = new Collection<Binding>(); _astTransformationNode = astTransformationNode; }
public static VulcanCollection<AstTransformationNode> GetParentTransformationCollection(AstTransformationNode item) { var parent = item.ParentItem; if (parent != null) { PropertyInfo propertyInfo = parent.GetType().GetProperty("Transformations"); if (propertyInfo != null) { return propertyInfo.GetValue(parent, null) as VulcanCollection<AstTransformationNode>; } } return null; }
private static HashSet<AstTransformationNode> FindPredecessors(AstTransformationNode transformation, AstTransformationNode previousTransformation) { var predecessors = new HashSet<AstTransformationNode>(); var multipleIn = transformation as AstMultipleInTransformationNode; if (multipleIn != null) { foreach (var inputPath in multipleIn.InputPaths) { var predecessorNode = inputPath.OutputPath.ParentItem as AstTransformationNode; predecessors.Add(predecessorNode); } } var singleIn = transformation as AstSingleInTransformationNode; if (singleIn != null && singleIn.InputPath != null && singleIn.InputPath.OutputPath != null) { var predecessorNode = singleIn.InputPath.OutputPath.ParentItem as AstTransformationNode; if (predecessorNode != null) { predecessors.Add(predecessorNode); } } if (predecessors.Count == 0 && previousTransformation != null) { bool foundOutputPath = false; foreach (var outputPath in previousTransformation.StaticOutputPaths) { if (outputPath.References.Count > 0) { foundOutputPath = true; break; } } if (!foundOutputPath) { predecessors.Add(previousTransformation); } } return predecessors; }
protected SingleOutTransformation(LoweringContext context, AstTransformationNode astTransformationNode) : base(context, astTransformationNode) { }