public int AddPhoneNumber(string number, int addedCells) { if (string.IsNullOrEmpty(number)) return addedCells; else { int firstValue = int.Parse(number[0].ToString()); var child = ChildCells.FirstOrDefault(_ => _.Value == firstValue); if (child == null) { child = new Cell() {Value = firstValue}; addedCells++; ChildCells.Add(child); } return child.AddPhoneNumber(number.Substring(1, number.Length-1), addedCells); } }
private void ChangeStateOfCell(Cell cell) { cell.state = !cell.state; }
public Agenda() { _storage = new Cell() {Value = -1}; }