private bool CheckPancakeSize(Pancake pancake) { List <Pancake> matches = pancakelist.Where(p => p.Size == pancake.Size).ToList(); if (matches.Count == 0) { return(true); } else { return(false); } }
private void MakePancakes() { int count = 0; while (count < numericUpDownCntPancakes.Value) { Pancake pancake = new Pancake(); if (CheckPancakeSize(pancake)) { pancakelist.Add(pancake); count++; } } }