public DiscPanel GetLastDiscFromDiscParent(DiscPanel disc) { var parent = disc.Parent as ITowerUserControl; var lastPanel = parent?.DiscController.GetDiscs().LastOrDefault(); return(lastPanel); }
private void AddDisc(Color color, int order, int weight = 1) { var disc = new DiscPanel { Weight = weight, Order = order, BackColor = color }; disc.UpdateDisc(_towerUserControl.ClientRectangle); _towerUserControl.Controls.Add(disc); }