private void Add(string address, Cell cell) { if(address != cell.Address) { cell.Address = address; } _cells[address] = cell; if(cell.Parents.Count == 0) { _roots.Add(cell); } }
public void Set(string address, string formula) { if(_cells.ContainsKey(address)) { Cell c = _cells[address]; Remove(address); c.Formula = formula; Add(address, c); } else { Cell c = new Cell(this, address, formula); Add(address, c); } if(formula == "" && _cells[address].Children.Count == 0) { Remove(address); } }
public Semantics(Cell baseCell) : this(baseCell, null) { }
public Semantics(Cell baseCell, HashSet<RangeToken> dependencies) { _baseCell = baseCell; _dependencies = dependencies; }
public bool DependentOn(Cell goal) { if(this == goal) { return true; } else { foreach(string p in Parents) { if(_worksheet.GetCell(p).DependentOn(goal)) { return true; } } return false; } }
private void SetBlank(string address) { Cell c = new Cell(this, address, ""); Add(address, c); }