Ejemplo n.º 1
0
        private void SaveOutputBtn_Click(object sender, EventArgs e)
        {
            List <List <int> > outp = GetOutput();

            if (outp.Count == 0)
            {
                MessageBox.Show("нет данных", "Error");
                return;
            }
            if (saveFileDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    FileTools file = new FileTools(saveFileDialog.FileName);
                    file.BinWriterOpen();
                    for (int i = 0; i < outp.Count; i++)
                    {
                        file.WriteBinList(outp[i]);
                    }
                    file.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error");
                }
            }
        }
Ejemplo n.º 2
0
 private void OpenInputBtn_Click(object sender, EventArgs e)
 {
     try
     {
         if (openFileDialog.ShowDialog() == DialogResult.OK)
         {
             FileTools file = new FileTools(openFileDialog.FileName);
             file.BinReaderOpen();
             Input.Text = String.Join(" ", file.ReadBinListDouble());
             file.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error");
     }
 }
Ejemplo n.º 3
0
 private void OpenOutputFile_Click(object sender, EventArgs e)
 {
     if (openFileDialog.ShowDialog() == DialogResult.OK)
     {
         try
         {
             FileTools file = new FileTools(openFileDialog.FileName);
             file.BinReaderOpen();
             StringBuilder sb = new StringBuilder();
             while (!file.End)
             {
                 sb.AppendLine(String.Join(" ", file.ReadBinListDouble()));
             }
             Output.Text = sb.ToString();
             file.Close();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "Error");
         }
     }
 }
Ejemplo n.º 4
0
 private void SaveInputBtn_Click(object sender, EventArgs e)
 {
     try
     {
         List <double> inp = GetInput();
         if (inp.Count == 0)
         {
             MessageBox.Show("нет данных", "Error");
             return;
         }
         if (saveFileDialog.ShowDialog() == DialogResult.OK)
         {
             FileTools file = new FileTools(saveFileDialog.FileName);
             file.BinWriterOpen();
             file.WriteBinList(inp);
             file.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error");
     }
 }