Prevent storing data after pre-filling
This commit is contained in:
parent
d9629ab53d
commit
d521aca2f7
@ -10,6 +10,7 @@ public sealed partial class Translation : UserControl
|
|||||||
private readonly Timer saveTimer;
|
private readonly Timer saveTimer;
|
||||||
|
|
||||||
private int currentTranslationId = -1;
|
private int currentTranslationId = -1;
|
||||||
|
private bool isLoading = false;
|
||||||
|
|
||||||
public Translation()
|
public Translation()
|
||||||
{
|
{
|
||||||
@ -40,13 +41,20 @@ public sealed partial class Translation : UserControl
|
|||||||
|
|
||||||
public void Configure(DataModel.Database.Translation translation)
|
public void Configure(DataModel.Database.Translation translation)
|
||||||
{
|
{
|
||||||
|
this.isLoading = true;
|
||||||
|
|
||||||
this.currentTranslationId = translation.Id;
|
this.currentTranslationId = translation.Id;
|
||||||
this.textBox.Multiline = translation.TextElement.IsMultiLine;
|
this.textBox.Multiline = translation.TextElement.IsMultiLine;
|
||||||
this.textBox.Text = translation.Text;
|
this.textBox.Text = translation.Text;
|
||||||
|
|
||||||
|
this.isLoading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void textBox_TextChanged(object sender, EventArgs e)
|
private async void textBox_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
if(this.isLoading)
|
||||||
|
return;
|
||||||
|
|
||||||
if(this.saveTimer.Enabled)
|
if(this.saveTimer.Enabled)
|
||||||
this.saveTimer.Stop();
|
this.saveTimer.Stop();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user