/// <summary> /// Event Handler for SelectedCaption.PropertyChanged. Updates controls when the selected /// Caption is changed from other parts of the program. /// </summary> /// <param name="sender">Sender</param> /// <param name="e">Event Args</param> private void SelectedCaption_PropertyChanged(object sender, PropertyChangedEventArgs e) { //Switch based on property name switch (e.PropertyName) { case Caption.PropertyNames.Alignment: break; case Caption.PropertyNames.Begin: break; case Caption.PropertyNames.End: break; case Caption.PropertyNames.Location: SetGB_Location(SelectedCaption.Location); break; case Caption.PropertyNames.Duration: break; case Caption.PropertyNames.Speaker: break; case Caption.PropertyNames.Text: CaptionTextBox.Text = SelectedCaption.Text; break; case Caption.PropertyNames.Words: break; default: throw new ArgumentException(string.Format("Property Name '{0}' isn't a valid property", e.PropertyName), "e"); } //Update Caption in CaptionView CaptionView.Invalidate(); //Update Timeline Timeline.Redraw(); }
/// <summary> /// Handles the CaptionTimestampChanged Event. Updates the captions in CaptionView. /// </summary> /// <param name="sender">Sender</param> /// <param name="e">Event Args</param> private void Timeline_CaptionTimestampChanged(object sender, TimelineCaptionTimestampChangedEventArgs e) { //Console.WriteLine("Caption Timestamp Changed!"); //Force Captionview to be repainted CaptionView.Invalidate(); }
/// <summary> /// Handles the CaptionMoved Event. Updates the captions in CaptionView. /// </summary> /// <param name="sender">Sender</param> /// <param name="e">Event Args</param> private void Timeline_CaptionMoved(object sender, EventArgs e) { //Force Captionview to be repainted CaptionView.Invalidate(); }