Ejemplo n.º 1
0
        /// <exception cref="InvalidOperationException"></exception>
        public void RemoveLastRow()
        {
            if (rows.Count == 0)
            {
                throw new InvalidOperationException();
            }

            var rowToRemove = rows[rows.Count - 1];

            rowToRemove.Items.Dispose();
            rowToRemove.Control.Dispose();
            rows.RemoveAt(rows.Count - 1);
            RowCountChanged?.Invoke(this, EventArgs.Empty);
            AlternatesChanged?.Invoke(this, EventArgs.Empty);
        }
Ejemplo n.º 2
0
        public void AddRow()
        {
            var row = new AlternateRowItems();

            row.Init(() => destSidProvider.Icao, () => airwayNetwork.AirportList);
            row.AddToLayoutPanel(layoutPanel);
            row.IcaoTxtBox.TextChanged += (s, e) =>
                                          AlternatesChanged?.Invoke(this, EventArgs.Empty);

            var controller = new AltnRowControl(this, row);

            controller.Subsribe();

            rows.Add(new AltnRow()
            {
                Items = row, Control = controller
            });
            RowCountChanged?.Invoke(this, EventArgs.Empty);
            AlternatesChanged?.Invoke(this, EventArgs.Empty);
        }