Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
 private void ChangeStateOfCell(Cell cell)
 {
     cell.state = !cell.state;
 }
Esempio n. 3
0
 public Agenda()
 {
     _storage = new Cell() {Value = -1};
 }