コード例 #1
0
        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);
            }
        }
コード例 #2
0
        private void MakePancakes()
        {
            int count = 0;

            while (count < numericUpDownCntPancakes.Value)
            {
                Pancake pancake = new Pancake();
                if (CheckPancakeSize(pancake))
                {
                    pancakelist.Add(pancake);
                    count++;
                }
            }
        }