示例#1
0
        public void Remove(Mp3SongViewModel paramMp3SongViewModel)
        {
            if (this.Mp3SongViewModels.Remove(paramMp3SongViewModel))
            {
                this.RaisePropertyChanged(() => this.Mp3SongViewModels);
                return;
            }

            this.dialogService.ShowMessage(Resources.DataGridVM_Exception_Remove, string.Format(Resources.DataGridVM_Inner_Exception_Remove, paramMp3SongViewModel.FilePath));
        }
示例#2
0
        private void MoveDownSelectedElements()
        {
            for (int i = this.Mp3SongViewModels.Count - 2; i >= 0; i--)
            {
                int upperElement = i;
                int lowerElement = i + 1;

                if (!this.SelectedMp3SongViewModels.Contains(this.Mp3SongViewModels[lowerElement]) && this.SelectedMp3SongViewModels.Contains(this.Mp3SongViewModels[upperElement]))
                {
                    Mp3SongViewModel tempMp3SongViewModel = this.Mp3SongViewModels[lowerElement];
                    this.Mp3SongViewModels.Remove(tempMp3SongViewModel);
                    this.Mp3SongViewModels.Insert(upperElement, tempMp3SongViewModel);
                }
            }
        }
示例#3
0
        private void MoveUpSelectedElements()
        {
            for (int i = 1; i < this.Mp3SongViewModels.Count; i++)
            {
                int upperElement = i - 1;
                int lowerElement = i;

                if (!this.SelectedMp3SongViewModels.Contains(this.Mp3SongViewModels[upperElement]) && this.SelectedMp3SongViewModels.Contains(this.Mp3SongViewModels[lowerElement]))
                {
                    Mp3SongViewModel tempMp3SongViewModel = this.Mp3SongViewModels[upperElement];
                    this.Mp3SongViewModels.Remove(tempMp3SongViewModel);
                    this.Mp3SongViewModels.Insert(lowerElement, tempMp3SongViewModel);
                }
            }
        }
示例#4
0
        public void AddWhenNew(string paramFilePath)
        {
            try
            {
                if (!this.IsNewMp3Song(paramFilePath))
                {
                    return;
                }

                Mp3Song          mp3Song          = new Mp3Song(this.modelFactory.CreateMp3File(paramFilePath), this.modelFactory.CreateFileModifier());
                Mp3SongViewModel mp3SongViewModel = new Mp3SongViewModel(mp3Song, this.dialogService);

                this.Mp3SongViewModels.Add(mp3SongViewModel);
            }
            catch (FileException)
            {
                this.dialogService.ShowMessage(Resources.DataGridVM_Exception_Add, string.Format(Resources.DataGridVM_Inner_Exception_Add, paramFilePath));
            }
        }