private void FillPlanesMarket(UserScroll userScroll) { // основные характеристики int planesStartX = 10; int planesStartY = 5; List <Plane.Models> models = new List <Plane.Models>(); models.Add(Plane.Models.TY_134); models.Add(Plane.Models.SuperJet123); models.Add(Plane.Models.KukuruznikMX150); foreach (var model in models) { PlaneMarket planeMarket = new PlaneMarket(game, model, 5) { Location = new Point(planesStartX, planesStartY) }; planesStartY += planeMarket.Height + 10; if (userScroll.GetPanel.IsHandleCreated) { userScroll.GetPanel.Invoke(new Action(() => userScroll.GetPanel.Controls.Add(planeMarket))); } else { userScroll.GetPanel.Controls.Add(planeMarket); } // planesUI.Add(plane.ID, planeData); } }
private void FillPlanesMarket(UserScroll userScroll) { // основные характеристики int planesStartX = 10; int planesStartY = 5; List <Plane.Models> models = new List <Plane.Models>(); models.Add(Plane.Models.AirbusA330_200); models.Add(Plane.Models.Boeing747_8I); models.Add(Plane.Models.McDonnelDouglasMD11F); foreach (var model in models) { PlaneMarket planeMarket = new PlaneMarket(game, model, 5) { Location = new Point(planesStartX, planesStartY) }; planesStartY += planeMarket.Height + 10; if (userScroll.GetPanel.IsHandleCreated) { userScroll.GetPanel.Invoke(new Action(() => userScroll.GetPanel.Controls.Add(planeMarket))); } else { userScroll.GetPanel.Controls.Add(planeMarket); } // planesUI.Add(plane.ID, planeData); } }