public SuperAction(int slideId, int performedActionId, ComAction performedAction, List<int> requiredActions) { SuperActionId = _superActionIDcounter++; SlideId = slideId; ActionId = performedActionId; PerformedAction = performedAction; RequiredActions = requiredActions; }
private void btnChangeVis_Click(object sender, RoutedEventArgs e) { var win = new ChangeObjVisibilityWindow(); if (win.ShowDialog() != true) return; var action = new ChangeObjectVisibility(_defaultEventType, win.ChosenVis, _sourceObjectId, win.SelObject.ObjectId); Act = action; DialogResult = true; Close(); }
private void btnPlayVideo_Click(object sender, RoutedEventArgs e) { var win = new AddPlayVideoActionWindow(); if (win.ShowDialog() != true) return; Video vid = win.Video; var pv = new PlayVideo(_defaultEventType, _sourceObjectId, vid.ObjectId); Act = pv; DialogResult = true; Close(); }
private void btnPlaySound_Click(object sender, RoutedEventArgs e) { var sound = Sound.NewSound(false); var action = new PlaySound(_defaultEventType, _sourceObjectId, sound.ObjectId); var mainWin = DesignerMainWindow.GetInstance(); var currentSlideNr = mainWin.GetCurrentSlideNr(); mainWin.canMainCanvas.AddIObject(sound); mainWin.canMainCanvas.SaveAllSlideData(Practice.GetInstance().GetSlideByPosition(currentSlideNr)); Act = action; DialogResult = true; Close(); }
private ComAction LoadCommonActionAttributes(ComAction action, IEnumerable<XAttribute> attributes) { foreach (var attr in attributes) { switch (attr.Name.ToString()) { case "actionID": action.ActionId = Int32.Parse(attr.Value); break; case "eventType": action.ActionEventType = (EventType)Enum.Parse(typeof(EventType), attr.Value); break; case "sourceObjectID": action.SourceObjectId = Int32.Parse(attr.Value); break; default: break; } } return action; }
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(); }
public static void RemoveAction(this IInteractive element, ComAction action) { if (element.Actions.Contains(action)) element.Actions.Remove(action); }
public static void AddAction(this IInteractive element, ComAction action) { element.Actions.Add(action); }
private XmlElement writeChangeSlide(ComAction action, XmlElement actionElement, int slideID) { var changeSlideAction = action as ChangeSlide; actionElement.SetAttribute("nextSlide", changeSlideAction.SlideId.ToString()); var slides = Practice.GetInstance().SlideList(); var from = slides.IndexOf(slides.First(slide => slide.SlideId == slideID)); var to = slides.IndexOf(slides.First(slide => slide.SlideId == changeSlideAction.SlideId)); //actionElement.SetAttribute("moveOut", slideID < changeSlideAction.SlideId ? "right" : "left"); actionElement.SetAttribute("moveOut", from < to ? "right" : "left"); return actionElement; }
private XmlElement writePlaySound(ComAction action, XmlElement actionElement) { var playSoundAction = action as PlaySound; try { string soundLocation = ""; soundLocation = playSoundAction.Sound.ObjectName; actionElement.SetAttribute("targetObjectID", playSoundAction.TargetObjectId.ToString()); //actionElement.SetAttribute("path", "sounds\\" + soundLocation); //actionElement.SetAttribute("zIndex", playSoundAction.sound.Z.ToString()); //actionElement.SetAttribute("lX", playSoundAction.sound.TopLeftCorner.X.ToString()); //actionElement.SetAttribute("rX", playSoundAction.sound.BottomRightCorner.X.ToString()); //actionElement.SetAttribute("ty", playSoundAction.sound.TopLeftCorner.Y.ToString()); //actionElement.SetAttribute("by", playSoundAction.sound.BottomRightCorner.Y.ToString()); return actionElement; } catch (NullReferenceException e) { MessageBox.Show(e.Message); return null; //Log stack trace! } }
private XmlElement writeObjectVisibility(ComAction action, XmlElement actionElement) { var changeVisibleAction = action as ChangeObjectVisibility; if (changeVisibleAction != null) { actionElement.SetAttribute("targetObjectID", changeVisibleAction.Object.ObjectId.ToString()); actionElement.SetAttribute("newVisibility", changeVisibleAction.Visible.ToString()); } else throw new NullReferenceException(); return actionElement; }
private XmlElement writePlayVideo(ComAction action, XmlElement actionElement ) { var playVideoAction = action as PlayVideo; try { string videoLocation = ""; videoLocation = playVideoAction.Video.ObjectName; actionElement.SetAttribute("targetObjectID", playVideoAction.TargetObjectId.ToString()); //actionElement.SetAttribute("resourceRemote", playVideoAction.Video.RemoteSource.ToString()); //actionElement.SetAttribute("path", "videos\\" + videoLocation); //actionElement.SetAttribute("zIndex", playVideoAction.Video.Z.ToString()); //actionElement.SetAttribute("lX", Utility.ConvertXCoordinate(playVideoAction.Video.TopLeftCorner.X)); //actionElement.SetAttribute("tY", Utility.ConvertYCoordinate(playVideoAction.Video.TopLeftCorner.Y)); //actionElement.SetAttribute("rX", Utility.ConvertXCoordinate(playVideoAction.Video.BottomRightCorner.X)); //actionElement.SetAttribute("bY", Utility.ConvertYCoordinate(playVideoAction.Video.BottomRightCorner.Y)); return actionElement; } catch (NullReferenceException e) { MessageBox.Show(e.Message); return null; //Log stack trace! } }
private XmlElement writeChangeFontSize(ComAction action, XmlElement actionElement) { var changeFontSizeAction = action as ChangeFontSize; try { actionElement.SetAttribute("targetObjectID", changeFontSizeAction.TargetObjectId.ToString()); actionElement.SetAttribute("newFontSizeRatio", changeFontSizeAction.NewFontSize.ToString()); return actionElement; } catch (NullReferenceException e) { MessageBox.Show(e.Message); return null; //Log stack trace! } }
private XmlElement writeDropObject(ComAction action, XmlElement actionElement) { var dropObjectAction = action as DropObject; try { actionElement.SetAttribute("targetObjectID", dropObjectAction.TargetObjectId.ToString()); actionElement.SetAttribute("dropSourceID", dropObjectAction.DragObjectId.ToString()); return actionElement; } catch (NullReferenceException e) { MessageBox.Show(e.Message); return null; //Log stack trace! } }