private void SignalRowCrate(CrateDescriptionDTO selected) { if (selected.ManifestId == (int)MT.StandardTableData) { CrateSignaller.MarkAvailableAtRuntime <StandardPayloadDataCM>(GetCrateName(selected), true).AddFields(selected.Fields); } else { CrateSignaller.MarkAvailable(new CrateManifestType(selected.ManifestType, selected.ManifestId), GetCrateName(selected), AvailabilityType.RunTime).AddFields(selected.Fields); } }
public CrateDescriptionDTO AddOrUpdate(CrateDescriptionDTO crateDescription) { for (int i = 0; i < CrateDescriptions.Count; i++) { var x = CrateDescriptions[i]; if (x.Label == crateDescription.Label && x.ManifestId == crateDescription.ManifestId) { CrateDescriptions[i] = crateDescription; return(crateDescription); } } CrateDescriptions.Add(crateDescription); return(crateDescription); }
private void PopulateRowData(CrateDescriptionDTO crateDescriptionToProcess, OperationalStateCM.LoopStatus loopData, Crate crateToProcess) { string label = GetCrateName(crateDescriptionToProcess); Payload.RemoveUsingPredicate(a => a.Label == label && a.ManifestType == crateToProcess.ManifestType); if (crateDescriptionToProcess.ManifestId == (int)MT.StandardTableData) { var table = crateToProcess.Get <StandardTableDataCM>(); var rowOfData = table.DataRows.ElementAt(loopData.Index); var extractedCrate = new StandardTableDataCM(false, new List <TableRowDTO>() { rowOfData }); Payload.Add(Crate.FromContent(label, extractedCrate)); } else { var cloned_crate = CloneCrateAndReplaceArrayWithASingleValue(crateToProcess, "", loopData.Index, GetCrateName(crateDescriptionToProcess)); Payload.Add(cloned_crate); } }
private string GetCrateName(CrateDescriptionDTO selected) { return($"Row of \"{selected.Label}\""); }
private Crate FindCrateToProcess(CrateDescriptionDTO selectedCrateDescripiton) { return(Payload.FirstOrDefault(c => c.ManifestType.Type == selectedCrateDescripiton.ManifestType && c.Label == selectedCrateDescripiton.Label)); }