private void buttonAdd_Click(object sender, EventArgs e) { if (!IsStart) { Method.AddRanmodProcess(); Init(); } else { if (Method.ProcessArray.Count < 10) { Eprocess p = new Eprocess(); var seed = Guid.NewGuid().GetHashCode(); Random r = new Random(seed); int Rname = r.Next(1, 10000); // 增加相同id的重新分配 int Rprimary = r.Next(50, 100); int Rtimes = r.Next(1, 50); p.status = 1; p.name = Rname; p.primary = Rprimary; p.times = Rtimes; RR.Add(new Eprocess(p.name, p.status, p.primary, p.times)); DP.Add(new Eprocess(p.name, p.status, p.primary, p.times)); SRT.Add(new Eprocess(p.name, p.status, p.primary, p.times)); SPN.Add(new Eprocess(p.name, p.status, p.primary, p.times)); } } }