private void btnCancel_Click(object sender, RoutedEventArgs e) { this.Presentation = null; this.DialogResult = false; CloseWindow(); }
private Webb.Playbook.Data.Presentation GetPresentation() { Webb.Playbook.Data.Presentation pres = new Webb.Playbook.Data.Presentation(); if (Presentation != null) { pres.Name = Presentation.Name; } PresentationPlay pPrevPay = null; foreach (object obj in this.lbSelectedFiles.Items) { if (obj is ViewModel.FormationViewModel) { PresentationPlay pPlay = new PresentationPlay(); pPrevPay = pPlay; pPlay.PlayPath = (obj as ViewModel.FormationViewModel).FormationPath; pres.Plays.Add(pPlay); } else if (obj is ViewModel.PlayViewModel) { PresentationPlay pPlay = new PresentationPlay(); pPrevPay = pPlay; pPlay.PlayPath = (obj as ViewModel.PlayViewModel).PlayPath; pres.Plays.Add(pPlay); } else if (obj is ViewModel.TitleViewModel) { PresentationPlay pPlay = new PresentationPlay(); pPrevPay = pPlay; pPlay.PlayPath = (obj as ViewModel.TitleViewModel).TitlePath; pres.Plays.Add(pPlay); } else if (obj is ViewModel.PPTViewModel && pPrevPay != null) { pPrevPay.Videos.Add((obj as ViewModel.PPTViewModel).PptPath); } else if (obj is ViewModel.VideoViewModel && pPrevPay != null) { pPrevPay.Videos.Add((obj as ViewModel.VideoViewModel).VideoInfo); } } return(pres); }
public SelectPlayWindow(ViewModel.FormationRootViewModel formationRootViewModel, ViewModel.PlaybookRootViewModel playbookRootViewModel, Webb.Playbook.Data.Presentation presentation) { InitializeComponent(); treeFormation.DataContext = formationRootViewModel; treePlaybook.DataContext = playbookRootViewModel; // set presentation Presentation = presentation; SetPresentation(); }
private void btnSavePresentation_Click(object sender, RoutedEventArgs e) { if (this.lbSelectedFiles.Items.Count == 0) { MessageBox.Show("Please select games"); return; } Presentation = GetPresentation(); NameWindow nw = new NameWindow() { Title = "Save Presentation", Owner = this, SelectAll = true, FileName = Presentation.Name, }; if (nw.ShowDialog() == true) { Presentation.Name = nw.FileName; if (System.IO.File.Exists(PresentationPath)) { if (MessageBox.Show("This presentation already exists, do you want to overwrite the existing presentation ?", "Webb Playbook", MessageBoxButton.YesNo) == MessageBoxResult.No) { return; } } this.DialogResult = true; CloseWindow(); } }