public Result Process() { var result = new Result(); if (SlotCollection != null && _slotOptions.Count == SlotCollection.Count) { foreach (var options in _slotOptions) { SlotOptions options1 = options; if (options1.MachineId.HasValue) { int machineId = options1.MachineId.Value; var slot = SlotCollection.First(x => x.Id == machineId); slot.SlotOptions = options; } } _slotOptions.Clear(); result.SlotsUpdated = true; } if (LogRetrieved) { if (result.SlotsUpdated) { result.ExecuteRetrieval = true; } if (UnitCollection != null && !_unitCollectionEqualityComparer.Equals(_previousUnitCollection, UnitCollection)) { _previousUnitCollection = UnitCollection; result.ExecuteRetrieval = true; } } return(result); }
private bool UpdateSlotOptionsCollectionFromMessage(FahClientMessage message) { SlotOptionsCollection.Add(SlotOptions.Load(message.MessageText)); if (SlotCollection != null && SlotCollection.Count == SlotOptionsCollection.Count) { foreach (var slotOptions in SlotOptionsCollection) { if (Int32.TryParse(slotOptions[Options.MachineID], out var machineID)) { var slot = SlotCollection.First(x => x.ID == machineID); slot.SlotOptions = slotOptions; } } return(true); } return(false); }