Пример #1
0
        private void addBt_Click(object sender, EventArgs e)
        {
            var epdlg = new EditPersonForm("添加", new Person(""));

            epdlg.StartPosition = FormStartPosition.CenterParent;
            if (epdlg.ShowDialog() == DialogResult.OK)
            {
                persons.Add(epdlg.Person);
                this.personsLv.VirtualListSize = persons.Count;
                personsLv.Invalidate();
            }
        }
Пример #2
0
        private void RefreshDrawPerson()
        {
            noprizePersons.Clear();
            var  wpl = GetWinPerson();
            bool isWin;

            for (int i = 0; i < persons.Count; i++)
            {
                isWin = false;
                Person per = persons.GetPerson(i);
                foreach (var wp in wpl)
                {
                    if (per.Equals(wp))
                    {
                        // 此乃人生赢家
                        isWin = true;
                        break;
                    }
                }
                if (!isWin)
                {
                    noprizePersons.Add(per);
                }
            }
        }