private static void AddToElement(IInteractive element, EventType eventType) { var w = new JumpToSlideWindow(); if (w.ShowDialog() != true) return; var slideId = Practice.GetInstance().GetSlideByPosition(w.SelectedSlideIndex).SlideId; var action = new ChangeSlide(eventType, slideId, element.ObjectId); element.AddAction(action); var mainWin = DesignerMainWindow.GetInstance(); var currentSlideNr = mainWin.GetCurrentSlideNr(); mainWin.canMainCanvas.SaveAllSlideData(Practice.GetInstance().GetSlideByPosition(currentSlideNr)); }
private void btnChangeSlide_Click(object sender, RoutedEventArgs e) { var w = new JumpToSlideWindow(); if (w.ShowDialog() != true) return; int slideId = Practice.GetInstance().GetSlideByPosition(w.SelectedSlideIndex).SlideId; var cs = new ChangeSlide(_defaultEventType, slideId, _sourceObjectId); Act = cs; DialogResult = true; Close(); }
private ComAction LoadChangeSlide(IEnumerable<XAttribute> attributes) { ChangeSlide action = new ChangeSlide(); action.Type = ActionType.changeSlide; foreach (var attr in attributes) { switch (attr.Name.ToString()) { case "nextSlide": action.SlideId = Int32.Parse(attr.Value); break; default: break; } } return action; }
private void AddSuperActionToSlide(Picture correctPic) { //add SuperAction - can jump to next slide after correctPic is chosen IsSwitchable = false; var act = new ChangeSlide(EventType.conditionSatisfied, SlideId + 1, SlideId + 1); //TODO: pametniji način za slajdId var mainWin = DesignerMainWindow.GetInstance(); SuperAction = new SuperAction(mainWin.GetCurrentSlideId(), act.ActionId, act); SuperAction.AddRequiredAction(correctPic.Actions[0].ActionId); }
private void btnSuperAction_Click(object sender, RoutedEventArgs e) { var w = new JumpToSlideWindow(); if (w.ShowDialog() != true) return; var mainWin = DesignerMainWindow.GetInstance(); // int slideId = Practice.GetInstance().GetSlideByPosition(mainWin.GetCurrentSlideNr()).SlideId; int slideId = Practice.GetInstance().GetSlideByPosition(w.SelectedSlideIndex).SlideId; var act = new ChangeSlide(EventType.conditionSatisfied, slideId, w.SelectedSlideIndex); SuperAction = new SuperAction(slideId, act.ActionId, act); }