public StatisticViewer() { InitializeComponent(); try { List = List.Deserializing(MainForm.PathToStats); } catch { List = new ResultList(); } finally { foreach (var i in List.ListResult) { ResultListBox.Items.Add(i); } } }
private void CompareResults() { var list = new ResultList(); try { list = list.Deserializing(MainForm.PathToStats); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { list.ListResult.Add(CurrentResult); list.Serializing(MainForm.PathToStats); } }