Пример #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //short cut handler
            KeyPreview = true;
            KeyDown += new KeyEventHandler(Form1_KeyDown);

            dataGridView1.AllowUserToAddRows = false;
            dataGridView1.AllowUserToOrderColumns = false;
            dataGridView1.RowHeadersWidth = 50;
            int columns = 26;
            int rows = 50;

            addColumns(columns);
            addRows(rows);

            _spreadSheet = new SpreadSheet(columns, rows);

            _spreadSheet.CellPropertyChanged += _spreadSheet_CellPropertyChanged;
            _spreadSheet.StackChange += _spreadSheet_StackChange;

            undoToolStripMenuItem.Enabled = false;
            redoToolStripMenuItem.Enabled = false;
        }
Пример #2
0
        public UndoRedo Reverse(SpreadSheet s)
        {
            bgColorChange myReverse = new bgColorChange(Cell, Cell.BGColor);

            return myReverse;
        }
Пример #3
0
 public void Execute(SpreadSheet s)
 {
     s.setBGColor(myCell, color);
 }
Пример #4
0
        //implement swapping out this data for current data
        public UndoRedo Reverse(SpreadSheet s)
        {
            textChange myReverse = new textChange(Cell, Cell.Text);

            return myReverse;
        }
Пример #5
0
 public void Execute(SpreadSheet s)
 {
     s.setCellText(myCell, Text);
 }