Ejemplo n.º 1
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);
            }
        }
Ejemplo n.º 2
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;
            }
        }