mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Multi file import support
This commit is contained in:
parent
edbb7e71b3
commit
4afe5f1b3d
1 changed files with 6 additions and 3 deletions
|
@ -190,12 +190,15 @@ private void tsmiImportFile_Click(object sender, EventArgs e)
|
|||
{
|
||||
if (ImportRequested != null)
|
||||
{
|
||||
using (OpenFileDialog ofd = new OpenFileDialog() { Filter = "Settings (*.txt, *.json)|*.txt;*.json|All files (*.*)|*.*" })
|
||||
using (OpenFileDialog ofd = new OpenFileDialog() { Filter = "Settings (*.json)|*.json|All files (*.*)|*.*", Multiselect = true })
|
||||
{
|
||||
if (ofd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
string json = File.ReadAllText(ofd.FileName, Encoding.UTF8);
|
||||
Import(json);
|
||||
foreach (string filename in ofd.FileNames)
|
||||
{
|
||||
string json = File.ReadAllText(filename, Encoding.UTF8);
|
||||
Import(json);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue