Ejemplo n.º 1
0
        private void _ListMyMusic_ItemAdded(object sender, EventHandlers.ListEntryArgs e)
        {
            BGMEntry sEntryBGM = e.ListEntry as BGMEntry;

            if (sEntryBGM != null)
            {
                MyMusicStageBGM myMusicStageBGM = SoundEntryCollection.CreateMyMusicStageBGM(sEntryBGM.BGMID, (ushort)_CurrentMyMusicStage.BGMs.Count);
                _CurrentMyMusicStage.BGMs.Add(myMusicStageBGM);
                if (_CurrentSoundDBStage != null)
                {
                    foreach (SoundDBStageSoundEntry sDBStageSoundEntry in _CurrentSoundDBStage.SoundEntries)
                    {
                        if (sDBStageSoundEntry.SoundEntry.BGMFiles.Find(p => p.BGMEntry == sEntryBGM) != null)
                        {
                            return;
                        }
                    }
                    if (MessageBox.Show(Strings.WARNING_COPY_MYMUSIC, Strings.CAPTION_WARNING, MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        foreach (SoundEntry sEntry in SoundEntryCollection.SoundEntries)
                        {
                            if (sEntry.BGMFiles.Find(p => p.BGMID == sEntryBGM.BGMID) != null)
                            {
                                _CurrentSoundDBStage.SoundEntries.Add(new SoundDBStageSoundEntry(SoundEntryCollection, sEntry.SoundID));
                                break;
                            }
                        }
                        _ListSoundDB.RefreshItems();
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void _ListSoundDB_ItemAdded(object sender, EventHandlers.ListEntryArgs e)
        {
            SoundEntry sEntry = e.ListEntry as SoundEntry;

            if (sEntry != null)
            {
                foreach (SoundDBStageSoundEntry sSoundDBStageSoundEntry in _CurrentSoundDBStage.SoundEntries)
                {
                    if (sEntry.SoundID == sSoundDBStageSoundEntry.SoundEntry.SoundID)
                    {
                        MessageBox.Show(Strings.ERROR_SOUND_ADD, Strings.CAPTION_ERROR);
                        return;
                    }
                }
                _CurrentSoundDBStage.SoundEntries.Add(new SoundDBStageSoundEntry(SoundEntryCollection, sEntry.SoundID));
                //Check if bgms need to be added
                bool            needAdd          = false;
                List <BGMEntry> myMusicEntryBGMs = new List <BGMEntry>();
                foreach (MyMusicStageBGM myMusicStageBGM in _CurrentMyMusicStage.BGMs)
                {
                    myMusicEntryBGMs.Add(myMusicStageBGM.BGMEntry);
                }
                foreach (SoundEntryBGM sEntryBGM in sEntry.BGMFiles)
                {
                    if (myMusicEntryBGMs.Find(p => p.BGMID == sEntryBGM.BGMID) == null)
                    {
                        needAdd = true;
                        break;
                    }
                }
                if (needAdd && MessageBox.Show(Strings.WARNING_COPY_SOUND, Strings.CAPTION_WARNING, MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    foreach (SoundEntryBGM sEntryBGM in sEntry.BGMFiles)
                    {
                        if (myMusicEntryBGMs.Find(p => p.BGMID == sEntryBGM.BGMID) == null)
                        {
                            MyMusicStageBGM myMusicStageBGM = SoundEntryCollection.CreateMyMusicStageBGM(sEntryBGM.BGMID, (ushort)_CurrentMyMusicStage.BGMs.Count);
                            _CurrentMyMusicStage.BGMs.Add(myMusicStageBGM);
                        }
                    }
                    _ListMyMusic.RefreshItems();
                }
            }
        }