public 主窗口() { InitializeComponent(); myFamilyTree = new FamilyTree(); myFamilyGraph = new FamilyGraph(); //压力测试 //pressureTest(); }
private void 男女比例窗口_Load(object sender, EventArgs e) { //lw int age = 0; int man = 0; int woman = 0; FamilyTree.DFS_output_all_age(主窗口.myFamilyTree.root, ref age, ref man, ref woman); 男女比例展示框.Text = Convert.ToString(man) + ":" + Convert.ToString(woman); }
private void 关系计算_Load(object sender, EventArgs e) { List <FamilyTreeNode> allNodes = new List <FamilyTreeNode>(); FamilyTree.DFS_getAll(主窗口.myFamilyTree.root, allNodes); foreach (var node in allNodes) { 一个人.Items.Add(node.Name); 另一个人.Items.Add(node.Name); } }
private void 平均寿命窗口_Load(object sender, EventArgs e) { int age = 0; int man = 0; int woman = 0; FamilyTree.DFS_output_all_age(主窗口.myFamilyTree.root, ref age, ref man, ref woman); double average = Convert.ToDouble(age) / (man + woman); average = Math.Round(average, 2); 平均寿命展示框.Text = Convert.ToString(average) + "岁"; }
private void 新建成员窗口_Load(object sender, EventArgs e) { foreach (string province in R.provinces) { 省份.Items.Add(province); } foreach (string edu in R.education) { 学历水平选择框.Items.Add(edu); } if (主窗口.myFamilyTree != null) { List <FamilyTreeNode> allNodes = new List <FamilyTreeNode>(); FamilyTree.DFS_getAll(主窗口.myFamilyTree.root, allNodes); foreach (var node in allNodes) { 已有的人.Items.Add(node.Name); } } }
private void 输入关系_Load(object sender, EventArgs e) { if (主窗口.myFamilyTree != null) { List <FamilyTreeNode> allNodes = new List <FamilyTreeNode>(); FamilyTree.DFS_getAll(主窗口.myFamilyTree.root, allNodes); foreach (var node in allNodes) { 一个人.Items.Add(node.Name); } } foreach (string relation in R.male_relation) { 亲戚关系.Items.Add(relation); } foreach (string relation in R.female_relation) { 亲戚关系.Items.Add(relation); } }