예제 #1
0
파일: Form1.cs 프로젝트: RtHiaHB/PopSim2
 private void Form1_Load(object sender, EventArgs e)
 {
     if (!filed)
     {
         pop = new Population();
     }
     else
     {
         OpenPopFile(MyFileName);
     }
     PopulateListBox();
     PopulationMessages.Text = pop.Messages;
     DateText.Text = myDate.ToString("F1");
     PopulationText.Text = pop.Size().ToString();
     MalePop.Text = pop.Size(Gender.Male).ToString();
     FemPop.Text = pop.Size(Gender.Female).ToString();
 }
예제 #2
0
파일: Form1.cs 프로젝트: RtHiaHB/PopSim2
 private void OpenPopFile(string FileName)
 {
     FileStream fs = new FileStream(FileName, FileMode.Open);
     BinaryFormatter bf = new BinaryFormatter();
     myDate = (double)bf.Deserialize(fs);
     pop = (Population)bf.Deserialize(fs);
     fs.Close();
     DateText.Text = myDate.ToString("F1");
     PopulateListBox();
     PopulationText.Text = pop.Size().ToString();
     MalePop.Text = pop.Size(Gender.Male).ToString();
     FemPop.Text = pop.Size(Gender.Female).ToString();
     PopulationMessages.Text = pop.Messages;
 }