private CostBatch addController(TECController controller) { CostBatch deltas = new CostBatch(); if (controller is TECProvidedController provided) { deltas += (ControllerSummaryVM.AddHardware(provided.Type)); foreach (TECIOModule module in provided.IOModules) { deltas += (addIOModule(module)); } } foreach (ICost cost in controller.AssociatedCosts) { deltas += (ControllerSummaryVM.AddCost(cost)); } foreach (IControllerConnection connection in controller.ChildrenConnections) { deltas += (addConnection(connection)); } return(deltas); }