async Task TransformAndSendData(SimpleTree tree, IRow[] data) { if (tree == null || tree.Count == 0) { return; } //foreach (var transformOrFilter in tree) for (int i = 0; i < tree.Count; i++) { var transformOrFilter = tree[i]; var sender = transformOrFilter.Key as ISend; if (sender != null) { sender.valuesToBeSent = data; await sender.Send(); continue;//sender is last... } var filter = transformOrFilter.Key as IFilter; if (filter != null) { filter.valuesRead = data; var newData = await GetDataFromFilter(filter); await TransformAndSendData(transformOrFilter.Childs, newData); data = newData;//pass data to the next filter continue; } var transform = transformOrFilter.Key as ITransform; if (transform != null) { transform.valuesRead = data; var newData = await GetDataFromTransform(transform); await TransformAndSendData(transformOrFilter.Childs, newData); data = newData;//pass data to the next filter continue; } var receiver = transformOrFilter.Key as IReceive; if (receiver != null) { await receiver.LoadData(); var newData = receiver.valuesRead; await TransformAndSendData(transformOrFilter.Childs, newData); data = newData;//pass data to the next filter continue; } } }
public override void UnSerialize(string serializeData) { var settings = new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.Objects, Formatting = Formatting.Indented, //Error = HandleDeserializationError //ConstructorHandling= ConstructorHandling.AllowNonPublicDefaultConstructor }; settings.Converters.Add(new JsonEncodingConverter()); var i = new Interpret(); var newText = i.InterpretText(serializeData); var sj = (SimpleJobConditionalTransformers)JsonConvert.DeserializeObject(newText, settings); this.association = sj.association; this.Receivers = sj.Receivers; }
public SimpleContainObjects() { //Children = new List<IBaseObjects>(); Childs = new SimpleTree(); }