Example #1
0
 /// <summary>
 ///单例模式
 /// </summary>
 /// <returns></returns>
 public static HumanForm CreateInstrance()
 {
     if (frm == null || frm.IsDisposed)
     {
         frm = new HumanForm();
     }
     return(frm);
 }
Example #2
0
        private void dataGridView1_SelectionChanged(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count == 0 || currentHumanList == null)
            {
                //ShowHumanList(currentHumanList);
                return;
            }
            if (dataGridView1.SelectedRows[0].Cells[9].Value == null)
            {
                dataGridView1.ClearSelection();
                return;
            }
            int       index     = (int)(dataGridView1.SelectedRows[0].Cells[9].Value);
            HumanForm humanForm = HumanForm.CreateInstrance();

            humanForm.ShowHumanInfo(currentHumanList.Find(obj => obj.Index == index));
            humanForm.Show();
        }