private void HandleNumberSelection(ImageButton sender, int num, bool specialNumber = false) { if (specialNumber) { if (SpecialNumber == num)// unselect { SpecialNumber = 0; } else { SpecialNumber = num; } } else { if (IPole.Contains(num)) { IPole.Remove(num); } else if (IPole.Count < 6) { IPole.Add(num); } } }
private void SetButtonCommandArguments(int argumentKey, ImageButton btnI, bool isSpecialNumber = false) { if (argumentKey > 0) { if (isSpecialNumber && SpecialNumber == argumentKey) { btnI.CssClass = string.Format("{0} {1}", btnI.CssClass, activeSelectionClass); } else if (IPole.Contains(argumentKey)) { btnI.CssClass = string.Format("{0} {1}", btnI.CssClass, activeSelectionClass); } btnI.AlternateText = argumentKey.ToString(); btnI.CommandArgument = argumentKey.ToString(); } else { btnI.Visible = false; } }