Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
 private string GetCrateName(CrateDescriptionDTO selected)
 {
     return($"Row of \"{selected.Label}\"");
 }
Exemplo n.º 5
0
 private Crate FindCrateToProcess(CrateDescriptionDTO selectedCrateDescripiton)
 {
     return(Payload.FirstOrDefault(c => c.ManifestType.Type == selectedCrateDescripiton.ManifestType && c.Label == selectedCrateDescripiton.Label));
 }