private void writeSelectionButton_Click(object sender, EventArgs e) { SelectionFileWriterReader reader = new SelectionFileWriterReader(); reader.writeSelectionToFile(select); MessageBox.Show("Selection succesfull writen into file", "", MessageBoxButtons.OK, MessageBoxIcon.Information); }
static void Main(string[] args) { SelectionFileWriterReader reader = new SelectionFileWriterReader(); Selection selec = new NormalSelection(); selec.generateSelection(); //selec.seriesCriterion(); //selec.ascendingDescendingSeriesCriterion(); reader.writeSelectionToFile(selec); //reader.readSelectionFromFile(selec); selec.showSelection(); selec.studentCriterion(); selec.showSelection(); selec.showCount(); selec.studentCriterion(); selec.showCount(); selec.showSelection(); }
private void findExsistButton_Click(object sender, EventArgs e) { SelectionFileWriterReader reader = new SelectionFileWriterReader(); if (normSelecRadio.Checked) { select = new NormalSelection(); } if (equableSelecRadio.Checked) { select = new EquableSelection(); } if (exponentSelecRadio.Checked) { select = new ExponentialSelection(); } reader.readSelectionFromFile(select); if (select.selection.Count == 0) { MessageBox.Show("File does no contain this type of selection", "", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if (select.GetType() == typeof(NormalSelection)) { ClearAllCharts(); for (int i = 0; i < select.selection.Count; i++) { selectionChart.Series["NormalSelection"].Points.AddXY(i + 1, select.selection.ElementAt(i)); } //selectionChart.Series["NormalSelection"].Points.AddXY(-1, select.mathWaiting()); selectionChart.Series["MathWaiting"].Points.AddXY(-1, select.mathWaiting()); } if (select.GetType() == typeof(EquableSelection)) { ClearAllCharts(); for (int i = 0; i < select.selection.Count; i++) { selectionChart.Series["EquableSelection"].Points.AddXY(i + 1, select.selection.ElementAt(i)); } //selectionChart.Series["EquableSelection"].Points.AddXY(-1, select.mathWaiting()); selectionChart.Series["MathWaiting"].Points.AddXY(-1, select.mathWaiting()); } if (select.GetType() == typeof(ExponentialSelection)) { ClearAllCharts(); for (int i = 0; i < select.selection.Count; i++) { selectionChart.Series["ExponentalSelection"].Points.AddXY(i + 1, select.selection.ElementAt(i)); } //selectionChart.Series["ExponentalSelection"].Points.AddXY(-1, select.mathWaiting()); selectionChart.Series["MathWaiting"].Points.AddXY(-1, select.mathWaiting()); } } ShowSelection(); }