Ejemplo n.º 1
0
        /// <summary>
        /// Every time the selection changes, this method is called with the
        /// Spreadsheet as its parameter.
        /// </summary>
        private void SpreadsheetSelectionChanged(int col, int row)
        {
            DoneTyping();

            SelectedCell             = new GuiCell(col, row);
            _window.CellValueBoxText = SelectedCell.GetCellContents(Spreadsheet);
            UpdateInfoBar($"{SelectedCell.CellName}: { SelectedCell.GetCellValue(Spreadsheet)}", Color.White);
            UpdateCellNameText();
            IsTyping();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Iterates through the given Hashset and updates the cells in the view.
 /// </summary>
 /// <param name="cellNames"></param>
 private void UpdateCells(IEnumerable <string> cellNames)
 {
     foreach (var cellName in cellNames)
     {
         GuiCell cell = new GuiCell(cellName);
         _window.UpdateCell(cell.CellColumn, cell.CellRow, cell.GetCellValue(Spreadsheet));
         if (SelectedCell.CellName == cell.CellName)
         {
             _window.CellValueBoxText = SelectedCell.GetCellContents(Spreadsheet);
         }
     }
 }