private void OnCurrentSubtitlesChanged(SubtitlesFile oldSubtitles, SubtitlesFile newSubtitles) { var temporaryEventHolder = CurrentSubtitlesChanged; if (temporaryEventHolder != null) { temporaryEventHolder(this, new SubtitlesChangedEventArgs(oldSubtitles, newSubtitles)); } }
/// <summary> /// Wczytuje zawartość pliku napisów o podanej ścieżce. /// </summary> /// <param name="filePath">Ścieżka pliku napisów.</param> /// <exception cref="System.Exception">Not supported subtitles format.</exception> public void Load(String filePath) { CurrentSubtitles = new SubtitlesFile(filePath); if (!IsCurrentSubtitlesExtensionSupported()) { throw new Exception("Not supported subtitles format."); } CurrentSubtitles.Load(); CurrentSubtitlesFormat = GetCurrentSubtitlesFormat(); OnLoad(); }
/// <summary> /// Konstruktor. /// </summary> /// <param name="oldSubtitles">Obiekt przed zdarzeniem.</param> /// <param name="newSubtitles">Obiekt po zdarzeniem.</param> public SubtitlesChangedEventArgs(SubtitlesFile oldSubtitles, SubtitlesFile newSubtitles) { this.OldSubtitles = oldSubtitles; this.NewSubtitles = newSubtitles; }
/// <summary> /// Konstruktor. /// </summary> /// <param name="currentSubtitles">Obiekt napisów który zostanie ustawiony jako bieżący.</param> public SubtitlesManager(SubtitlesFile currentSubtitles) { this.supportedSubtitlesFormats = new HashSet <SubtitlesFileFormat>(); this.CurrentSubtitles = currentSubtitles; }