Resolve "Feature: Show completion" #74

Merged
thorsten merged 9 commits from 28-feature-show-completion into main 2022-09-26 20:09:55 +00:00
2 changed files with 15 additions and 2 deletions
Showing only changes of commit 6101f49f44 - Show all commits

View File

@ -23,4 +23,14 @@ internal static class AppEvents
internal static void TextElementChanged(TextElement? textElement) => WhenTextElementChanged?.Invoke(null, textElement);
#endregion
#region Translation was changed
// Translation changed event which can be subscribed:
internal static event EventHandler<Translation?> WhenTranslationChanged;
// Method to raise the translation changed event:
internal static void TranslationChanged(Translation? translation) => WhenTranslationChanged?.Invoke(null, translation);
#endregion
}

View File

@ -124,8 +124,11 @@ public sealed partial class Translation : UserControl
private async void SaveChanges(object? sender, ElapsedEventArgs e)
{
if (this.currentTranslationId > -1)
await TranslationProcessor.SaveChangedTranslation(this.currentTranslationId, this.textBox.Text, this.checkBoxManual.Checked);
{
var storedTranslation = await TranslationProcessor.SaveChangedTranslation(this.currentTranslationId, this.textBox.Text, this.checkBoxManual.Checked);
AppEvents.TranslationChanged(storedTranslation.Result);
}
if(this.ParentForm is UI_WinForms.Main main)
main.RemoveDeferredSaveOperation(this.currentTranslationId);