private void SendEvent(PresentationEvents presentationEvent, params object[] arg) { foreach (var subscriber in new List <IPresentationSubscriber>(Subscribers)) { subscriber.HandlePresentationEvent(presentationEvent, arg); } }
public void HandlePresentationEvent(PresentationEvents presentationEvent, params object[] arg) { if (presentationEvent == PresentationEvents.Stop) { PresentationWindow = null; PresentationFullScreen = false; PresentationHidden = false; PlayingSong = null; dpPlayingSong.DataContext = null; HandlePresentationWindowButtons(); } }
private void LateUpdate() { // Dispose Persistent Native Array Entity foreach (var gameActionEvent in PresentationEvents.GameActionEvents.SinceLastPresUpdate) { if (gameActionEvent.GameActionContext.Targets.IsCreated) { gameActionEvent.GameActionContext.Targets.Dispose(); } } PresentationEvents.Clear(); }
public void HandlePresentationEvent(PresentationEvents presentationEvent, params object[] arg) { PlayingSong pArg = null; if (arg != null && arg.Length > 0 && arg[0] is PlayingSong) { pArg = arg[0] as PlayingSong; } switch (presentationEvent) { case PresentationEvents.NewSong: PlayingSong = pArg; InitializePlayingVideo(); break; case PresentationEvents.Stop: StopExecutingEverythingDueClosingEvent(); Close(); break; case PresentationEvents.ChangeBackgroundVideo: InitializePlayingVideo(); break; } if (pArg != null) { if (!string.IsNullOrEmpty(pArg.CurrentSongItem.VerseTip)) { Settings.TipVisibility = Visibility.Visible; } else { Settings.TipVisibility = Visibility.Collapsed; } if (pArg.IsZero) { Settings.TitleVisibility = Visibility.Visible; Settings.SlidesVisibility = Visibility.Collapsed; } else { Settings.TitleVisibility = Visibility.Collapsed; Settings.SlidesVisibility = Visibility.Visible; } } if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs("PlayingSong")); } }