Implemented copy function for text element's keys
This commit is contained in:
4 files changed
+48
-18
No files matched your search
@@ -86,6 +86,13 @@ public partial class TextElements : UserControl
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// When the user press Ctrl + C, copy the text element's key to the clipboard:
|
||||
this.listTextElements.KeyDown += (sender, e) =>
|
||||
{
|
||||
if (e is {Control: true, KeyCode: Keys.C})
|
||||
this.buttonCopyKey.PerformClick();
|
||||
};
|
||||
}
|
||||
|
||||
// Loads all the text elements for the current section.
|
||||
@@ -236,8 +243,11 @@ public partial class TextElements : UserControl
|
||||
|
||||
private async void textBoxFilter_KeyUp(object sender, KeyEventArgs e) => await this.LoadTextElements();
|
||||
|
||||
private void buttonCopyKey_Click(object sender, EventArgs e)
|
||||
private async void buttonCopyKey_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if(this.DesignMode || this.currentTextElement is null)
|
||||
return;
|
||||
|
||||
Clipboard.SetText(await TextElementProcessor.GetKey(this.currentTextElement.Id));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user