/// <summary> /// opens the references saved from a previous Reference entry /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void openRefrencesFromADataFileToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog open = new OpenFileDialog(); open.Filter = "DAT Files|*.dat"; BinaryFormatter bin = new BinaryFormatter(); if (open.ShowDialog() == System.Windows.Forms.DialogResult.OK) { List <ManageList> binData = new List <ManageList>(); if (File.Exists(open.FileName)) { try { FileStream stream = new FileStream(open.FileName, FileMode.Open, FileAccess.Read); binData = (List <ManageList>)bin.Deserialize(stream); stream.Close(); foreach (Reference refs in ManageList.getReferenceList()) { rtxtReferences.Text += refs.formatAPA(); } // rtxtReferences.Text = ManageList.getReferenceList().ToString(); } catch { MessageBox.Show("Error reading from file"); } } } }
/// <summary> /// reacts when the radio buttons selected button is changed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void rbtnViewMLA_CheckedChanged(object sender, EventArgs e) { string References = ""; if (rbtnViewMLA.Checked == true) { foreach (Reference myReference in ManageList.getReferenceList()) { References += myReference.formatMLA() + "\r\n"; } rtxtReferences.Text = References; } else { References = ""; } if (rbtnViewAPA.Checked == true) { foreach (Reference myReference in ManageList.getReferenceList()) { References += myReference.formatAPA() + "\r\n"; } rtxtReferences.Text = References; } else { References = ""; } if (rbtnViewLibMed.Checked == true) { foreach (Reference myReference in ManageList.getReferenceList()) { References += myReference.formatLibMed() + "\r\n"; } rtxtReferences.Text = References; } else { References = ""; } }