private void ListBoxItem_Selected_14(object sender, RoutedEventArgs e)
        {
            StopAllMusic();
            Doves.Play();
            BitmapImage newIm = new BitmapImage();

            newIm.BeginInit();
            newIm.UriSource = new Uri(@"C:\Users\admin\Desktop\VirtualOrchestra\GUI\Resources\Prince.jpg");
            newIm.EndInit();
            PreviewImage.Source = newIm;
            ArtistName.Content  = "Prince";
            SongName.Content    = "When Doves Cry";
            YearText.Content    = "1984";
            songFile            = @"C:\Users\admin\Desktop\VirtualOrchestra\Sample MIDIs\doves.mid";
            songName            = "Prince: When Doves Cry";
        }
        private void StopAllMusic()
        {
            bool parAndPause = ParaAnd.CanPause;

            if (parAndPause == true)
            {
                ParaAnd.Stop();
            }
            bool fallPause = Fall.CanPause;

            if (fallPause == true)
            {
                Fall.Stop();
            }
            bool prayerPause = Prayer.CanPause;

            if (prayerPause == true)
            {
                Prayer.Stop();
            }
            bool hardDayPause = HardDay.CanPause;

            if (hardDayPause == true)
            {
                HardDay.Stop();
            }
            bool sym5Pause = Sym5.CanPause;

            if (sym5Pause == true)
            {
                Sym5.Stop();
            }
            bool rockAmadeusPause = RockAmadeus.CanPause;

            if (rockAmadeusPause == true)
            {
                RockAmadeus.Stop();
            }
            bool getLuckyPause = GetLucky.CanPause;

            if (getLuckyPause == true)
            {
                GetLucky.Stop();
            }
            bool mtKingPause = MtKing.CanPause;

            if (mtKingPause == true)
            {
                MtKing.Stop();
            }
            bool alwaysPause = Always.CanPause;

            if (alwaysPause == true)
            {
                Always.Stop();
            }
            bool airGPause = AirG.CanPause;

            if (airGPause == true)
            {
                AirG.Stop();
            }
            bool newWorldPause = NewWorld.CanPause;

            if (newWorldPause == true)
            {
                NewWorld.Stop();
            }
            bool swanLakePause = SwanLake.CanPause;

            if (swanLakePause == true)
            {
                SwanLake.Stop();
            }
            bool bohemianPause = Bohemian.CanPause;

            if (bohemianPause == true)
            {
                Bohemian.Stop();
            }
            bool dovesPause = Doves.CanPause;

            if (dovesPause == true)
            {
                Doves.Stop();
            }
            bool canHeatPause = CanHeat.CanPause;

            if (canHeatPause == true)
            {
                CanHeat.Stop();
            }
            bool flashPause = Flash.CanPause;

            if (flashPause == true)
            {
                Flash.Stop();
            }
            bool heyYaPause = HeyYa.CanPause;

            if (heyYaPause == true)
            {
                HeyYa.Stop();
            }
            bool lifePause = Life.CanPause;

            if (lifePause == true)
            {
                Life.Stop();
            }
            bool mansWorldPause = MansWorld.CanPause;

            if (mansWorldPause == true)
            {
                MansWorld.Stop();
            }
            bool stairwayPause = Stairway.CanPause;

            if (stairwayPause == true)
            {
                Stairway.Stop();
            }
            bool superstitionPause = Superstition.CanPause;

            if (superstitionPause == true)
            {
                Superstition.Stop();
            }
        }
 private void DovesLoop(object sender, RoutedEventArgs e)
 {
     Doves.Position = TimeSpan.Zero;
     Doves.Play();
 }
示例#4
0
    public List<Gift> PresentsFromTrueLoveByDay(byte dayOfChristmas)
    {
        var gifts = new List<Gift>();

        if (dayOfChristmas > 12)
        {
          throw new GreedyException();
        }

        if (dayOfChristmas == 12)
        {
        var drummers = new Drummers { Quantity = 12, Drumming = true };
        gifts.Add(drummers);
        }

        if (dayOfChristmas >= 11)
        {
          var pipers = new Pipers { Quantity = 11, Piping = true };
          gifts.Add(pipers);
        }

        if (dayOfChristmas >= 10)
        {
          var lords = new Lords { Quantity = 10, Leaping = false, ALeaping = true };
          gifts.Add(lords);
        }

        if (dayOfChristmas >= 9)
        {
          var ladies = new Ladies { Quantity = 9, Status = Action.Dancing };
          gifts.Add(ladies);
        }

        if (dayOfChristmas >= 8)
        {
          var maids = new Maids { Quantity = 8, Milking = false, AMilking = true };
          gifts.Add(maids);
        }

        if (dayOfChristmas >= 7)
        {
          var swans = new Swans { Quantity = 7, Swimming = false, ASwimming = true };
          gifts.Add(swans);
        }

        if (dayOfChristmas >= 6)
        {
          var geese = new Geese { Quantity = 6, Laying = false, ALaying = true };
          gifts.Add(geese);
        }

        if (dayOfChristmas >= 5)
        {
          var rings = new Rings { Quantity = 5, Type = Metal.GoOld };
          gifts.Add(rings);
        }

        if (dayOfChristmas >= 4)
        {
          var birds = new Birds { Quantity = 4, Calling = true };
          gifts.Add(birds);
        }

        if (dayOfChristmas >= 3)
        {
          var hens = new Hens { Quantity = 3, CountryOfOrigin = "fr-FR" };
          gifts.Add(hens);
        }

        if (dayOfChristmas >= 2)
        {
          var doves = new Doves { Quantity = 2, Type = DoveType.Turtle };
          gifts.Add(doves);
        }

        if (dayOfChristmas >= 1)
        {
          var partridge = new Partridge { Quantity = 1, Location = Trees.Pair };
          gifts.Add(partridge);
        }

        return gifts;
    }