Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int[,] returnedArray = DataGridViewUtils.GridToArray2 <Int32>(dataGridViewInput);
            Task_9 example = new Task_9(returnedArray);

            DataGridViewUtils.ArrayToGrid(dataGridViewInput, example.DelitedStrAndCol());
        }
Ejemplo n.º 2
0
        private void InpBtn_Click(object sender, EventArgs e)
        {
            try
            {
                System.Windows.Forms.OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.InitialDirectory = System.IO.Path.GetFullPath(Environment.CurrentDirectory + Inp_Out.GetDataDirectiry());

                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    List <List <double> > data = Inp_Out.InpTXT(openFileDialog.FileName);

                    if (Inp_Out.IsArr2Square(data))
                    {
                        DataGridViewUtils.ArrayToGrid <double>(gridView, DataProcessing.ListToArray(data));
                    }
                    else
                    {
                        MessageBsc.Show("Данные не являются прямоугольным массивом");
                    }
                }
            }

            catch (Exception exc)
            {
                MessageBsc.ShowError(exc.Message);
            }
        }
Ejemplo n.º 3
0
 private void открытьToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         string path = openFileDialog1.FileName;
         DataGridViewUtils.ArrayToGrid(dataGridViewInput, InputSaveFile.ReturnNewMassiv(path));
     }
 }
Ejemplo n.º 4
0
        private void File_Open_Click(object sender, EventArgs e)
        {
            List <int> file = new List <int>();

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                string path = openFileDialog1.FileName;
                DataGridViewUtils.ArrayToGrid(dataGridViewInput, FileInput_9.ReturnNewMassiv(path));
            }
        }
Ejemplo n.º 5
0
        private void StartBtn_Click(object sender, EventArgs e)
        {
            try
            {
                DataGridViewUtils.ArrayToGrid <double>(gridView, DataProcessing.ListToArray(DataProcessing.ColumEject(DataProcessing.Array2ToList2(DataGridViewUtils.GridToArray2 <double>(gridView)))));
            }

            catch (Exception exc)
            {
                MessageBsc.ShowError(exc.Message);
            }
        }
Ejemplo n.º 6
0
Archivo: Form1.cs Proyecto: aaksn/2att
 private void Go_Click(object sender, EventArgs e)
 {
     try
     {
         int[,] arr2 = DataGridViewUtils.GridToArray2 <int>(arr2FromDataGridView);
         Nine logic = new Nine(arr2);
         DataGridViewUtils.ArrayToGrid(arr2ToDataGridView, logic.Process());
     }
     catch (Exception except)
     {
         FormsUtils.ErrorMessageBox(except);
     }
 }
Ejemplo n.º 7
0
Archivo: Form1.cs Proyecto: aaksn/2att
 private void Go_Click(object sender, EventArgs e)
 {
     try
     {
         int[,] arr2 = DataGridViewUtils.GridToArray2 <int>(arr2FromDataGridView);
         Nine logic = new Nine(arr2);
         logic.Process2(out int[,] res, out int resmin);
         DataGridViewUtils.ArrayToGrid(arr2ToDataGridView, res);
         labelres.Text = resmin.ToString();
         label3.Show();
     }
     catch (Exception except)
     {
         FormsUtils.ErrorMessageBox(except);
     }
 }
Ejemplo n.º 8
0
 private void CalcBtn_Click(object sender, EventArgs e)
 {
     try
     {
         int[,] Matrix = DataGridViewUtils.GridToArray2 <int>(InputGrid);
         IntMatrix intMatrix = new IntMatrix(Matrix);
         int[]     Arr       = intMatrix.GetArr();
         DataGridViewUtils.ArrayToGrid(OutputGrid, Arr);
         save.Enabled = true;
     }
     catch (Exception eror)
     {
         save.Enabled = false;
         MessageBox.Show(eror.Message, "ошибка");
     }
 }
Ejemplo n.º 9
0
Archivo: Form1.cs Proyecto: aaksn/2att
        private void inputFromFileButton_Click(object sender, EventArgs e)
        {
            if (inputOpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    inputOpenFileDialog.InitialDirectory = Path.GetDirectoryName(inputOpenFileDialog.FileName);

                    int[,] input;
                    UtilsW.ReadInputFromFile(inputOpenFileDialog.FileName, ' ', out input);
                    DataGridViewUtils.ArrayToGrid(arr2FromDataGridView, input);
                }
                catch (Exception except)
                {
                    FormsUtils.ErrorMessageBox(except);
                }
            }
        }
Ejemplo n.º 10
0
        private void InputBtn_Click(object sender, EventArgs e)
        {
            try
            {
                OutputLbl.Text = "";

                System.Windows.Forms.OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.InitialDirectory = System.IO.Path.GetFullPath(Environment.CurrentDirectory + Inp_Out.GetDataDirectiry());

                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    List <List <double> > data = Inp_Out.InpTXT(openFileDialog.FileName);

                    DataGridViewUtils.ArrayToGrid <double>(gridView, DataProcessing.ListToArray(data));
                }
            }

            catch (Exception exc)
            {
                MessageBsc.ShowError(exc.Message);
            }
        }
Ejemplo n.º 11
0
        private void button_move_down(object sender, EventArgs e)
        {
            if (Input.Text.Trim().Length == 0)
            {
                Result("Ничего не введено!");
                return;
            }
            int n;

            try
            {
                n = int.Parse(Input.Text);
            }
            catch
            {
                Result("Необходимо целое число!");
                return;
            }
            int[,] arr = DataGridViewUtils.GridToArray2 <int>(dataGridView1);
            ArrayUtility asd = new ArrayUtility(arr, n);

            DataGridViewUtils.ArrayToGrid(dataGridView2, asd.ArrayMoveDown());
        }
Ejemplo n.º 12
0
Archivo: Form1.cs Proyecto: aaksn/2att
 private void Rndinputgrid_Click(object sender, EventArgs e)
 {
     int[,] arr2 = ArrayUtils.CreateRandomArray2(Convert.ToInt32(xcount.Text), Convert.ToInt32(ycount.Text), Convert.ToInt32(frominput.Text), Convert.ToInt32(toinput.Text));
     DataGridViewUtils.ArrayToGrid(arr2FromDataGridView, arr2);
 }
Ejemplo n.º 13
0
 private void button_fill(object sender, EventArgs e)
 {
     int[,] arr = ArrayUtils.CreateRandomArray2(dataGridView1.RowCount, dataGridView1.ColumnCount, 30);
     DataGridViewUtils.ArrayToGrid(dataGridView1, arr);
 }