// Start is called before the first frame update
 void Start()
 {
     FireballShot   = FireBallContainer.GetComponent <AudioSource>();
     BackgroundShot = MusicContainer.GetComponent <AudioSource>();
     SoundSR        = SoundButton.GetComponent <SpriteRenderer>();
     MusicSR        = MusicButton.GetComponent <SpriteRenderer>();
 }
        public ListSongsVM(MusicContainer MusicContainer) : this()
        {
            this.MusicContainer = MusicContainer;

            Songs = new ObservableCollection <Song>(MusicContainer.Songs);
            //Songs.Clear();
            //if (MusicContainer != null)
            //    foreach (var item in )
            //        Songs.Add(item);
        }
Exemple #3
0
 static void Main(string[] args)
 {
     using (MusicContainer music = new MusicContainer())
         {
             using (TransactionScope transaction = new TransactionScope())
             {
                 Artist artist = new Artist { Name = "Test" };
                 music.Artists.AddObject(artist);
                 music.SaveChanges();
             }
             // The transaction ended without Complete(); the changes are abandoned?
         }
 }
 static void Main(string[] args)
 {
     using (TransactionScope transaction = new TransactionScope())
     {
         using (MusicContainer music = new MusicContainer())
         {
             Artist artist = new Artist {
                 Name = "Test"
             };
             music.Artists.AddObject(artist);
             music.SaveChanges();
         }
     }
 }
Exemple #5
0
        public async Task <IDacpList> GetGroupedSongsAsync()
        {
            var songs = await GetSongsAsync().ConfigureAwait(false);

            if (songs == null || songs.Count == 0)
            {
                return(new DacpList <Song>(false));
            }

            ItemGroup <Song>             currentGroup = null;
            DacpList <ItemGroup <Song> > result       = new DacpList <ItemGroup <Song> >(true);

            MusicContainer musicContainer = Container as MusicContainer;

            foreach (var song in songs)
            {
                if (currentGroup == null || currentGroup.Key != song.AlbumName)
                {
                    currentGroup = new ItemGroup <Song>(song.AlbumName);
                    if (musicContainer != null && song.AlbumPersistentID != 0)
                    {
                        currentGroup.KeyObject = await musicContainer.GetAlbumByPersistentIDAsync(song.AlbumPersistentID).ConfigureAwait(false);
                    }
                    result.Add(currentGroup);
                }
                currentGroup.Add(song);
            }

            if (result.Count == 0)
            {
                return(new DacpList <Song>(false));
            }

            if (result.Count == 1 && string.IsNullOrEmpty(result[0].Key))
            {
                return(result[0].ToDacpList());
            }

            return(result);
        }
Exemple #6
0
 private void Awake()
 {
     MC = this;
 }
Exemple #7
0
 protected override DACPGenre GetGenre(MusicContainer container)
 {
     return(new DACPGenre(CurrentContainer, CurrentGenreName));
 }