Exemple #1
0
        static List <Line> ConsoleInput()
        {
            StringBuilder sb = new StringBuilder();
            string        temp;

            temp = Console.ReadLine();
            while (temp != "")
            {
                sb.AppendLine(temp);
                temp = Console.ReadLine();
            }
            return(LineConvert.StrToLineList(sb.ToString()));
        }
Exemple #2
0
 private void Filt_Click(object sender, EventArgs e)
 {
     try
     {
         List <Line> lines     = LineConvert.MatrixToLineList(Input.GetMatrix());
         List <Line> LinesFilt = Line.GetMaxLines(lines);
         Output.SetMatrix(LineConvert.LineListToMatrix(LinesFilt));
         save.Enabled = true;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "ошибка");
     }
 }
Exemple #3
0
 private void Save_Click(object sender, EventArgs e)
 {
     if (saveFileDialog.ShowDialog() == DialogResult.OK)
     {
         try
         {
             LinesFile file = new LinesFile(saveFileDialog.FileName);
             file.WriteLines(LineConvert.MatrixToLineList(Output.GetMatrix()));
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "ошибка");
         }
     }
 }
Exemple #4
0
 private void Open_Click(object sender, EventArgs e)
 {
     if (openFileDialog.ShowDialog() == DialogResult.OK)
     {
         try
         {
             LinesFile   file  = new LinesFile(openFileDialog.FileName);
             List <Line> lines = file.ReadLines();
             Input.SetMatrix(LineConvert.LineListToMatrix(lines));
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "ошибка");
         }
     }
 }
Exemple #5
0
 static void ConsoleOutput(List <Line> Lines)
 {
     Console.WriteLine(LineConvert.LineListToStr(Lines));
 }