예제 #1
0
파일: Form1.cs 프로젝트: alexey4eg/buttons
        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
파일: Form1.cs 프로젝트: alexey4eg/buttons
        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;
            }
        }