示例#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;
 }