Пример #1
0
        private void menuItemShowMatrix_Click(object sender, EventArgs e)
        {
            var button = contextMenuStrip1.SourceControl as Button;
            var model  = button.Tag as ButtonModel;

            foreach (Matrix matrix in model.matrices)
            {
                var form = new MatrixForm(matrix, model);
                form.removeOkCancelButtons();
                form.Show();
            }
        }
Пример #2
0
        private void матрицаToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var    button = contextMenuStrip1.SourceControl as Button;
            var    model  = button.Tag as ButtonModel;
            Matrix matrix;

            matrix = new Matrix();
            var innerform = new MatrixForm(matrix, model);

            if (innerform.ShowDialog() == DialogResult.OK)
            {
                model.matrices.Add(matrix);
            }
        }
Пример #3
0
        private void привязатьМатрицуToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var    cell = contextMenuStrip1.SourceControl  as MatrixCellControl;
            Matrix newmatrix;

            if (matrix.matrix[cell.X, cell.Y] == null || matrix.matrix[cell.X, cell.Y].matrix == null)
            {
                newmatrix = new Matrix();
            }
            else
            {
                newmatrix = matrix.matrix[cell.X, cell.Y].matrix;
            }
            var innerform = new MatrixForm(newmatrix, button);

            if (innerform.ShowDialog() == DialogResult.OK)
            {
                if (matrix.matrix[cell.X, cell.Y] == null)
                {
                    matrix.matrix[cell.X, cell.Y] = new MatrixCell();
                }
                matrix.matrix[cell.X, cell.Y].matrix = newmatrix;
            }
        }