示例#1
0
文件: Form1.cs 项目: bangush/csharp
        private void button2_Click(object sender, EventArgs e)
        {
            PersonasNCars pnc = new PersonasNCars(drivers);

            pnc.StartPosition = FormStartPosition.Manual;
            pnc.Location      = new Point()
            {
                X = this.Location.X + 50, Y = this.Location.Y + 50
            };

            pnc.FormClosed += (a, b) => { this.Focus(); ListChanged = null;
                                          foreach (Driver dr in pnc.drivers)
                                          {
                                              if (!drivers.Any(x => x.DriverProfile != null && x.DriverProfile.name.ToLower().Equals(dr.DriverProfile.name.ToLower())))
                                              {
                                                  drivers.Add(dr);
                                              }
                                          }
            };
            ListChanged += (a, b) =>
            {
                if (b != null)
                {
                    var llll = b as ListChangeEventArgs;
                    pnc.UpdateList(llll.drivers);
                }
            };
            pnc.Show();
        }
示例#2
0
文件: Form1.cs 项目: Hagser/csharp
        private void button2_Click(object sender, EventArgs e)
        {
            PersonasNCars pnc = new PersonasNCars(drivers);
            pnc.StartPosition = FormStartPosition.Manual;
            pnc.Location = new Point() { X = this.Location.X + 50, Y = this.Location.Y + 50 };

            pnc.FormClosed += (a, b) => { this.Focus(); ListChanged = null;
             foreach(Driver dr in pnc.drivers)
                {
                    if (!drivers.Any(x => x.DriverProfile != null && x.DriverProfile.name.ToLower().Equals(dr.DriverProfile.name.ToLower())))
                    {
                        drivers.Add(dr);
                    }
             }
            };
            ListChanged += (a, b) =>
            {
                if (b != null)
                {
                    var llll = b as ListChangeEventArgs;
                    pnc.UpdateList(llll.drivers);
                }
            };
            pnc.Show();
        }