Multi file import support

This commit is contained in:
Jaex 2015-07-22 15:30:01 +03:00
parent edbb7e71b3
commit 4afe5f1b3d

View file

@ -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);
}
}
}
}