public bool ImportSong(PcoSong song, bool overwrite) { var arr = song.Arrangements.FirstOrDefault(); if (arr == null) return false; var presentation = this.connector.GetImportedPresentation( arr.ChordChart, song.Title); if (presentation == null) return false; presentation.CCLINo = string.Format("{0}", song.CcliId); presentation.Author = song.Author; presentation.Publisher = song.Copyright; presentation.Title = song.Title; presentation.IsCopyrightDisplayed = true; foreach (var arrangement in song.Arrangements) { this.SetArrangement(presentation, arrangement); } RVPresentationDocument.AddPresentation(presentation, overwrite); return true; }
public bool ImportSong(PcoSong song, bool overwrite) { var arr = song.Arrangements.FirstOrDefault(); if (arr == null) { return(false); } var presentation = this.connector.GetImportedPresentation( arr.ChordChart, song.Title); if (presentation == null) { return(false); } presentation.CCLINo = string.Format("{0}", song.CcliId); presentation.Author = song.Author; presentation.Publisher = song.Copyright; presentation.Title = song.Title; presentation.IsCopyrightDisplayed = true; foreach (var arrangement in song.Arrangements) { this.SetArrangement(presentation, arrangement); } RVPresentationDocument.AddPresentation(presentation, overwrite); return(true); }
public SongViewModel(PcoSong pco, Func <RVPresentation> presentationFac) { this.presentationFac = new Lazy <RVPresentation>(presentationFac); this.Pco = pco; this.arrangements = new Lazy <IList <ArrangementViewModel> >(() => this.Pco.Arrangements.Select(x => new ArrangementViewModel { Arrangement = x, Imported = this.Presentation != null && this.Presentation.GroupArrangements.Any(y => y.Label.Label == x.Name) }).ToList()); }
public SongViewModel(PcoSong pco, Func<RVPresentation> presentationFac) { this.presentationFac = new Lazy<RVPresentation>(presentationFac); this.Pco = pco; this.arrangements = new Lazy<IList<ArrangementViewModel>>(() => this.Pco.Arrangements.Select(x => new ArrangementViewModel { Arrangement = x , Imported = this.Presentation != null && this.Presentation.GroupArrangements.Any(y => y.Label.Label == x.Name) }).ToList()); }