protected override void OnProcessOutputSchema(MutableObject newSchema) { SingleEntryTarget.SetValue("", newSchema); NumberOfElementsTarget.SetValue(0, newSchema); Router.TransmitAllSchema(newSchema); }
public override IEnumerator ReceivePayload(VisualPayload payload) { foreach (var entry in CommaSeparatedValues.GetEntries(payload.Data)) { string csvString = CommaSeparatedValues.GetValue(entry); if (string.IsNullOrEmpty(csvString)) { yield break; } var values = csvString.Split(','); NumberOfElementsTarget.SetValue(values.Length, entry); foreach (var value in values) { SingleEntryTarget.SetValue(value, entry); var iterator = PerEntryState.Transmit(payload); while (iterator.MoveNext()) { yield return(null); } } } }
protected override void OnProcessOutputSchema(MutableObject newSchema) { foreach (var entry in EntriesList.GetEntries(newSchema)) { var elementList = EntriesList.GetValue(entry).ToList(); var elementCount = elementList.Count; NumberOfEntriesTarget.SetValue(elementCount, entry); if (elementCount == 0) { throw new Exception("Can't act on an empty list!"); } SingleEntryTarget.SetValue(elementList.First(), entry); } Router.TransmitAllSchema(newSchema); }
protected override void OnProcessOutputSchema(MutableObject newSchema) { var csv = CommaSeparatedValues.GetFirstValue(newSchema); int csvFirst = 0; if (!int.TryParse(csv, out csvFirst)) { csvFirst = csv.Contains(',') ? int.Parse(csv.Split(',').First()) : int.Parse(csv.Split('.').First()); } SingleEntryTarget.SetValue(csvFirst, newSchema); NumberOfElementsTarget.SetValue(1, newSchema); Router.TransmitAllSchema(newSchema); }
public override IEnumerator ReceivePayload(VisualPayload payload) { foreach (var entry in EntriesList.GetEntries(payload.Data)) { var elementList = EntriesList.GetValue(entry).ToList(); var elementCount = elementList.Count; NumberOfEntriesTarget.SetValue(elementCount, entry); foreach (var element in elementList) { SingleEntryTarget.SetValue(element, entry); var iterator = PerEntryState.Transmit(payload); while (iterator.MoveNext()) { yield return(null); } } } }