static public MusicViewModel getInstance()
        {
            if (_Instance == null)
            {
                _Instance = new MusicViewModel();
            }

            return(_Instance);
        }
Пример #2
0
        private void SwitchMedia(String methodName)
        {
            if (_IsPlayingPlaylist)
            {
                System.Reflection.MethodInfo method = typeof(PlayListViewModel).GetMethod(methodName);
                PlayPlaylist(method.Invoke(PlayListViewModel.getInstance(), new object[] {}) as Model.Playlist);
            }
            else
            {
                Type   type;
                object obj;

                switch (_CurrentMediaType)
                {
                case Model.Media.MediaType.PICTURE:
                    type = typeof(PictureViewModel);
                    obj  = PictureViewModel.getInstance();
                    break;

                case Model.Media.MediaType.VIDEO:
                    type = typeof(VideoViewModel);
                    obj  = VideoViewModel.getInstance();
                    break;

                case Model.Media.MediaType.MUSIC:
                    type = typeof(MusicViewModel);
                    obj  = MusicViewModel.getInstance();
                    break;

                default:
                    return;
                }

                System.Reflection.MethodInfo method = type.GetMethod(methodName);
                PlayMedia(method.Invoke(obj, new object[] {}) as Model.Media);
            }
        }
        public static MusicViewModel getInstance()
        {
            if (_Instance == null)
                _Instance = new MusicViewModel();

            return _Instance;
        }