Exemple #1
0
        /// <summary>
        /// Programmets startpunkt.
        /// </summary>
        static void Main()
        {
            bool            exit = false;
            NoiseObjectType type = NoiseObjectType.Indefinite;

            do
            {
                switch (GetMenuChoice())
                {
                case 0:
                    exit = true;
                    continue;

                case 1:
                    type = NoiseObjectType.Cat;
                    break;

                case 2:
                    type = NoiseObjectType.Dog;
                    break;

                case 3:
                    type = NoiseObjectType.Car;
                    break;

                case 4:
                    Console.Clear();
                    Test test = new Test();
                    test.Run();
                    continue;

#if DEBUG
                default:
                    Debug.Assert(false, "Hantering av menyalternativet saknas.");
                    continue;
#endif
                }

                Console.Clear();
                INoise noise = CreateNoiseObject(type);
                noise.MakeNoise();
                ContinueOnKeyPressed();
            } while (!exit);
        }
Exemple #2
0
 private void DoAction(INoise noise)
 {
     noise.MakeNoise();
 }
Exemple #3
0
 private void DoActivity(INoise noise)
 {
     noise.MakeNoise();
 }