public void Add(ComputerData computerData) { var history = computerDataHistories.FirstOrDefault(p => p.ComputerName == computerData.ComputerName); if (history != null && history.ComputerName == computerData.ComputerName) { var historyElement = new ComputerDataHistoryElement(computerData); history.Add(historyElement); } else { var newHistory = new ComputerDataHistory(computerData.ComputerName); var historyElement = new ComputerDataHistoryElement(computerData); newHistory.Add(historyElement); computerDataHistories.Add(newHistory); } }
public Details(ComputerDataHistory _history) { InitializeComponent(); history = _history; }