Example #1
0
        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();
        }
Example #2
0
        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();
        }