コード例 #1
0
 private TableCell MakeKeyCell(LocalizationTable table, string key, int row)
 {
     return(new TableCell(key, true).Do(cell => {
         cell.OnValueChanged += newKey => {
             table.UpdateKey(row, newKey);
             Utils.ApplyChanges(table);
         };
         cell.OnNextCellSelected += () => GetCell(row, 1)?.BeginEdit();
         cell.OnPreviousCellSelected += () => {
             if (row == 0)
             {
                 return;
             }
             GetCell(row - 1, localeColumns.Count)?.BeginEdit();
         };
         cell.OnNextRowSelected += () => GetCell(row + 1, 0)?.BeginEdit();
         cell.OnPreviousRowSelected += () => {
             if (row == 0)
             {
                 return;
             }
             GetCell(row - 1, 0)?.BeginEdit();
         };
         cell.AddManipulator(new ContextualMenuManipulator(ctx => KeyContextMenu(ctx, table, row)));
     }));
 }